From 466ae11e1e0a47cd993b87b441f49148ee96d31e Mon Sep 17 00:00:00 2001 From: Prativa Bawri Date: Mon, 24 May 2021 08:29:20 -0700 Subject: [PATCH] Update iaas swagger to 8.4 Clean-up the hack/fix_vra_swagger script Signed-off-by: Prativa Bawri --- Makefile | 11 +- hack/fix_vra_swagger | 99 +- pkg/client/about/about_client.go | 45 +- pkg/client/about/get_about_page_parameters.go | 42 +- pkg/client/about/get_about_page_responses.go | 19 +- .../about/get_about_using_get1_parameters.go | 42 +- .../about/get_about_using_get1_responses.go | 4 +- .../about/get_about_using_get_parameters.go | 42 +- .../about/get_about_using_get_responses.go | 4 +- pkg/client/blueprint/blueprint_client.go | 185 +- ...create_blueprint_using_post1_parameters.go | 55 +- .../create_blueprint_using_post1_responses.go | 11 +- ...lueprint_version_using_post1_parameters.go | 62 +- ...blueprint_version_using_post1_responses.go | 14 +- ...lete_blueprint_using_delete1_parameters.go | 56 +- ...elete_blueprint_using_delete1_responses.go | 10 +- ...int_inputs_schema_using_get1_parameters.go | 54 +- ...rint_inputs_schema_using_get1_responses.go | 11 +- .../get_blueprint_using_get1_parameters.go | 91 +- .../get_blueprint_using_get1_responses.go | 11 +- ...ion_inputs_schema_using_get1_parameters.go | 59 +- ...sion_inputs_schema_using_get1_responses.go | 11 +- ...blueprint_version_using_get1_parameters.go | 88 +- ..._blueprint_version_using_get1_responses.go | 11 +- ...blueprint_versions_using_get_parameters.go | 162 +- ..._blueprint_versions_using_get_responses.go | 14 +- .../list_blueprints_using_get1_parameters.go | 206 +- .../list_blueprints_using_get1_responses.go | 11 +- ...lueprint_version_using_post1_parameters.go | 61 +- ...blueprint_version_using_post1_responses.go | 11 +- ...lueprint_version_using_post1_parameters.go | 61 +- ...blueprint_version_using_post1_responses.go | 11 +- ...lueprint_version_using_post1_parameters.go | 61 +- ...blueprint_version_using_post1_responses.go | 11 +- .../update_blueprint_using_put1_parameters.go | 62 +- .../update_blueprint_using_put1_responses.go | 11 +- .../blueprint_requests_client.go | 101 +- ...blueprint_request_using_post_parameters.go | 89 +- ..._blueprint_request_using_post_responses.go | 10 +- ...lueprint_request_using_post1_parameters.go | 55 +- ...blueprint_request_using_post1_responses.go | 14 +- ...eprint_request_using_delete1_parameters.go | 64 +- ...ueprint_request_using_delete1_responses.go | 10 +- ...et_blueprint_plan_using_get1_parameters.go | 64 +- ...get_blueprint_plan_using_get1_responses.go | 11 +- ...blueprint_request_using_get1_parameters.go | 56 +- ..._blueprint_request_using_get1_responses.go | 11 +- ...nt_resources_plan_using_get1_parameters.go | 64 +- ...int_resources_plan_using_get1_responses.go | 11 +- ...lueprint_requests_using_get1_parameters.go | 155 +- ...blueprint_requests_using_get1_responses.go | 11 +- ...blueprint_terraform_integrations_client.go | 143 +- ...int_from_mapping_using_post1_parameters.go | 47 +- ...rint_from_mapping_using_post1_responses.go | 11 +- ...lueprint_mapping_using_post1_parameters.go | 47 +- ...blueprint_mapping_using_post1_responses.go | 11 +- ...erraform_version_using_post1_parameters.go | 47 +- ...terraform_version_using_post1_responses.go | 11 +- ...raform_version_using_delete1_parameters.go | 56 +- ...rraform_version_using_delete1_responses.go | 10 +- ...ation_source_tree_using_get1_parameters.go | 65 +- ...ration_source_tree_using_get1_responses.go | 14 +- ...ource_commit_list_using_get1_parameters.go | 47 +- ...source_commit_list_using_get1_responses.go | 11 +- ...iguration_sources_using_get1_parameters.go | 84 +- ...figuration_sources_using_get1_responses.go | 8 +- ...terraform_version_using_get1_parameters.go | 48 +- ..._terraform_version_using_get1_responses.go | 11 +- ...erraform_versions_using_get1_parameters.go | 104 +- ...terraform_versions_using_get1_responses.go | 11 +- ...rraform_version_using_patch1_parameters.go | 54 +- ...erraform_version_using_patch1_responses.go | 11 +- .../blueprint_validation_client.go | 17 +- ...lidate_blueprint_using_post1_parameters.go | 55 +- ...alidate_blueprint_using_post1_responses.go | 11 +- .../catalog_admin_items_client.go | 45 +- .../get_catalog_item_using_get_parameters.go | 56 +- .../get_catalog_item_using_get_responses.go | 9 +- .../get_catalog_items_using_get_parameters.go | 193 +- .../get_catalog_items_using_get_responses.go | 6 +- ...ate_catalog_item_using_patch_parameters.go | 62 +- ...date_catalog_item_using_patch_responses.go | 5 +- .../catalog_entitlements_client.go | 45 +- ...reate_entitlement_using_post_parameters.go | 55 +- ...create_entitlement_using_post_responses.go | 15 +- ...ete_entitlement_using_delete_parameters.go | 56 +- ...lete_entitlement_using_delete_responses.go | 5 +- .../get_entitlements_using_get_parameters.go | 57 +- .../get_entitlements_using_get_responses.go | 6 +- .../catalog_item_types_client.go | 31 +- .../get_type_by_id_using_get_parameters.go | 54 +- .../get_type_by_id_using_get_responses.go | 9 +- .../get_types_using_get_parameters.go | 104 +- .../get_types_using_get_responses.go | 6 +- .../catalog_items/catalog_items_client.go | 101 +- .../get_catalog_item_using_get1_parameters.go | 64 +- .../get_catalog_item_using_get1_responses.go | 9 +- ...get_catalog_items_using_get1_parameters.go | 190 +- .../get_catalog_items_using_get1_responses.go | 6 +- ...e_for_catalog_item_using_get_parameters.go | 63 +- ...se_for_catalog_item_using_get_responses.go | 9 +- .../get_version_by_id_using_get_parameters.go | 61 +- .../get_version_by_id_using_get_responses.go | 9 +- .../get_versions_using_get_parameters.go | 76 +- .../get_versions_using_get_responses.go | 9 +- ...uest_catalog_item_using_post_parameters.go | 62 +- ...quest_catalog_item_using_post_responses.go | 14 +- ..._for_catalog_item_using_post_parameters.go | 62 +- ...t_for_catalog_item_using_post_responses.go | 9 +- .../catalog_sources/catalog_sources_client.go | 59 +- .../delete_using_delete_parameters.go | 56 +- .../delete_using_delete_responses.go | 5 +- .../get_page_using_get_parameters.go | 120 +- .../get_page_using_get_responses.go | 6 +- .../get_using_get_parameters.go | 56 +- .../get_using_get_responses.go | 9 +- .../post_using_post_parameters.go | 63 +- .../post_using_post_responses.go | 17 +- .../cloud_account/cloud_account_client.go | 829 ++++-- .../create_aws_cloud_account_parameters.go | 55 +- .../create_aws_cloud_account_responses.go | 22 +- .../create_azure_cloud_account_parameters.go | 55 +- .../create_azure_cloud_account_responses.go | 22 +- .../create_cloud_account_parameters.go | 55 +- .../create_cloud_account_responses.go | 22 +- .../create_gcp_cloud_account_parameters.go | 55 +- .../create_gcp_cloud_account_responses.go | 22 +- .../create_nsx_t_cloud_account_parameters.go | 55 +- .../create_nsx_t_cloud_account_responses.go | 22 +- .../create_nsx_v_cloud_account_parameters.go | 55 +- .../create_nsx_v_cloud_account_responses.go | 22 +- .../create_vcf_cloud_account_parameters.go | 55 +- .../create_vcf_cloud_account_responses.go | 22 +- .../create_vmc_cloud_account_parameters.go | 55 +- .../create_vmc_cloud_account_responses.go | 22 +- ...create_vsphere_cloud_account_parameters.go | 55 +- .../create_vsphere_cloud_account_responses.go | 22 +- .../delete_aws_cloud_account_parameters.go | 54 +- .../delete_aws_cloud_account_responses.go | 21 +- .../delete_azure_cloud_account_parameters.go | 54 +- .../delete_azure_cloud_account_responses.go | 21 +- .../delete_cloud_account_nsx_t_parameters.go | 54 +- .../delete_cloud_account_nsx_t_responses.go | 21 +- .../delete_cloud_account_nsx_v_parameters.go | 54 +- .../delete_cloud_account_nsx_v_responses.go | 21 +- .../delete_cloud_account_parameters.go | 54 +- .../delete_cloud_account_responses.go | 21 +- .../delete_gcp_cloud_account_parameters.go | 54 +- .../delete_gcp_cloud_account_responses.go | 21 +- .../delete_vcf_cloud_account_parameters.go | 54 +- .../delete_vcf_cloud_account_responses.go | 21 +- .../delete_vmc_cloud_account_parameters.go | 54 +- .../delete_vmc_cloud_account_responses.go | 21 +- ...delete_vsphere_cloud_account_parameters.go | 54 +- .../delete_vsphere_cloud_account_responses.go | 21 +- .../enumerate_aws_regions_parameters.go | 55 +- .../enumerate_aws_regions_responses.go | 22 +- .../enumerate_azure_regions_parameters.go | 55 +- .../enumerate_azure_regions_responses.go | 22 +- .../enumerate_gcp_regions_parameters.go | 55 +- .../enumerate_gcp_regions_responses.go | 22 +- ...enumerate_private_images_aws_parameters.go | 54 +- .../enumerate_private_images_aws_responses.go | 2 +- ...umerate_private_images_azure_parameters.go | 54 +- ...numerate_private_images_azure_responses.go | 2 +- ...enumerate_private_images_gcp_parameters.go | 54 +- .../enumerate_private_images_gcp_responses.go | 2 +- .../enumerate_private_images_parameters.go | 54 +- .../enumerate_private_images_responses.go | 2 +- ...enumerate_private_images_vcf_parameters.go | 54 +- .../enumerate_private_images_vcf_responses.go | 2 +- ...enumerate_private_images_vmc_parameters.go | 54 +- .../enumerate_private_images_vmc_responses.go | 2 +- ...erate_private_images_vsphere_parameters.go | 54 +- ...merate_private_images_vsphere_responses.go | 2 +- .../enumerate_regions_parameters.go | 55 +- .../enumerate_regions_responses.go | 22 +- .../enumerate_vcf_regions_parameters.go | 55 +- .../enumerate_vcf_regions_responses.go | 22 +- .../enumerate_vmc_regions_parameters.go | 55 +- .../enumerate_vmc_regions_responses.go | 22 +- .../enumerate_vsphere_regions_parameters.go | 55 +- .../enumerate_vsphere_regions_responses.go | 22 +- .../get_aws_cloud_account_parameters.go | 54 +- .../get_aws_cloud_account_responses.go | 22 +- .../get_aws_cloud_accounts_parameters.go | 49 +- .../get_aws_cloud_accounts_responses.go | 19 +- .../get_azure_cloud_account_parameters.go | 54 +- .../get_azure_cloud_account_responses.go | 22 +- .../get_azure_cloud_accounts_parameters.go | 49 +- .../get_azure_cloud_accounts_responses.go | 19 +- .../get_cloud_account_parameters.go | 88 +- .../get_cloud_account_responses.go | 22 +- .../get_cloud_accounts_parameters.go | 220 +- .../get_cloud_accounts_responses.go | 19 +- .../get_gcp_cloud_account_parameters.go | 54 +- .../get_gcp_cloud_account_responses.go | 22 +- .../get_gcp_cloud_accounts_parameters.go | 49 +- .../get_gcp_cloud_accounts_responses.go | 19 +- .../get_nsx_t_cloud_account_parameters.go | 54 +- .../get_nsx_t_cloud_account_responses.go | 22 +- .../get_nsx_t_cloud_accounts_parameters.go | 49 +- .../get_nsx_t_cloud_accounts_responses.go | 19 +- .../get_nsx_v_cloud_account_parameters.go | 54 +- .../get_nsx_v_cloud_account_responses.go | 22 +- .../get_nsx_v_cloud_accounts_parameters.go | 49 +- .../get_nsx_v_cloud_accounts_responses.go | 19 +- .../get_vcf_cloud_account_parameters.go | 54 +- .../get_vcf_cloud_account_responses.go | 22 +- .../get_vcf_cloud_accounts_parameters.go | 49 +- .../get_vcf_cloud_accounts_responses.go | 19 +- .../get_vmc_cloud_account_parameters.go | 54 +- .../get_vmc_cloud_account_responses.go | 22 +- .../get_vmc_cloud_accounts_parameters.go | 49 +- .../get_vmc_cloud_accounts_responses.go | 19 +- .../get_vsphere_cloud_account_parameters.go | 54 +- .../get_vsphere_cloud_account_responses.go | 22 +- .../get_vsphere_cloud_accounts_parameters.go | 49 +- .../get_vsphere_cloud_accounts_responses.go | 19 +- .../update_aws_cloud_account_parameters.go | 60 +- .../update_aws_cloud_account_responses.go | 22 +- .../update_azure_cloud_account_parameters.go | 60 +- .../update_azure_cloud_account_responses.go | 22 +- .../update_cloud_account_parameters.go | 60 +- .../update_cloud_account_responses.go | 22 +- .../update_gcp_cloud_account_parameters.go | 60 +- .../update_gcp_cloud_account_responses.go | 22 +- .../update_nsx_t_cloud_account_parameters.go | 60 +- .../update_nsx_t_cloud_account_responses.go | 22 +- .../update_nsx_v_cloud_account_parameters.go | 60 +- .../update_nsx_v_cloud_account_responses.go | 22 +- .../update_vcf_cloud_account_parameters.go | 60 +- .../update_vcf_cloud_account_responses.go | 22 +- .../update_vmc_cloud_account_parameters.go | 60 +- .../update_vmc_cloud_account_responses.go | 22 +- ...update_vsphere_cloud_account_parameters.go | 60 +- .../update_vsphere_cloud_account_responses.go | 22 +- pkg/client/compute/compute_client.go | 255 +- .../compute/create_machine_parameters.go | 55 +- .../compute/create_machine_responses.go | 22 +- .../create_machine_snapshot_parameters.go | 60 +- .../create_machine_snapshot_responses.go | 22 +- .../compute/delete_machine_parameters.go | 62 +- .../compute/delete_machine_responses.go | 19 +- .../delete_machine_snapshot_parameters.go | 59 +- .../delete_machine_snapshot_responses.go | 19 +- pkg/client/compute/get_machine_parameters.go | 88 +- pkg/client/compute/get_machine_responses.go | 22 +- .../get_machine_snapshot_parameters.go | 59 +- .../compute/get_machine_snapshot_responses.go | 22 +- .../get_machine_snapshots_parameters.go | 54 +- .../get_machine_snapshots_responses.go | 22 +- pkg/client/compute/get_machines_parameters.go | 192 +- pkg/client/compute/get_machines_responses.go | 19 +- .../compute/power_off_machine_parameters.go | 54 +- .../compute/power_off_machine_responses.go | 22 +- .../compute/power_on_machine_parameters.go | 54 +- .../compute/power_on_machine_responses.go | 22 +- .../compute/reboot_machine_parameters.go | 54 +- .../compute/reboot_machine_responses.go | 22 +- .../compute/reset_machine_parameters.go | 54 +- pkg/client/compute/reset_machine_responses.go | 22 +- .../compute/resize_machine_parameters.go | 94 +- .../compute/resize_machine_responses.go | 22 +- .../compute/restart_machine_parameters.go | 54 +- .../compute/restart_machine_responses.go | 22 +- .../revert_machine_snapshot_parameters.go | 60 +- .../revert_machine_snapshot_responses.go | 22 +- .../compute/shutdown_machine_parameters.go | 54 +- .../compute/shutdown_machine_responses.go | 22 +- .../compute/suspend_machine_parameters.go | 54 +- .../compute/suspend_machine_responses.go | 22 +- .../compute/update_machine_parameters.go | 60 +- .../compute/update_machine_responses.go | 22 +- .../compute_gateway/compute_gateway_client.go | 101 +- .../create_compute_gateway_parameters.go | 55 +- .../create_compute_gateway_responses.go | 22 +- .../delete_compute_gateway_parameters.go | 62 +- .../delete_compute_gateway_responses.go | 19 +- .../get_compute_gateway_parameters.go | 54 +- .../get_compute_gateway_responses.go | 22 +- .../get_compute_gateways_parameters.go | 49 +- .../get_compute_gateways_responses.go | 19 +- .../reconfigure_compute_gateway_parameters.go | 207 ++ .../reconfigure_compute_gateway_responses.go | 143 + pkg/client/compute_nat/compute_nat_client.go | 249 ++ .../create_compute_nat_parameters.go | 185 ++ .../create_compute_nat_responses.go | 143 + .../delete_compute_nat_parameters.go | 218 ++ .../delete_compute_nat_responses.go | 105 + .../compute_nat/get_compute_nat_parameters.go | 183 ++ .../compute_nat/get_compute_nat_responses.go | 143 + .../get_compute_nats_parameters.go | 161 ++ .../compute_nat/get_compute_nats_responses.go | 105 + .../compute_nat/reconfigure_nat_parameters.go | 207 ++ .../compute_nat/reconfigure_nat_responses.go | 143 + .../content_source/content_source_client.go | 59 +- ...te_content_source_using_post_parameters.go | 55 +- ...ate_content_source_using_post_responses.go | 9 +- ..._content_source_using_delete_parameters.go | 56 +- ...e_content_source_using_delete_responses.go | 3 +- ...get_content_source_using_get_parameters.go | 56 +- .../get_content_source_using_get_responses.go | 7 +- ...st_content_sources_using_get_parameters.go | 167 +- ...ist_content_sources_using_get_responses.go | 4 +- .../create_data_collector_parameters.go | 49 +- .../create_data_collector_responses.go | 22 +- .../data_collector/data_collector_client.go | 59 +- .../delete_data_collector_parameters.go | 54 +- .../delete_data_collector_responses.go | 21 +- .../get_data_collector_parameters.go | 54 +- .../get_data_collector_responses.go | 22 +- .../get_data_collectors_parameters.go | 57 +- .../get_data_collectors_responses.go | 19 +- .../create_deployment_parameters.go | 55 +- .../deployment/create_deployment_responses.go | 22 +- .../delete_deployment_parameters.go | 87 +- .../deployment/delete_deployment_responses.go | 19 +- pkg/client/deployment/deployment_client.go | 59 +- .../deployment/get_deployments_parameters.go | 186 +- .../deployment/get_deployments_responses.go | 19 +- .../get_single_deployment_parameters.go | 54 +- .../get_single_deployment_responses.go | 22 +- ...eployment_request_using_post_parameters.go | 62 +- ...deployment_request_using_post_responses.go | 10 +- .../deployment_actions_client.go | 101 +- ..._deployment_action_using_get_parameters.go | 61 +- ...t_deployment_action_using_get_responses.go | 9 +- ...deployment_actions_using_get_parameters.go | 56 +- ..._deployment_actions_using_get_responses.go | 9 +- ...et_resource_action_using_get_parameters.go | 68 +- ...get_resource_action_using_get_responses.go | 9 +- ...t_resource_actions_using_get_parameters.go | 63 +- ...et_resource_actions_using_get_responses.go | 9 +- ...nt_action_request_using_post_parameters.go | 62 +- ...ent_action_request_using_post_responses.go | 11 +- ...ce_action_request_using_post_parameters.go | 69 +- ...rce_action_request_using_post_responses.go | 11 +- .../deployment_requests_client.go | 59 +- ...eployment_requests_using_get_parameters.go | 119 +- ...deployment_requests_using_get_responses.go | 9 +- .../get_event_logs_using_get_parameters.go | 143 +- .../get_event_logs_using_get_responses.go | 9 +- ...get_request_events_using_get_parameters.go | 126 +- .../get_request_events_using_get_responses.go | 9 +- .../get_request_using_get_parameters.go | 71 +- .../get_request_using_get_responses.go | 9 +- ...ck_deployment_name_using_get_parameters.go | 54 +- ...eck_deployment_name_using_get_responses.go | 8 +- ...lete_deployment_using_delete_parameters.go | 56 +- ...elete_deployment_using_delete_responses.go | 11 +- ...delete_resource_using_delete_parameters.go | 63 +- .../delete_resource_using_delete_responses.go | 11 +- pkg/client/deployments/deployments_client.go | 171 +- ...t_deployment_by_id_using_get_parameters.go | 123 +- ...et_deployment_by_id_using_get_responses.go | 9 +- ...ense_history_by_id_using_get_parameters.go | 84 +- ...pense_history_by_id_using_get_responses.go | 9 +- ...yment_filter_by_id_using_get_parameters.go | 117 +- ...oyment_filter_by_id_using_get_responses.go | 6 +- ...deployment_filters_using_get_parameters.go | 181 +- ..._deployment_filters_using_get_responses.go | 6 +- ...ployment_resources_using_get_parameters.go | 146 +- ...eployment_resources_using_get_responses.go | 9 +- ...yments_for_project_using_get_parameters.go | 56 +- ...oyments_for_project_using_get_responses.go | 4 +- .../get_deployments_using_get_parameters.go | 529 +++- .../get_deployments_using_get_responses.go | 6 +- ...get_resource_by_id_using_get_parameters.go | 63 +- .../get_resource_by_id_using_get_responses.go | 9 +- ...patch_deployment_using_patch_parameters.go | 62 +- .../patch_deployment_using_patch_responses.go | 11 +- .../disk/attach_machine_disk_parameters.go | 60 +- .../disk/attach_machine_disk_responses.go | 25 +- .../disk/create_block_device_parameters.go | 55 +- .../disk/create_block_device_responses.go | 22 +- ...create_block_device_snapshot_parameters.go | 207 ++ .../create_block_device_snapshot_responses.go | 132 + ...te_first_class_disk_snapshot_parameters.go | 191 -- ...ate_first_class_disk_snapshot_responses.go | 123 - .../disk/delete_block_device_parameters.go | 70 +- .../disk/delete_block_device_responses.go | 21 +- ...delete_block_device_snapshot_parameters.go | 205 ++ .../delete_block_device_snapshot_responses.go | 132 + ...te_first_class_disk_snapshot_parameters.go | 188 -- ...ete_first_class_disk_snapshot_responses.go | 123 - .../disk/delete_machine_disk_parameters.go | 59 +- .../disk/delete_machine_disk_responses.go | 46 +- pkg/client/disk/disk_client.go | 260 +- .../disk/get_block_device_parameters.go | 54 +- pkg/client/disk/get_block_device_responses.go | 22 +- .../disk/get_block_devices_parameters.go | 192 +- .../disk/get_block_devices_responses.go | 19 +- .../disk/get_disk_snapshot_parameters.go | 59 +- .../disk/get_disk_snapshot_responses.go | 22 +- .../disk/get_disk_snapshots_parameters.go | 54 +- .../disk/get_disk_snapshots_responses.go | 22 +- .../disk/get_machine_disk_parameters.go | 59 +- pkg/client/disk/get_machine_disk_responses.go | 22 +- .../disk/get_machine_disks_parameters.go | 54 +- .../disk/get_machine_disks_responses.go | 22 +- pkg/client/disk/promote_disk_parameters.go | 54 +- pkg/client/disk/promote_disk_responses.go | 22 +- .../disk/resize_block_device_parameters.go | 62 +- .../disk/resize_block_device_responses.go | 21 +- .../disk/revert_disk_snapshot_parameters.go | 60 +- .../disk/revert_disk_snapshot_responses.go | 22 +- .../fabricaws_volume_types_client.go | 17 +- .../get_fabric_aws_volume_types_parameters.go | 57 +- .../get_fabric_aws_volume_types_responses.go | 19 +- .../fabric_azure_storage_account_client.go | 31 +- ...fabric_azure_storage_account_parameters.go | 88 +- ..._fabric_azure_storage_account_responses.go | 22 +- ...abric_azure_storage_accounts_parameters.go | 192 +- ...fabric_azure_storage_accounts_responses.go | 19 +- .../fabric_compute/fabric_compute_client.go | 45 +- .../get_fabric_compute_parameters.go | 54 +- .../get_fabric_compute_responses.go | 22 +- .../get_fabric_computes_parameters.go | 158 +- .../get_fabric_computes_responses.go | 19 +- .../update_fabric_compute_parameters.go | 60 +- .../update_fabric_compute_responses.go | 22 +- .../fabric_flavors/fabric_flavors_client.go | 17 +- .../get_fabric_flavors_parameters.go | 57 +- .../get_fabric_flavors_responses.go | 19 +- .../fabric_images/fabric_images_client.go | 31 +- .../get_fabric_image_parameters.go | 88 +- .../get_fabric_image_responses.go | 22 +- .../get_fabric_images_parameters.go | 192 +- .../get_fabric_images_responses.go | 19 +- .../fabric_network/fabric_network_client.go | 87 +- .../get_fabric_network_parameters.go | 88 +- .../get_fabric_network_responses.go | 22 +- .../get_fabric_networks_parameters.go | 192 +- .../get_fabric_networks_responses.go | 19 +- .../get_vsphere_fabric_network_parameters.go | 88 +- .../get_vsphere_fabric_network_responses.go | 22 +- .../get_vsphere_fabric_networks_parameters.go | 220 +- .../get_vsphere_fabric_networks_responses.go | 19 +- .../update_fabric_network_parameters.go | 60 +- .../update_fabric_network_responses.go | 22 +- ...updatevsphere_fabric_network_parameters.go | 60 +- .../updatevsphere_fabric_network_responses.go | 22 +- .../fabricvsphere_datastore_client.go | 31 +- ...get_fabric_vsphere_datastore_parameters.go | 88 +- .../get_fabric_vsphere_datastore_responses.go | 22 +- ...et_fabric_vsphere_datastores_parameters.go | 192 +- ...get_fabric_vsphere_datastores_responses.go | 19 +- .../fabricvsphere_storage_policies_client.go | 31 +- ...ric_vsphere_storage_policies_parameters.go | 192 +- ...bric_vsphere_storage_policies_responses.go | 19 +- ...abric_vsphere_storage_policy_parameters.go | 88 +- ...fabric_vsphere_storage_policy_responses.go | 22 +- .../create_flavor_profile_parameters.go | 55 +- .../create_flavor_profile_responses.go | 22 +- .../delete_flavor_profile_parameters.go | 54 +- .../delete_flavor_profile_responses.go | 21 +- .../flavor_profile/flavor_profile_client.go | 73 +- .../get_flavor_profile_parameters.go | 54 +- .../get_flavor_profile_responses.go | 22 +- .../get_flavor_profiles_parameters.go | 57 +- .../get_flavor_profiles_responses.go | 19 +- .../update_flavor_profile_parameters.go | 60 +- .../update_flavor_profile_responses.go | 22 +- pkg/client/flavors/flavors_client.go | 17 +- pkg/client/flavors/get_flavors_parameters.go | 49 +- pkg/client/flavors/get_flavors_responses.go | 19 +- pkg/client/icons/delete_parameters.go | 56 +- pkg/client/icons/delete_responses.go | 5 +- pkg/client/icons/download_parameters.go | 56 +- pkg/client/icons/download_responses.go | 10 +- pkg/client/icons/icons_client.go | 45 +- pkg/client/icons/upload_parameters.go | 55 +- pkg/client/icons/upload_responses.go | 8 +- .../create_image_profile_parameters.go | 55 +- .../create_image_profile_responses.go | 22 +- .../delete_image_profile_parameters.go | 54 +- .../delete_image_profile_responses.go | 21 +- .../get_image_profile_parameters.go | 54 +- .../get_image_profile_responses.go | 22 +- .../get_image_profiles_parameters.go | 57 +- .../get_image_profiles_responses.go | 19 +- .../image_profile/image_profile_client.go | 73 +- .../update_image_profile_parameters.go | 60 +- .../update_image_profile_responses.go | 22 +- pkg/client/images/get_images_parameters.go | 49 +- pkg/client/images/get_images_responses.go | 19 +- pkg/client/images/images_client.go | 17 +- .../create_load_balancer_parameters.go | 55 +- .../create_load_balancer_responses.go | 25 +- ...lete_load_balancer_operation_parameters.go | 62 +- ...elete_load_balancer_operation_responses.go | 19 +- .../delete_load_balancer_parameters.go | 62 +- .../delete_load_balancer_responses.go | 19 +- ...d_balancer_network_interface_parameters.go | 59 +- ...ad_balancer_network_interface_responses.go | 22 +- .../get_load_balancer_parameters.go | 54 +- .../get_load_balancer_responses.go | 22 +- .../get_load_balancers_parameters.go | 49 +- .../get_load_balancers_responses.go | 19 +- .../load_balancer/load_balancer_client.go | 101 +- .../scale_load_balancer_parameters.go | 60 +- .../scale_load_balancer_responses.go | 22 +- pkg/client/location/create_zone_parameters.go | 55 +- pkg/client/location/create_zone_responses.go | 22 +- pkg/client/location/delete_zone_parameters.go | 54 +- pkg/client/location/delete_zone_responses.go | 21 +- .../location/get_computes_parameters.go | 54 +- pkg/client/location/get_computes_responses.go | 22 +- pkg/client/location/get_region_parameters.go | 54 +- pkg/client/location/get_region_responses.go | 22 +- pkg/client/location/get_regions_parameters.go | 57 +- pkg/client/location/get_regions_responses.go | 19 +- pkg/client/location/get_zone_parameters.go | 54 +- pkg/client/location/get_zone_responses.go | 22 +- pkg/client/location/get_zones_parameters.go | 49 +- pkg/client/location/get_zones_responses.go | 19 +- pkg/client/location/location_client.go | 115 +- pkg/client/location/update_zone_parameters.go | 60 +- pkg/client/location/update_zone_responses.go | 22 +- pkg/client/login/login_client.go | 17 +- .../login/retrieve_auth_token_parameters.go | 55 +- .../login/retrieve_auth_token_responses.go | 22 +- .../filter_items_using_get_parameters.go | 69 +- .../filter_items_using_get_responses.go | 7 +- .../filters_using_get_parameters.go | 87 +- .../filters_using_get_responses.go | 7 +- .../marketplace/get_details_parameters.go | 61 +- .../marketplace/get_details_responses.go | 7 +- pkg/client/marketplace/get_link_parameters.go | 61 +- pkg/client/marketplace/get_link_responses.go | 7 +- .../marketplace/get_reviews_parameters.go | 61 +- .../marketplace/get_reviews_responses.go | 7 +- pkg/client/marketplace/marketplace_client.go | 87 +- pkg/client/marketplace/search_parameters.go | 64 +- pkg/client/marketplace/search_responses.go | 7 +- .../download_history_using_get_parameters.go | 108 +- .../download_history_using_get_responses.go | 4 +- .../download_request_using_post_parameters.go | 55 +- .../download_request_using_post_responses.go | 10 +- .../get_request_by_id_using_get_parameters.go | 56 +- .../get_request_by_id_using_get_responses.go | 7 +- .../marketplace_downloads_client.go | 45 +- .../network/create_network_parameters.go | 55 +- .../network/create_network_responses.go | 22 +- .../network/delete_network_parameters.go | 62 +- .../network/delete_network_responses.go | 19 +- ...et_machine_network_interface_parameters.go | 59 +- ...get_machine_network_interface_responses.go | 22 +- .../network/get_network_domain_parameters.go | 54 +- .../network/get_network_domain_responses.go | 22 +- .../network/get_network_domains_parameters.go | 57 +- .../network/get_network_domains_responses.go | 19 +- pkg/client/network/get_network_parameters.go | 54 +- pkg/client/network/get_network_responses.go | 22 +- pkg/client/network/get_networks_parameters.go | 49 +- pkg/client/network/get_networks_responses.go | 19 +- pkg/client/network/network_client.go | 101 +- ...te_internal_network_ip_range_parameters.go | 55 +- ...ate_internal_network_ip_range_responses.go | 67 +- ...te_internal_network_ip_range_parameters.go | 54 +- ...ete_internal_network_ip_range_responses.go | 21 +- .../get_external_ip_block_parameters.go | 54 +- .../get_external_ip_block_responses.go | 22 +- .../get_external_ip_blocks_parameters.go | 49 +- .../get_external_ip_blocks_responses.go | 19 +- ...et_external_network_ip_range_parameters.go | 54 +- ...get_external_network_ip_range_responses.go | 22 +- ...t_external_network_ip_ranges_parameters.go | 49 +- ...et_external_network_ip_ranges_responses.go | 19 +- ...et_internal_network_ip_range_parameters.go | 54 +- ...get_internal_network_ip_range_responses.go | 22 +- ...t_internal_network_ip_ranges_parameters.go | 49 +- ...et_internal_network_ip_ranges_responses.go | 22 +- .../network_ip_range_client.go | 156 +- ...te_external_network_ip_range_parameters.go | 60 +- ...ate_external_network_ip_range_responses.go | 25 +- ...te_internal_network_ip_range_parameters.go | 60 +- ...ate_internal_network_ip_range_responses.go | 22 +- .../create_network_profile_parameters.go | 55 +- .../create_network_profile_responses.go | 22 +- .../delete_network_profile_parameters.go | 54 +- .../delete_network_profile_responses.go | 21 +- .../get_network_profile_parameters.go | 54 +- .../get_network_profile_responses.go | 22 +- .../get_network_profiles_parameters.go | 57 +- .../get_network_profiles_responses.go | 19 +- .../network_profile/network_profile_client.go | 73 +- .../update_network_profile_parameters.go | 60 +- .../update_network_profile_responses.go | 22 +- .../create_policy_using_post1_parameters.go | 63 +- .../create_policy_using_post1_responses.go | 4 +- .../delete_policy_using_delete1_parameters.go | 56 +- .../delete_policy_using_delete1_responses.go | 3 +- .../get_policies_using_get1_parameters.go | 128 +- .../get_policies_using_get1_responses.go | 4 +- .../get_policy_using_get1_parameters.go | 64 +- .../get_policy_using_get1_responses.go | 4 +- pkg/client/policies/policies_client.go | 59 +- ...get_decision_by_id_using_get_parameters.go | 56 +- .../get_decision_by_id_using_get_responses.go | 4 +- .../get_decisions_using_get_parameters.go | 138 +- .../get_decisions_using_get_responses.go | 4 +- .../policy_decisions_client.go | 31 +- ..._policy_type_by_id_using_get_parameters.go | 54 +- ...t_policy_type_by_id_using_get_responses.go | 4 +- .../get_types_using_get1_parameters.go | 112 +- .../get_types_using_get1_responses.go | 4 +- .../policy_types/policy_types_client.go | 31 +- ...ignment_strategy_using_patch_parameters.go | 55 +- ...signment_strategy_using_patch_responses.go | 6 +- ...signment_strategy_using_post_parameters.go | 55 +- ...ssignment_strategy_using_post_responses.go | 11 +- ...policy_assignment_using_post_parameters.go | 55 +- ..._policy_assignment_using_post_responses.go | 11 +- ...licy_assignment_using_delete_parameters.go | 56 +- ...olicy_assignment_using_delete_responses.go | 8 +- ...policy_assignments_using_get_parameters.go | 139 +- ..._policy_assignments_using_get_responses.go | 6 +- ...ssignment_strategy_using_get_parameters.go | 49 +- ...assignment_strategy_using_get_responses.go | 9 +- ..._policy_assignment_using_get_parameters.go | 56 +- ...g_policy_assignment_using_get_responses.go | 9 +- ...olicy_assignment_using_patch_parameters.go | 62 +- ...policy_assignment_using_patch_responses.go | 6 +- .../pricing_card_assignments_client.go | 115 +- .../create_policy_using_post_parameters.go | 55 +- .../create_policy_using_post_responses.go | 9 +- .../delete_policy_using_delete_parameters.go | 56 +- .../delete_policy_using_delete_responses.go | 10 +- .../get_policies_using_get_parameters.go | 128 +- .../get_policies_using_get_responses.go | 6 +- .../get_policy_using_get_parameters.go | 56 +- .../get_policy_using_get_responses.go | 9 +- .../pricing_cards/pricing_cards_client.go | 73 +- .../update_policy_using_put_parameters.go | 62 +- .../update_policy_using_put_responses.go | 9 +- .../project/create_project_parameters.go | 55 +- .../project/create_project_responses.go | 22 +- .../project/delete_project_parameters.go | 54 +- .../project/delete_project_responses.go | 36 +- pkg/client/project/get_project_parameters.go | 54 +- ...et_project_resource_metadata_parameters.go | 54 +- ...get_project_resource_metadata_responses.go | 22 +- pkg/client/project/get_project_responses.go | 22 +- pkg/client/project/get_projects_parameters.go | 147 +- pkg/client/project/get_projects_responses.go | 19 +- pkg/client/project/project_client.go | 101 +- .../project/update_project_parameters.go | 60 +- ...te_project_resource_metadata_parameters.go | 60 +- ...ate_project_resource_metadata_responses.go | 22 +- .../project/update_project_responses.go | 22 +- .../request/delete_request_parameters.go | 54 +- .../request/delete_request_responses.go | 21 +- .../request/get_request_tracker_parameters.go | 54 +- .../request/get_request_tracker_responses.go | 22 +- .../get_request_trackers_parameters.go | 49 +- .../request/get_request_trackers_responses.go | 19 +- pkg/client/request/request_client.go | 45 +- ...source_type_using_get_mixin1_parameters.go | 54 +- ...esource_type_using_get_mixin1_responses.go | 9 +- .../get_resource_type_using_get_parameters.go | 54 +- .../get_resource_type_using_get_responses.go | 11 +- ...ource_types_using_get_mixin1_parameters.go | 198 +- ...source_types_using_get_mixin1_responses.go | 6 +- ...ist_resource_types_using_get_parameters.go | 161 +- ...list_resource_types_using_get_responses.go | 11 +- .../resource_types/resource_types_client.go | 59 +- .../change_security_groups_parameters.go | 60 +- .../change_security_groups_responses.go | 25 +- ...ate_on_demand_security_group_parameters.go | 55 +- ...eate_on_demand_security_group_responses.go | 22 +- .../delete_security_group_parameters.go | 62 +- .../delete_security_group_responses.go | 21 +- .../get_security_group_parameters.go | 54 +- .../get_security_group_responses.go | 22 +- .../get_security_groups_parameters.go | 57 +- .../get_security_groups_responses.go | 19 +- .../reconfigure_security_group_parameters.go | 207 ++ .../reconfigure_security_group_responses.go | 143 + .../security_group/security_group_client.go | 129 +- .../update_security_group_parameters.go | 60 +- .../update_security_group_responses.go | 22 +- .../get_sync_request_using_get_parameters.go | 56 +- .../get_sync_request_using_get_responses.go | 7 +- ...schedule_sync_all_using_post_parameters.go | 55 +- .../schedule_sync_all_using_post_responses.go | 4 +- .../schedule_sync_using_post_parameters.go | 55 +- .../schedule_sync_using_post_responses.go | 7 +- .../source_control_sync_client.go | 59 +- .../sync_history_using_get_parameters.go | 162 +- .../sync_history_using_get_responses.go | 4 +- .../create_aws_storage_profile_parameters.go | 55 +- .../create_aws_storage_profile_responses.go | 22 +- ...create_azure_storage_profile_parameters.go | 55 +- .../create_azure_storage_profile_responses.go | 22 +- .../create_storage_profile_parameters.go | 55 +- .../create_storage_profile_responses.go | 22 +- ...eate_vsphere_storage_profile_parameters.go | 55 +- ...reate_vsphere_storage_profile_responses.go | 22 +- .../delete_aws_storage_profile_parameters.go | 54 +- .../delete_aws_storage_profile_responses.go | 21 +- ...delete_azure_storage_profile_parameters.go | 54 +- .../delete_azure_storage_profile_responses.go | 21 +- .../delete_storage_profile_parameters.go | 54 +- .../delete_storage_profile_responses.go | 21 +- ...lete_vsphere_storage_profile_parameters.go | 54 +- ...elete_vsphere_storage_profile_responses.go | 21 +- .../get_aws_storage_profile_parameters.go | 54 +- .../get_aws_storage_profile_responses.go | 22 +- .../get_aws_storage_profiles_parameters.go | 57 +- .../get_aws_storage_profiles_responses.go | 19 +- .../get_azure_storage_profile_parameters.go | 54 +- .../get_azure_storage_profile_responses.go | 22 +- .../get_azure_storage_profiles_parameters.go | 57 +- .../get_azure_storage_profiles_responses.go | 19 +- .../get_storage_profile_parameters.go | 54 +- .../get_storage_profile_responses.go | 22 +- .../get_storage_profiles_parameters.go | 57 +- .../get_storage_profiles_responses.go | 19 +- .../get_vsphere_storage_profile_parameters.go | 54 +- .../get_vsphere_storage_profile_responses.go | 22 +- ...get_vsphere_storage_profiles_parameters.go | 57 +- .../get_vsphere_storage_profiles_responses.go | 19 +- .../replace_storage_profile_parameters.go | 60 +- .../replace_storage_profile_responses.go | 22 +- .../storage_profile/storage_profile_client.go | 283 +- .../update_aws_storage_profile_parameters.go | 60 +- .../update_aws_storage_profile_responses.go | 22 +- ...update_azure_storage_profile_parameters.go | 60 +- .../update_azure_storage_profile_responses.go | 22 +- ...date_vsphere_storage_profile_parameters.go | 60 +- ...pdate_vsphere_storage_profile_responses.go | 22 +- pkg/client/tags/get_tags_parameters.go | 47 +- pkg/client/tags/get_tags_responses.go | 19 +- pkg/client/tags/tags_client.go | 17 +- ...rvice_credentials_using_post_parameters.go | 57 +- ...ervice_credentials_using_post_responses.go | 11 +- ...service_account_using_delete_parameters.go | 51 +- ..._service_account_using_delete_responses.go | 3 +- ...vice_credential_using_delete_parameters.go | 56 +- ...rvice_credential_using_delete_responses.go | 3 +- ...enumerate_domains_using_post_parameters.go | 47 +- .../enumerate_domains_using_post_responses.go | 11 +- .../vcf/get_domain_using_get_parameters.go | 51 +- .../vcf/get_domain_using_get_responses.go | 11 +- .../vcf/get_domains_using_get_parameters.go | 46 +- .../vcf/get_domains_using_get_responses.go | 11 +- ..._service_account_using_patch_parameters.go | 57 +- ...h_service_account_using_patch_responses.go | 4 +- pkg/client/vcf/vcf_client.go | 101 +- pkg/client/vra_client.go | 7 +- pkg/models/admin_catalog_item_patch.go | 8 +- pkg/models/api_description.go | 31 +- pkg/models/auth_response.go | 8 + pkg/models/aws_storage_profile.go | 77 +- pkg/models/azure_storage_profile.go | 81 +- pkg/models/block_device.go | 83 +- pkg/models/block_device_result.go | 67 +- pkg/models/block_device_specification.go | 68 +- pkg/models/blueprint.go | 277 +- pkg/models/blueprint_about.go | 52 +- pkg/models/blueprint_content_source.go | 31 +- pkg/models/blueprint_content_source_config.go | 7 + pkg/models/blueprint_execution.go | 65 +- pkg/models/blueprint_plan.go | 39 +- pkg/models/blueprint_plan_resource.go | 77 +- pkg/models/blueprint_plan_task.go | 77 +- pkg/models/blueprint_request.go | 225 +- pkg/models/blueprint_resources_plan.go | 39 +- pkg/models/blueprint_task_execution.go | 90 +- pkg/models/blueprint_validation_message.go | 73 +- pkg/models/blueprint_validation_request.go | 8 +- pkg/models/blueprint_validation_response.go | 52 +- pkg/models/blueprint_version.go | 235 +- pkg/models/blueprint_version_request.go | 7 + pkg/models/catalog_item.go | 57 +- pkg/models/catalog_item_request.go | 8 +- pkg/models/catalog_item_request_response.go | 7 + ...og_item_resource_upfront_price_response.go | 129 +- pkg/models/catalog_item_type.go | 9 +- .../catalog_item_upfront_price_response.go | 152 +- pkg/models/catalog_item_version.go | 8 +- pkg/models/catalog_source.go | 16 +- .../change_security_group_specification.go | 69 +- pkg/models/cloud_account.go | 78 +- pkg/models/cloud_account_aws.go | 73 +- pkg/models/cloud_account_aws_result.go | 67 +- pkg/models/cloud_account_aws_specification.go | 39 +- pkg/models/cloud_account_azure.go | 75 +- pkg/models/cloud_account_azure_result.go | 67 +- .../cloud_account_azure_specification.go | 41 +- pkg/models/cloud_account_gcp.go | 75 +- pkg/models/cloud_account_gcp_result.go | 67 +- pkg/models/cloud_account_gcp_specification.go | 41 +- pkg/models/cloud_account_nsx_t.go | 79 +- pkg/models/cloud_account_nsx_t_result.go | 67 +- .../cloud_account_nsx_t_specification.go | 49 +- pkg/models/cloud_account_nsx_v.go | 74 +- pkg/models/cloud_account_nsx_v_result.go | 67 +- .../cloud_account_nsx_v_specification.go | 44 +- pkg/models/cloud_account_regions.go | 8 + pkg/models/cloud_account_result.go | 67 +- pkg/models/cloud_account_specification.go | 47 +- pkg/models/cloud_account_vcf.go | 79 +- pkg/models/cloud_account_vcf_result.go | 67 +- pkg/models/cloud_account_vcf_specification.go | 49 +- pkg/models/cloud_account_vmc.go | 73 +- pkg/models/cloud_account_vmc_result.go | 67 +- pkg/models/cloud_account_vmc_specification.go | 45 +- pkg/models/cloud_account_vsphere.go | 75 +- pkg/models/cloud_account_vsphere_result.go | 67 +- .../cloud_account_vsphere_specification.go | 46 +- pkg/models/commit_details.go | 8 +- pkg/models/compute_gateway.go | 100 +- pkg/models/compute_gateway_result.go | 67 +- pkg/models/compute_gateway_specification.go | 37 +- pkg/models/compute_nat.go | 358 +++ pkg/models/compute_nat_result.go | 154 ++ pkg/models/compute_nat_specification.go | 174 ++ pkg/models/constraint.go | 8 + pkg/models/content_about.go | 52 +- pkg/models/content_definition.go | 8 +- pkg/models/content_source.go | 96 +- pkg/models/content_sources.go | 76 +- pkg/models/criteria.go | 7 + pkg/models/csp_login_specification.go | 8 + pkg/models/custom_properties.go | 7 + pkg/models/data_collector.go | 12 + pkg/models/data_collector_registration.go | 9 + pkg/models/data_collector_result.go | 67 +- pkg/models/data_element.go | 7 + pkg/models/deployment.go | 134 +- pkg/models/deployment_expense_history.go | 65 +- pkg/models/deployment_filter.go | 54 +- pkg/models/deployment_filter_schema.go | 34 +- pkg/models/deployment_resource_type.go | 33 +- pkg/models/deployment_specification.go | 8 + pkg/models/deployment_update.go | 7 + pkg/models/deprecation_policy.go | 7 + pkg/models/disk_attachment_specification.go | 16 + pkg/models/disk_snapshot.go | 54 +- pkg/models/disk_snapshot_specification.go | 14 + pkg/models/document.go | 7 + pkg/models/endpoint_properties.go | 7 + pkg/models/entitlement.go | 30 + pkg/models/error.go | 8 + pkg/models/event.go | 8 +- pkg/models/event_log.go | 8 +- pkg/models/execution_message.go | 27 + pkg/models/expense.go | 130 +- pkg/models/external_network_ip_range.go | 72 +- .../external_network_ip_range_result.go | 67 +- pkg/models/fabric_azure_storage_account.go | 52 +- .../fabric_azure_storage_account_result.go | 67 +- pkg/models/fabric_compute.go | 81 +- pkg/models/fabric_compute_result.go | 67 +- pkg/models/fabric_compute_specification.go | 35 +- pkg/models/fabric_flavor.go | 16 + pkg/models/fabric_flavor_description.go | 10 + pkg/models/fabric_flavor_result.go | 67 +- pkg/models/fabric_image.go | 54 +- pkg/models/fabric_image_description.go | 38 +- pkg/models/fabric_image_result.go | 67 +- pkg/models/fabric_network.go | 76 +- pkg/models/fabric_network_result.go | 67 +- pkg/models/fabric_network_specification.go | 35 +- pkg/models/fabric_network_vsphere.go | 81 +- pkg/models/fabric_network_vsphere_result.go | 67 +- .../fabric_network_vsphere_specification.go | 42 +- pkg/models/fabric_vsphere_datastore.go | 76 +- pkg/models/fabric_vsphere_datastore_result.go | 67 +- pkg/models/fabric_vsphere_storage_policy.go | 74 +- .../fabric_vsphere_storage_policy_result.go | 67 +- pkg/models/file_tree.go | 35 +- pkg/models/file_tree_directory.go | 7 + pkg/models/filter_entry.go | 7 + pkg/models/fixed_price.go | 7 +- pkg/models/flavor_mapping.go | 68 + pkg/models/flavor_profile.go | 67 + pkg/models/flavor_profile_result.go | 67 +- pkg/models/flavor_profile_specification.go | 41 + pkg/models/flavor_result.go | 67 +- pkg/models/form_definition.go | 7 + pkg/models/health_check_configuration.go | 51 +- pkg/models/href.go | 7 + pkg/models/iaa_s_about.go | 33 + pkg/models/iaa_s_deployment.go | 47 + pkg/models/image_mapping.go | 68 + pkg/models/image_mapping_description.go | 78 +- pkg/models/image_profile.go | 67 + pkg/models/image_profile_result.go | 67 +- pkg/models/image_profile_specification.go | 41 + pkg/models/image_result.go | 67 +- pkg/models/link.go | 7 + pkg/models/load_balancer.go | 103 +- pkg/models/load_balancer_result.go | 67 +- pkg/models/load_balancer_specification.go | 86 +- pkg/models/machine.go | 125 +- pkg/models/machine_boot_config.go | 8 + pkg/models/machine_boot_config_settings.go | 10 + pkg/models/machine_result.go | 67 +- pkg/models/machine_specification.go | 194 +- pkg/models/marketplace_content.go | 54 +- .../marketplace_content_download_request.go | 106 +- pkg/models/marketplace_content_link.go | 7 + pkg/models/marketplace_content_review.go | 7 + pkg/models/marketplace_content_reviews.go | 76 +- pkg/models/marketplace_contents.go | 76 +- pkg/models/marketplace_download_history.go | 76 +- .../marketplace_download_history_item.go | 11 +- pkg/models/marketplace_filter.go | 32 +- pkg/models/marketplace_filter_entries.go | 76 +- pkg/models/marketplace_filter_entry.go | 8 + pkg/models/marketplace_filter_schema.go | 34 +- pkg/models/metering.go | 9 +- pkg/models/metering_assignment_strategy.go | 7 +- pkg/models/metering_item.go | 31 +- pkg/models/metering_policy.go | 191 +- pkg/models/metering_policy_assignment.go | 11 +- pkg/models/metering_policy_assignment_info.go | 7 +- pkg/models/named_metering.go | 31 +- pkg/models/named_metering_item.go | 34 +- pkg/models/nat_rule.go | 73 +- pkg/models/network.go | 79 +- pkg/models/network_domain.go | 76 +- pkg/models/network_domain_result.go | 67 +- pkg/models/network_interface.go | 77 +- pkg/models/network_interface_specification.go | 11 + pkg/models/network_ip_range.go | 72 +- pkg/models/network_ip_range_result.go | 67 +- pkg/models/network_ip_range_specification.go | 36 +- pkg/models/network_profile.go | 74 +- pkg/models/network_profile_result.go | 67 +- pkg/models/network_profile_specification.go | 47 +- pkg/models/network_result.go | 67 +- pkg/models/network_specification.go | 68 +- pkg/models/nsx_account.go | 7 + pkg/models/one_time_metering.go | 7 + pkg/models/one_time_metering_item.go | 31 +- pkg/models/output_value.go | 7 + pkg/models/page.go | 7 + pkg/models/page_metadata.go | 7 + pkg/models/page_of_blueprint.go | 53 +- .../page_of_blueprint_content_source.go | 53 +- pkg/models/page_of_blueprint_request.go | 53 +- pkg/models/page_of_blueprint_version.go | 53 +- pkg/models/page_of_catalog_item.go | 53 +- pkg/models/page_of_catalog_item_type.go | 53 +- pkg/models/page_of_catalog_item_version.go | 53 +- pkg/models/page_of_catalog_source.go | 53 +- pkg/models/page_of_commit_details.go | 53 +- pkg/models/page_of_deployment.go | 53 +- .../page_of_deployment_resource_type.go | 53 +- pkg/models/page_of_event.go | 53 +- pkg/models/page_of_filter_entry.go | 53 +- pkg/models/page_of_metering_policy.go | 53 +- .../page_of_metering_policy_assignment.go | 53 +- pkg/models/page_of_policy.go | 53 +- .../page_of_policy_decision_of_object_node.go | 53 +- pkg/models/page_of_policy_type.go | 53 +- pkg/models/page_of_request.go | 53 +- pkg/models/page_of_resource.go | 53 +- pkg/models/page_of_resource_type.go | 53 +- pkg/models/page_of_terraform_version.go | 53 +- .../photon_model_endpoint_config_request.go | 88 +- pkg/models/policy.go | 73 +- pkg/models/policy_decision_of_object_node.go | 38 +- pkg/models/policy_decision_policy.go | 9 +- pkg/models/policy_feature_config.go | 7 + pkg/models/policy_stats.go | 7 + pkg/models/policy_type.go | 39 +- pkg/models/project.go | 176 +- pkg/models/project_resource_metadata.go | 35 +- ...project_resource_metadata_specification.go | 35 +- pkg/models/project_result.go | 67 +- pkg/models/project_specification.go | 143 +- pkg/models/property_definition.go | 115 +- pkg/models/provider.go | 7 + pkg/models/rate_factor.go | 7 + pkg/models/rate_factor_item.go | 31 +- ...configure_compute_gateway_specification.go | 115 + .../reconfigure_compute_nat_specification.go | 115 + pkg/models/region.go | 48 + pkg/models/region_result.go | 67 +- pkg/models/remote_access_specification.go | 9 + pkg/models/request.go | 12 +- pkg/models/request_tracker.go | 14 + pkg/models/request_tracker_result.go | 67 +- pkg/models/resource.go | 34 +- pkg/models/resource_action.go | 31 +- pkg/models/resource_action_request.go | 7 + pkg/models/resource_reference.go | 7 + pkg/models/resource_type.go | 211 +- pkg/models/route_configuration.go | 37 +- pkg/models/rule.go | 13 + pkg/models/security_group.go | 100 +- pkg/models/security_group_result.go | 67 +- pkg/models/security_group_specification.go | 62 +- pkg/models/service_account_request.go | 7 + pkg/models/service_error_response.go | 120 + pkg/models/slice_of_event_log.go | 53 +- pkg/models/snapshot.go | 51 + pkg/models/snapshot_specification.go | 47 + pkg/models/sort.go | 7 + pkg/models/source_control_sync_all_request.go | 7 + pkg/models/source_control_sync_history.go | 76 +- .../source_control_sync_history_item.go | 146 +- pkg/models/source_control_sync_request.go | 94 +- pkg/models/source_control_sync_requests.go | 76 +- pkg/models/storage_profile.go | 73 +- pkg/models/storage_profile_aws_result.go | 67 +- .../storage_profile_aws_specification.go | 41 +- pkg/models/storage_profile_azure_result.go | 67 +- .../storage_profile_azure_specification.go | 46 +- pkg/models/storage_profile_result.go | 67 +- pkg/models/storage_profile_specification.go | 38 +- pkg/models/storage_profile_vsphere_result.go | 67 +- .../storage_profile_vsphere_specification.go | 46 +- pkg/models/support.go | 7 + pkg/models/supported_api.go | 7 + pkg/models/tag.go | 7 + pkg/models/tag_based_metering.go | 31 +- pkg/models/tag_based_metering_item.go | 34 +- pkg/models/tag_based_one_time_metering.go | 31 +- .../tag_based_one_time_metering_item.go | 34 +- pkg/models/tag_based_rate_factor_item.go | 34 +- pkg/models/tag_result.go | 67 +- pkg/models/terraform_blueprint_config.go | 124 +- ...erraform_configuration_source_reference.go | 8 +- pkg/models/terraform_to_blueprint_mapping.go | 99 +- pkg/models/terraform_version.go | 93 +- pkg/models/time_series_value.go | 39 +- .../update_cloud_account_aws_specification.go | 43 +- ...pdate_cloud_account_azure_specification.go | 43 +- .../update_cloud_account_gcp_specification.go | 37 +- ...pdate_cloud_account_nsx_t_specification.go | 38 +- ...pdate_cloud_account_nsx_v_specification.go | 36 +- .../update_cloud_account_specification.go | 41 +- .../update_cloud_account_vcf_specification.go | 37 +- .../update_cloud_account_vmc_specification.go | 37 +- ...ate_cloud_account_vsphere_specification.go | 40 +- ...external_network_ip_range_specification.go | 7 + .../update_flavor_profile_specification.go | 40 + .../update_image_profile_specification.go | 40 + pkg/models/update_machine_specification.go | 37 +- .../update_security_group_specification.go | 35 +- pkg/models/uri.go | 7 + pkg/models/user.go | 9 + pkg/models/variable.go | 7 +- pkg/models/vcf_credential_requests.go | 34 +- pkg/models/vcf_domain.go | 50 +- pkg/models/vcf_domains.go | 34 +- pkg/models/vcf_service_account.go | 7 + pkg/models/vcf_service_credential.go | 7 + ...cf_service_credential_creation_response.go | 35 +- pkg/models/volume_type_list.go | 7 + pkg/models/vsphere_account.go | 7 + pkg/models/vsphere_storage_profile.go | 80 +- pkg/models/zone.go | 99 +- pkg/models/zone_assignment_config.go | 13 + pkg/models/zone_result.go | 67 +- pkg/models/zone_specification.go | 67 +- swagger/vra-iaas.json | 2394 ++++++++++++++++- 1064 files changed, 44522 insertions(+), 12474 deletions(-) create mode 100644 pkg/client/compute_gateway/reconfigure_compute_gateway_parameters.go create mode 100644 pkg/client/compute_gateway/reconfigure_compute_gateway_responses.go create mode 100644 pkg/client/compute_nat/compute_nat_client.go create mode 100644 pkg/client/compute_nat/create_compute_nat_parameters.go create mode 100644 pkg/client/compute_nat/create_compute_nat_responses.go create mode 100644 pkg/client/compute_nat/delete_compute_nat_parameters.go create mode 100644 pkg/client/compute_nat/delete_compute_nat_responses.go create mode 100644 pkg/client/compute_nat/get_compute_nat_parameters.go create mode 100644 pkg/client/compute_nat/get_compute_nat_responses.go create mode 100644 pkg/client/compute_nat/get_compute_nats_parameters.go create mode 100644 pkg/client/compute_nat/get_compute_nats_responses.go create mode 100644 pkg/client/compute_nat/reconfigure_nat_parameters.go create mode 100644 pkg/client/compute_nat/reconfigure_nat_responses.go create mode 100644 pkg/client/disk/create_block_device_snapshot_parameters.go create mode 100644 pkg/client/disk/create_block_device_snapshot_responses.go delete mode 100644 pkg/client/disk/create_first_class_disk_snapshot_parameters.go delete mode 100644 pkg/client/disk/create_first_class_disk_snapshot_responses.go create mode 100644 pkg/client/disk/delete_block_device_snapshot_parameters.go create mode 100644 pkg/client/disk/delete_block_device_snapshot_responses.go delete mode 100644 pkg/client/disk/delete_first_class_disk_snapshot_parameters.go delete mode 100644 pkg/client/disk/delete_first_class_disk_snapshot_responses.go create mode 100644 pkg/client/security_group/reconfigure_security_group_parameters.go create mode 100644 pkg/client/security_group/reconfigure_security_group_responses.go create mode 100644 pkg/models/compute_nat.go create mode 100644 pkg/models/compute_nat_result.go create mode 100644 pkg/models/compute_nat_specification.go create mode 100644 pkg/models/reconfigure_compute_gateway_specification.go create mode 100644 pkg/models/reconfigure_compute_nat_specification.go create mode 100644 pkg/models/service_error_response.go diff --git a/Makefile b/Makefile index 5a84bdc3..fea12396 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ .PHONY: all swagger modified update update-blueprint update-catalog-deployment update-iaas update-content clean -SWAGGER_VERSION=0.25.0 +SWAGGER_VERSION=0.27.0 +SWAGGER_ENDPOINT ?= api.mgmt.cloud.vmware.com all: go build -o sdk-test @@ -23,16 +24,16 @@ modified: update: update-blueprint update-catalog-deployment update-iaas update-content update-blueprint: - curl 'https://api.mgmt.cloud.vmware.com/blueprint/api/swagger/swagger-api-docs?group=2019-09-12' | python3 -mjson.tool > swagger/vra-blueprint.json + curl --insecure 'https://${SWAGGER_ENDPOINT}/blueprint/api/swagger/swagger-api-docs?group=2019-09-12' | python3 -mjson.tool > swagger/vra-blueprint.json update-catalog-deployment: - curl 'https://api.mgmt.cloud.vmware.com/deployment/api/swagger/swagger/v2/api-docs?group=2019-01-15' | python3 -mjson.tool > swagger/vra-catalog-deployment.json + curl --insecure 'https://${SWAGGER_ENDPOINT}/deployment/api/swagger/swagger/v2/api-docs?group=2019-01-15' | python3 -mjson.tool > swagger/vra-catalog-deployment.json update-iaas: - curl 'https://api.mgmt.cloud.vmware.com/iaas/api/swagger/swagger/v2/api-docs?group=iaas' | python3 -mjson.tool > swagger/vra-iaas.json + curl --insecure 'https://${SWAGGER_ENDPOINT}/iaas/api/swagger/swagger/v2/api-docs?group=iaas' | python3 -mjson.tool > swagger/vra-iaas.json update-content: - curl 'https://api.mgmt.cloud.vmware.com/content/api/swagger/v2/api-docs?group=2019-01-15' | python3 -mjson.tool > swagger/vra-content.json + curl --insecure 'https://${SWAGGER_ENDPOINT}/content/api/swagger/v2/api-docs?group=2019-01-15' | python3 -mjson.tool > swagger/vra-content.json clean: rm swagger/vra-combined.json diff --git a/hack/fix_vra_swagger b/hack/fix_vra_swagger index b48a85d0..c61a48f8 100755 --- a/hack/fix_vra_swagger +++ b/hack/fix_vra_swagger @@ -51,9 +51,9 @@ def add_filter_params(swagger): param_list.insert(0, filter_spec) +# To add a response code in the swagger, enable this method and add the apis def add_204(swagger): paths = [ - ('/iaas/api/block-devices/{id}', 'delete'), ('/iaas/api/machines/{id}/disks/{id1}', 'delete'), ] @@ -64,12 +64,12 @@ def add_204(swagger): responses['204'] = {"description": "No Content"} +# Enable this to list of paths, operations, and status code to update the response model +# add the apis that needs to be updated def change_response_model(swagger): # List of paths, operations, and status code to update the response model paths = [ ('/iaas/api/machines/{id}/disks', 'post', '200', '#/definitions/RequestTracker'), - ('/iaas/api/machines/{id}/disks/{id1}', 'delete', '202', '#/definitions/RequestTracker'), - ('/iaas/api/block-devices/{id}/snapshots/{id1}', 'get', '200', '#/definitions/DiskSnapshot'), ] # Update the needed paths @@ -142,12 +142,6 @@ def add_security(swagger): for method in param_list: if 'security' not in swagger['paths'][p][method]: swagger['paths'][p][method]['security'] = bearer_security - - -def add_network_ip_range_return_code(swagger): - path = '/iaas/api/network-ip-ranges' - responses = swagger['paths'][path]['post']['responses'] - responses['201'] = responses['202'] def add_blockdevice_persistent(swagger): @@ -179,52 +173,71 @@ def add_blockdevice_delete_purge(swagger): }) -def add_blockdevice_resize(swagger): - bd = swagger['paths']['/iaas/api/block-devices/{id}'] - if 'post' in bd: - return - bd['post'] = { - "summary": "Resize BlockDevice", +# This needs to be removed after the bug https://jira.eng.vmware.com/browse/VCOM-25699 is fixed +def get_blockdevices_add_dollar_filter(swagger): + bd = swagger['paths']['/iaas/api/block-devices'] + bd['get'] = { + "summary": "Get BlockDevices", "produces": [ "application/json", "app/json" ], - "description": "Resize operation on block device.", - "operationId": "resizeBlockDevice", + "description": "Get all BlockDevices", + "operationId": "getBlockDevices", "responses": { - "202": { + "200": { "schema": { - "$ref": "#/definitions/RequestTracker" + "$ref": "#/definitions/BlockDeviceResult" }, "description": "successful operation" }, - "204": { - "description": "No Content" - }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, "parameters": [ { - "in": "path", - "name": "id", - "description": "The ID of the block device.", + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", - "required": True + "required": False }, { "in": "query", - "name": "capacityInGB", - "format": "int32", - "description": "Resize Capacity in GB", + "name": "$top", + "description": "Number of records you want to get.", "type": "integer", - "required": True + "required": False }, { "in": "query", - "name": "apiVersion", - "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /iaas/api/about", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": False + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": False + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": False + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", "type": "string", "required": False } @@ -265,15 +278,6 @@ def add_400_bad_request(swagger): } -def change_operationId_for_get_fabric_compute(swagger): - # Remove when VCOM-16823 is fixed. - path = '/iaas/api/fabric-computes/{id}' - fc = swagger['paths'][path]['get'] - if fc['operationId'] == 'getFabricCompute': - return - fc['operationId'] = 'getFabricCompute' - - def add_default_value_to_boolean_properties(swagger): # Update following definition properties of type boolean with specified default value. paths = [ @@ -293,7 +297,6 @@ def change_response_code(swagger): # List of paths, operations, current status code, and new status code to update the response model paths = [ ('/iaas/api/block-devices/{id}/operations/snapshots', 'post', '200', '202'), - ('/iaas/api/block-devices/{id}/snapshots/{id1}', 'delete', '200', '202'), ] # Update the needed paths @@ -327,20 +330,18 @@ if __name__ == "__main__": swagger = json.loads(open(filename).read()) add_filter_params(swagger) - add_204(swagger) - change_response_model(swagger) - - add_network_ip_range_return_code(swagger) - change_operationId_for_get_fabric_compute(swagger) + # add_204(swagger) + # change_response_model(swagger) add_blockdevice_persistent(swagger) add_blockdevice_delete_purge(swagger) - add_blockdevice_resize(swagger) + # This needs to be removed after the bug https://jira.eng.vmware.com/browse/VCOM-25699 is fixed + get_blockdevices_add_dollar_filter(swagger) add_404_not_found(swagger) add_400_bad_request(swagger) add_default_value_to_boolean_properties(swagger) - change_response_code(swagger) + # change_response_code(swagger) add_error_definition(swagger) diff --git a/pkg/client/about/about_client.go b/pkg/client/about/about_client.go index b37bb724..5298a458 100644 --- a/pkg/client/about/about_client.go +++ b/pkg/client/about/about_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetAboutPage(params *GetAboutPageParams) (*GetAboutPageOK, error) + GetAboutPage(params *GetAboutPageParams, opts ...ClientOption) (*GetAboutPageOK, error) - GetAboutUsingGET(params *GetAboutUsingGETParams) (*GetAboutUsingGETOK, error) + GetAboutUsingGET(params *GetAboutUsingGETParams, opts ...ClientOption) (*GetAboutUsingGETOK, error) - GetAboutUsingGET1(params *GetAboutUsingGET1Params) (*GetAboutUsingGET1OK, error) + GetAboutUsingGET1(params *GetAboutUsingGET1Params, opts ...ClientOption) (*GetAboutUsingGET1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { If you do not specify explicitly an exact version, you will be calling the latest supported API version. Here is an example of a call which specifies the exact version you are using: `GET /iaas/api/network-profiles?apiVersion=2019-01-15` */ -func (a *Client) GetAboutPage(params *GetAboutPageParams) (*GetAboutPageOK, error) { +func (a *Client) GetAboutPage(params *GetAboutPageParams, opts ...ClientOption) (*GetAboutPageOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAboutPageParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAboutPage", Method: "GET", PathPattern: "/iaas/api/about", @@ -60,7 +62,12 @@ func (a *Client) GetAboutPage(params *GetAboutPageParams) (*GetAboutPageOK, erro Reader: &GetAboutPageReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) GetAboutPage(params *GetAboutPageParams) (*GetAboutPageOK, erro If you do not specify explicitly an exact version, you will be calling the latest supported API version. Here is an example of a call which specifies the exact version you are using: GET /content/api/sources?apiVersion=2019-01-15 */ -func (a *Client) GetAboutUsingGET(params *GetAboutUsingGETParams) (*GetAboutUsingGETOK, error) { +func (a *Client) GetAboutUsingGET(params *GetAboutUsingGETParams, opts ...ClientOption) (*GetAboutUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAboutUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAboutUsingGET", Method: "GET", PathPattern: "/content/api/about", @@ -98,7 +104,12 @@ func (a *Client) GetAboutUsingGET(params *GetAboutUsingGETParams) (*GetAboutUsin Reader: &GetAboutUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -119,13 +130,12 @@ func (a *Client) GetAboutUsingGET(params *GetAboutUsingGETParams) (*GetAboutUsin If you do not specify explicitly an exact version, you will be calling the latest supported API version. Here is an example of a call which specifies the exact version you are using: GET /blueprint/api/blueprints?apiVersion=2019-09-12 */ -func (a *Client) GetAboutUsingGET1(params *GetAboutUsingGET1Params) (*GetAboutUsingGET1OK, error) { +func (a *Client) GetAboutUsingGET1(params *GetAboutUsingGET1Params, opts ...ClientOption) (*GetAboutUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAboutUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAboutUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/about", @@ -136,7 +146,12 @@ func (a *Client) GetAboutUsingGET1(params *GetAboutUsingGET1Params) (*GetAboutUs Reader: &GetAboutUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/about/get_about_page_parameters.go b/pkg/client/about/get_about_page_parameters.go index 518642bd..2f2763e2 100644 --- a/pkg/client/about/get_about_page_parameters.go +++ b/pkg/client/about/get_about_page_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAboutPageParams creates a new GetAboutPageParams object -// with the default values initialized. +// NewGetAboutPageParams creates a new GetAboutPageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAboutPageParams() *GetAboutPageParams { - return &GetAboutPageParams{ - timeout: cr.DefaultTimeout, } } // NewGetAboutPageParamsWithTimeout creates a new GetAboutPageParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAboutPageParamsWithTimeout(timeout time.Duration) *GetAboutPageParams { - return &GetAboutPageParams{ - timeout: timeout, } } // NewGetAboutPageParamsWithContext creates a new GetAboutPageParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAboutPageParamsWithContext(ctx context.Context) *GetAboutPageParams { - return &GetAboutPageParams{ - Context: ctx, } } // NewGetAboutPageParamsWithHTTPClient creates a new GetAboutPageParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAboutPageParamsWithHTTPClient(client *http.Client) *GetAboutPageParams { - return &GetAboutPageParams{ HTTPClient: client, } } -/*GetAboutPageParams contains all the parameters to send to the API endpoint -for the get about page operation typically these are written to a http.Request +/* GetAboutPageParams contains all the parameters to send to the API endpoint + for the get about page operation. + + Typically these are written to a http.Request. */ type GetAboutPageParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetAboutPageParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get about page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutPageParams) WithDefaults() *GetAboutPageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get about page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutPageParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get about page params func (o *GetAboutPageParams) WithTimeout(timeout time.Duration) *GetAboutPageParams { o.SetTimeout(timeout) diff --git a/pkg/client/about/get_about_page_responses.go b/pkg/client/about/get_about_page_responses.go index 7218252d..6e5a4043 100644 --- a/pkg/client/about/get_about_page_responses.go +++ b/pkg/client/about/get_about_page_responses.go @@ -35,7 +35,6 @@ func (o *GetAboutPageReader) ReadResponse(response runtime.ClientResponse, consu return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAboutPageOK() *GetAboutPageOK { return &GetAboutPageOK{} } -/*GetAboutPageOK handles this case with default header values. +/* GetAboutPageOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetAboutPageOK struct { func (o *GetAboutPageOK) Error() string { return fmt.Sprintf("[GET /iaas/api/about][%d] getAboutPageOK %+v", 200, o.Payload) } - func (o *GetAboutPageOK) GetPayload() *models.IaaSAbout { return o.Payload } @@ -79,18 +77,29 @@ func NewGetAboutPageForbidden() *GetAboutPageForbidden { return &GetAboutPageForbidden{} } -/*GetAboutPageForbidden handles this case with default header values. +/* GetAboutPageForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAboutPageForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAboutPageForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/about][%d] getAboutPageForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/about][%d] getAboutPageForbidden %+v", 403, o.Payload) +} +func (o *GetAboutPageForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAboutPageForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/about/get_about_using_get1_parameters.go b/pkg/client/about/get_about_using_get1_parameters.go index 1f440379..28ab5d61 100644 --- a/pkg/client/about/get_about_using_get1_parameters.go +++ b/pkg/client/about/get_about_using_get1_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAboutUsingGET1Params creates a new GetAboutUsingGET1Params object -// with the default values initialized. +// NewGetAboutUsingGET1Params creates a new GetAboutUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAboutUsingGET1Params() *GetAboutUsingGET1Params { - return &GetAboutUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetAboutUsingGET1ParamsWithTimeout creates a new GetAboutUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAboutUsingGET1ParamsWithTimeout(timeout time.Duration) *GetAboutUsingGET1Params { - return &GetAboutUsingGET1Params{ - timeout: timeout, } } // NewGetAboutUsingGET1ParamsWithContext creates a new GetAboutUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAboutUsingGET1ParamsWithContext(ctx context.Context) *GetAboutUsingGET1Params { - return &GetAboutUsingGET1Params{ - Context: ctx, } } // NewGetAboutUsingGET1ParamsWithHTTPClient creates a new GetAboutUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAboutUsingGET1ParamsWithHTTPClient(client *http.Client) *GetAboutUsingGET1Params { - return &GetAboutUsingGET1Params{ HTTPClient: client, } } -/*GetAboutUsingGET1Params contains all the parameters to send to the API endpoint -for the get about using get1 operation typically these are written to a http.Request +/* GetAboutUsingGET1Params contains all the parameters to send to the API endpoint + for the get about using get1 operation. + + Typically these are written to a http.Request. */ type GetAboutUsingGET1Params struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetAboutUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get about using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutUsingGET1Params) WithDefaults() *GetAboutUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get about using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get about using get1 params func (o *GetAboutUsingGET1Params) WithTimeout(timeout time.Duration) *GetAboutUsingGET1Params { o.SetTimeout(timeout) diff --git a/pkg/client/about/get_about_using_get1_responses.go b/pkg/client/about/get_about_using_get1_responses.go index 08351ecd..a3ea66eb 100644 --- a/pkg/client/about/get_about_using_get1_responses.go +++ b/pkg/client/about/get_about_using_get1_responses.go @@ -29,7 +29,6 @@ func (o *GetAboutUsingGET1Reader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetAboutUsingGET1OK() *GetAboutUsingGET1OK { return &GetAboutUsingGET1OK{} } -/*GetAboutUsingGET1OK handles this case with default header values. +/* GetAboutUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetAboutUsingGET1OK struct { func (o *GetAboutUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/about][%d] getAboutUsingGET1OK %+v", 200, o.Payload) } - func (o *GetAboutUsingGET1OK) GetPayload() *models.BlueprintAbout { return o.Payload } diff --git a/pkg/client/about/get_about_using_get_parameters.go b/pkg/client/about/get_about_using_get_parameters.go index db3c8d9f..be92ade0 100644 --- a/pkg/client/about/get_about_using_get_parameters.go +++ b/pkg/client/about/get_about_using_get_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAboutUsingGETParams creates a new GetAboutUsingGETParams object -// with the default values initialized. +// NewGetAboutUsingGETParams creates a new GetAboutUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAboutUsingGETParams() *GetAboutUsingGETParams { - return &GetAboutUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetAboutUsingGETParamsWithTimeout creates a new GetAboutUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAboutUsingGETParamsWithTimeout(timeout time.Duration) *GetAboutUsingGETParams { - return &GetAboutUsingGETParams{ - timeout: timeout, } } // NewGetAboutUsingGETParamsWithContext creates a new GetAboutUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAboutUsingGETParamsWithContext(ctx context.Context) *GetAboutUsingGETParams { - return &GetAboutUsingGETParams{ - Context: ctx, } } // NewGetAboutUsingGETParamsWithHTTPClient creates a new GetAboutUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAboutUsingGETParamsWithHTTPClient(client *http.Client) *GetAboutUsingGETParams { - return &GetAboutUsingGETParams{ HTTPClient: client, } } -/*GetAboutUsingGETParams contains all the parameters to send to the API endpoint -for the get about using g e t operation typically these are written to a http.Request +/* GetAboutUsingGETParams contains all the parameters to send to the API endpoint + for the get about using g e t operation. + + Typically these are written to a http.Request. */ type GetAboutUsingGETParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetAboutUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get about using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutUsingGETParams) WithDefaults() *GetAboutUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get about using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAboutUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get about using get params func (o *GetAboutUsingGETParams) WithTimeout(timeout time.Duration) *GetAboutUsingGETParams { o.SetTimeout(timeout) diff --git a/pkg/client/about/get_about_using_get_responses.go b/pkg/client/about/get_about_using_get_responses.go index 46c342be..7081b885 100644 --- a/pkg/client/about/get_about_using_get_responses.go +++ b/pkg/client/about/get_about_using_get_responses.go @@ -29,7 +29,6 @@ func (o *GetAboutUsingGETReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetAboutUsingGETOK() *GetAboutUsingGETOK { return &GetAboutUsingGETOK{} } -/*GetAboutUsingGETOK handles this case with default header values. +/* GetAboutUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetAboutUsingGETOK struct { func (o *GetAboutUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/about][%d] getAboutUsingGETOK %+v", 200, o.Payload) } - func (o *GetAboutUsingGETOK) GetPayload() *models.ContentAbout { return o.Payload } diff --git a/pkg/client/blueprint/blueprint_client.go b/pkg/client/blueprint/blueprint_client.go index fc2d1be4..be2200fa 100644 --- a/pkg/client/blueprint/blueprint_client.go +++ b/pkg/client/blueprint/blueprint_client.go @@ -25,33 +25,36 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Params) (*CreateBlueprintUsingPOST1Created, error) + CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintUsingPOST1Created, error) - CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersionUsingPOST1Params) (*CreateBlueprintVersionUsingPOST1Created, error) + CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintVersionUsingPOST1Created, error) - DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1Params) (*DeleteBlueprintUsingDELETE1NoContent, error) + DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1Params, opts ...ClientOption) (*DeleteBlueprintUsingDELETE1NoContent, error) - GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSchemaUsingGET1Params) (*GetBlueprintInputsSchemaUsingGET1OK, error) + GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSchemaUsingGET1Params, opts ...ClientOption) (*GetBlueprintInputsSchemaUsingGET1OK, error) - GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params) (*GetBlueprintUsingGET1OK, error) + GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params, opts ...ClientOption) (*GetBlueprintUsingGET1OK, error) - GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVersionInputsSchemaUsingGET1Params) (*GetBlueprintVersionInputsSchemaUsingGET1OK, error) + GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVersionInputsSchemaUsingGET1Params, opts ...ClientOption) (*GetBlueprintVersionInputsSchemaUsingGET1OK, error) - GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGET1Params) (*GetBlueprintVersionUsingGET1OK, error) + GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGET1Params, opts ...ClientOption) (*GetBlueprintVersionUsingGET1OK, error) - ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsingGETParams) (*ListBlueprintVersionsUsingGETOK, error) + ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsingGETParams, opts ...ClientOption) (*ListBlueprintVersionsUsingGETOK, error) - ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params) (*ListBlueprintsUsingGET1OK, error) + ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params, opts ...ClientOption) (*ListBlueprintsUsingGET1OK, error) - ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersionUsingPOST1Params) (*ReleaseBlueprintVersionUsingPOST1OK, error) + ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*ReleaseBlueprintVersionUsingPOST1OK, error) - RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersionUsingPOST1Params) (*RestoreBlueprintVersionUsingPOST1OK, error) + RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*RestoreBlueprintVersionUsingPOST1OK, error) - UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintVersionUsingPOST1Params) (*UnReleaseBlueprintVersionUsingPOST1OK, error) + UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*UnReleaseBlueprintVersionUsingPOST1OK, error) - UpdateBlueprintUsingPUT1(params *UpdateBlueprintUsingPUT1Params) (*UpdateBlueprintUsingPUT1OK, error) + UpdateBlueprintUsingPUT1(params *UpdateBlueprintUsingPUT1Params, opts ...ClientOption) (*UpdateBlueprintUsingPUT1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -59,13 +62,12 @@ type ClientService interface { /* CreateBlueprintUsingPOST1 creates a blueprint */ -func (a *Client) CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Params) (*CreateBlueprintUsingPOST1Created, error) { +func (a *Client) CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintUsingPOST1Created, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlueprintUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlueprintUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprints", @@ -76,7 +78,12 @@ func (a *Client) CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Para Reader: &CreateBlueprintUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -93,13 +100,12 @@ func (a *Client) CreateBlueprintUsingPOST1(params *CreateBlueprintUsingPOST1Para /* CreateBlueprintVersionUsingPOST1 creates version for the given blueprint ID */ -func (a *Client) CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersionUsingPOST1Params) (*CreateBlueprintVersionUsingPOST1Created, error) { +func (a *Client) CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintVersionUsingPOST1Created, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlueprintVersionUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlueprintVersionUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions", @@ -110,7 +116,12 @@ func (a *Client) CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersion Reader: &CreateBlueprintVersionUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -127,13 +138,12 @@ func (a *Client) CreateBlueprintVersionUsingPOST1(params *CreateBlueprintVersion /* DeleteBlueprintUsingDELETE1 deletes a blueprint */ -func (a *Client) DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1Params) (*DeleteBlueprintUsingDELETE1NoContent, error) { +func (a *Client) DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1Params, opts ...ClientOption) (*DeleteBlueprintUsingDELETE1NoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteBlueprintUsingDELETE1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteBlueprintUsingDELETE_1", Method: "DELETE", PathPattern: "/blueprint/api/blueprints/{blueprintId}", @@ -144,7 +154,12 @@ func (a *Client) DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1 Reader: &DeleteBlueprintUsingDELETE1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -161,13 +176,12 @@ func (a *Client) DeleteBlueprintUsingDELETE1(params *DeleteBlueprintUsingDELETE1 /* GetBlueprintInputsSchemaUsingGET1 returns blueprint inputs schema */ -func (a *Client) GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSchemaUsingGET1Params) (*GetBlueprintInputsSchemaUsingGET1OK, error) { +func (a *Client) GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSchemaUsingGET1Params, opts ...ClientOption) (*GetBlueprintInputsSchemaUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintInputsSchemaUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintInputsSchemaUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprints/{blueprintId}/inputs-schema", @@ -178,7 +192,12 @@ func (a *Client) GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSch Reader: &GetBlueprintInputsSchemaUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -195,13 +214,12 @@ func (a *Client) GetBlueprintInputsSchemaUsingGET1(params *GetBlueprintInputsSch /* GetBlueprintUsingGET1 returns blueprint details */ -func (a *Client) GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params) (*GetBlueprintUsingGET1OK, error) { +func (a *Client) GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params, opts ...ClientOption) (*GetBlueprintUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprints/{blueprintId}", @@ -212,7 +230,12 @@ func (a *Client) GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params) (*Ge Reader: &GetBlueprintUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetBlueprintUsingGET1(params *GetBlueprintUsingGET1Params) (*Ge /* GetBlueprintVersionInputsSchemaUsingGET1 returns blueprint version inputs schema */ -func (a *Client) GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVersionInputsSchemaUsingGET1Params) (*GetBlueprintVersionInputsSchemaUsingGET1OK, error) { +func (a *Client) GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVersionInputsSchemaUsingGET1Params, opts ...ClientOption) (*GetBlueprintVersionInputsSchemaUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintVersionInputsSchemaUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintVersionInputsSchemaUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions/{version}/inputs-schema", @@ -246,7 +268,12 @@ func (a *Client) GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVe Reader: &GetBlueprintVersionInputsSchemaUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -263,13 +290,12 @@ func (a *Client) GetBlueprintVersionInputsSchemaUsingGET1(params *GetBlueprintVe /* GetBlueprintVersionUsingGET1 returns versioned blueprint details */ -func (a *Client) GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGET1Params) (*GetBlueprintVersionUsingGET1OK, error) { +func (a *Client) GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGET1Params, opts ...ClientOption) (*GetBlueprintVersionUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintVersionUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintVersionUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions/{version}", @@ -280,7 +306,12 @@ func (a *Client) GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGE Reader: &GetBlueprintVersionUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -297,13 +328,12 @@ func (a *Client) GetBlueprintVersionUsingGET1(params *GetBlueprintVersionUsingGE /* ListBlueprintVersionsUsingGET lists blueprint versions */ -func (a *Client) ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsingGETParams) (*ListBlueprintVersionsUsingGETOK, error) { +func (a *Client) ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsingGETParams, opts ...ClientOption) (*ListBlueprintVersionsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListBlueprintVersionsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listBlueprintVersionsUsingGET", Method: "GET", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions", @@ -314,7 +344,12 @@ func (a *Client) ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsin Reader: &ListBlueprintVersionsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -331,13 +366,12 @@ func (a *Client) ListBlueprintVersionsUsingGET(params *ListBlueprintVersionsUsin /* ListBlueprintsUsingGET1 lists draft blueprint */ -func (a *Client) ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params) (*ListBlueprintsUsingGET1OK, error) { +func (a *Client) ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params, opts ...ClientOption) (*ListBlueprintsUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewListBlueprintsUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listBlueprintsUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprints", @@ -348,7 +382,12 @@ func (a *Client) ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params) Reader: &ListBlueprintsUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -365,13 +404,12 @@ func (a *Client) ListBlueprintsUsingGET1(params *ListBlueprintsUsingGET1Params) /* ReleaseBlueprintVersionUsingPOST1 releases versioned blueprint to catalog */ -func (a *Client) ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersionUsingPOST1Params) (*ReleaseBlueprintVersionUsingPOST1OK, error) { +func (a *Client) ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*ReleaseBlueprintVersionUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewReleaseBlueprintVersionUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "releaseBlueprintVersionUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/release", @@ -382,7 +420,12 @@ func (a *Client) ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersi Reader: &ReleaseBlueprintVersionUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -399,13 +442,12 @@ func (a *Client) ReleaseBlueprintVersionUsingPOST1(params *ReleaseBlueprintVersi /* RestoreBlueprintVersionUsingPOST1 restores content of draft from versioned blueprint */ -func (a *Client) RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersionUsingPOST1Params) (*RestoreBlueprintVersionUsingPOST1OK, error) { +func (a *Client) RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*RestoreBlueprintVersionUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewRestoreBlueprintVersionUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "restoreBlueprintVersionUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/restore", @@ -416,7 +458,12 @@ func (a *Client) RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersi Reader: &RestoreBlueprintVersionUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -433,13 +480,12 @@ func (a *Client) RestoreBlueprintVersionUsingPOST1(params *RestoreBlueprintVersi /* UnReleaseBlueprintVersionUsingPOST1 uns release versioned blueprint from catalog */ -func (a *Client) UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintVersionUsingPOST1Params) (*UnReleaseBlueprintVersionUsingPOST1OK, error) { +func (a *Client) UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintVersionUsingPOST1Params, opts ...ClientOption) (*UnReleaseBlueprintVersionUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewUnReleaseBlueprintVersionUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "unReleaseBlueprintVersionUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/unrelease", @@ -450,7 +496,12 @@ func (a *Client) UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintV Reader: &UnReleaseBlueprintVersionUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -467,13 +518,12 @@ func (a *Client) UnReleaseBlueprintVersionUsingPOST1(params *UnReleaseBlueprintV /* UpdateBlueprintUsingPUT1 updates a blueprint */ -func (a *Client) UpdateBlueprintUsingPUT1(params *UpdateBlueprintUsingPUT1Params) (*UpdateBlueprintUsingPUT1OK, error) { +func (a *Client) UpdateBlueprintUsingPUT1(params *UpdateBlueprintUsingPUT1Params, opts ...ClientOption) (*UpdateBlueprintUsingPUT1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateBlueprintUsingPUT1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateBlueprintUsingPUT_1", Method: "PUT", PathPattern: "/blueprint/api/blueprints/{blueprintId}", @@ -484,7 +534,12 @@ func (a *Client) UpdateBlueprintUsingPUT1(params *UpdateBlueprintUsingPUT1Params Reader: &UpdateBlueprintUsingPUT1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/blueprint/create_blueprint_using_post1_parameters.go b/pkg/client/blueprint/create_blueprint_using_post1_parameters.go index 80079da3..b82c104d 100644 --- a/pkg/client/blueprint/create_blueprint_using_post1_parameters.go +++ b/pkg/client/blueprint/create_blueprint_using_post1_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlueprintUsingPOST1Params creates a new CreateBlueprintUsingPOST1Params object -// with the default values initialized. +// NewCreateBlueprintUsingPOST1Params creates a new CreateBlueprintUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlueprintUsingPOST1Params() *CreateBlueprintUsingPOST1Params { - var () return &CreateBlueprintUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateBlueprintUsingPOST1ParamsWithTimeout creates a new CreateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlueprintUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateBlueprintUsingPOST1Params { - var () return &CreateBlueprintUsingPOST1Params{ - timeout: timeout, } } // NewCreateBlueprintUsingPOST1ParamsWithContext creates a new CreateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlueprintUsingPOST1ParamsWithContext(ctx context.Context) *CreateBlueprintUsingPOST1Params { - var () return &CreateBlueprintUsingPOST1Params{ - Context: ctx, } } // NewCreateBlueprintUsingPOST1ParamsWithHTTPClient creates a new CreateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlueprintUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateBlueprintUsingPOST1Params { - var () return &CreateBlueprintUsingPOST1Params{ HTTPClient: client, } } -/*CreateBlueprintUsingPOST1Params contains all the parameters to send to the API endpoint -for the create blueprint using p o s t 1 operation typically these are written to a http.Request +/* CreateBlueprintUsingPOST1Params contains all the parameters to send to the API endpoint + for the create blueprint using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateBlueprintUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Blueprint - Blueprint object + /* Blueprint. + + Blueprint object */ Blueprint *models.Blueprint @@ -78,6 +78,21 @@ type CreateBlueprintUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create blueprint using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintUsingPOST1Params) WithDefaults() *CreateBlueprintUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create blueprint using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create blueprint using p o s t 1 params func (o *CreateBlueprintUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateBlueprintUsingPOST1Params { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateBlueprintUsingPOST1Params) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Blueprint != nil { if err := r.SetBodyParam(o.Blueprint); err != nil { return err diff --git a/pkg/client/blueprint/create_blueprint_using_post1_responses.go b/pkg/client/blueprint/create_blueprint_using_post1_responses.go index 1ba45744..2e40f9ac 100644 --- a/pkg/client/blueprint/create_blueprint_using_post1_responses.go +++ b/pkg/client/blueprint/create_blueprint_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *CreateBlueprintUsingPOST1Reader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateBlueprintUsingPOST1Created() *CreateBlueprintUsingPOST1Created { return &CreateBlueprintUsingPOST1Created{} } -/*CreateBlueprintUsingPOST1Created handles this case with default header values. +/* CreateBlueprintUsingPOST1Created describes a response with status code 201, with default header values. Created */ @@ -69,7 +68,6 @@ type CreateBlueprintUsingPOST1Created struct { func (o *CreateBlueprintUsingPOST1Created) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints][%d] createBlueprintUsingPOST1Created %+v", 201, o.Payload) } - func (o *CreateBlueprintUsingPOST1Created) GetPayload() *models.Blueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateBlueprintUsingPOST1BadRequest() *CreateBlueprintUsingPOST1BadReque return &CreateBlueprintUsingPOST1BadRequest{} } -/*CreateBlueprintUsingPOST1BadRequest handles this case with default header values. +/* CreateBlueprintUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type CreateBlueprintUsingPOST1BadRequest struct { func (o *CreateBlueprintUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints][%d] createBlueprintUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateBlueprintUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateBlueprintUsingPOST1Unauthorized() *CreateBlueprintUsingPOST1Unauth return &CreateBlueprintUsingPOST1Unauthorized{} } -/*CreateBlueprintUsingPOST1Unauthorized handles this case with default header values. +/* CreateBlueprintUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateBlueprintUsingPOST1Forbidden() *CreateBlueprintUsingPOST1Forbidden return &CreateBlueprintUsingPOST1Forbidden{} } -/*CreateBlueprintUsingPOST1Forbidden handles this case with default header values. +/* CreateBlueprintUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint/create_blueprint_version_using_post1_parameters.go b/pkg/client/blueprint/create_blueprint_version_using_post1_parameters.go index d6961abf..be6bc7ae 100644 --- a/pkg/client/blueprint/create_blueprint_version_using_post1_parameters.go +++ b/pkg/client/blueprint/create_blueprint_version_using_post1_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlueprintVersionUsingPOST1Params creates a new CreateBlueprintVersionUsingPOST1Params object -// with the default values initialized. +// NewCreateBlueprintVersionUsingPOST1Params creates a new CreateBlueprintVersionUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlueprintVersionUsingPOST1Params() *CreateBlueprintVersionUsingPOST1Params { - var () return &CreateBlueprintVersionUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateBlueprintVersionUsingPOST1ParamsWithTimeout creates a new CreateBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlueprintVersionUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateBlueprintVersionUsingPOST1Params { - var () return &CreateBlueprintVersionUsingPOST1Params{ - timeout: timeout, } } // NewCreateBlueprintVersionUsingPOST1ParamsWithContext creates a new CreateBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlueprintVersionUsingPOST1ParamsWithContext(ctx context.Context) *CreateBlueprintVersionUsingPOST1Params { - var () return &CreateBlueprintVersionUsingPOST1Params{ - Context: ctx, } } // NewCreateBlueprintVersionUsingPOST1ParamsWithHTTPClient creates a new CreateBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlueprintVersionUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateBlueprintVersionUsingPOST1Params { - var () return &CreateBlueprintVersionUsingPOST1Params{ HTTPClient: client, } } -/*CreateBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint -for the create blueprint version using p o s t 1 operation typically these are written to a http.Request +/* CreateBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint + for the create blueprint version using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateBlueprintVersionUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*VersionRequest - Blueprint version object + /* VersionRequest. + + Blueprint version object */ VersionRequest *models.BlueprintVersionRequest @@ -83,6 +86,21 @@ type CreateBlueprintVersionUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintVersionUsingPOST1Params) WithDefaults() *CreateBlueprintVersionUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintVersionUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create blueprint version using p o s t 1 params func (o *CreateBlueprintVersionUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateBlueprintVersionUsingPOST1Params { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *CreateBlueprintVersionUsingPOST1Params) WriteToRequest(r runtime.Client // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId if err := r.SetPathParam("blueprintId", o.BlueprintID.String()); err != nil { return err } - if o.VersionRequest != nil { if err := r.SetBodyParam(o.VersionRequest); err != nil { return err diff --git a/pkg/client/blueprint/create_blueprint_version_using_post1_responses.go b/pkg/client/blueprint/create_blueprint_version_using_post1_responses.go index 20859e76..3b28a5a2 100644 --- a/pkg/client/blueprint/create_blueprint_version_using_post1_responses.go +++ b/pkg/client/blueprint/create_blueprint_version_using_post1_responses.go @@ -53,7 +53,6 @@ func (o *CreateBlueprintVersionUsingPOST1Reader) ReadResponse(response runtime.C return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewCreateBlueprintVersionUsingPOST1Created() *CreateBlueprintVersionUsingPO return &CreateBlueprintVersionUsingPOST1Created{} } -/*CreateBlueprintVersionUsingPOST1Created handles this case with default header values. +/* CreateBlueprintVersionUsingPOST1Created describes a response with status code 201, with default header values. Created */ @@ -75,7 +74,6 @@ type CreateBlueprintVersionUsingPOST1Created struct { func (o *CreateBlueprintVersionUsingPOST1Created) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions][%d] createBlueprintVersionUsingPOST1Created %+v", 201, o.Payload) } - func (o *CreateBlueprintVersionUsingPOST1Created) GetPayload() *models.BlueprintVersion { return o.Payload } @@ -97,7 +95,7 @@ func NewCreateBlueprintVersionUsingPOST1BadRequest() *CreateBlueprintVersionUsin return &CreateBlueprintVersionUsingPOST1BadRequest{} } -/*CreateBlueprintVersionUsingPOST1BadRequest handles this case with default header values. +/* CreateBlueprintVersionUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,7 +106,6 @@ type CreateBlueprintVersionUsingPOST1BadRequest struct { func (o *CreateBlueprintVersionUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions][%d] createBlueprintVersionUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateBlueprintVersionUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -130,7 +127,7 @@ func NewCreateBlueprintVersionUsingPOST1Unauthorized() *CreateBlueprintVersionUs return &CreateBlueprintVersionUsingPOST1Unauthorized{} } -/*CreateBlueprintVersionUsingPOST1Unauthorized handles this case with default header values. +/* CreateBlueprintVersionUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,7 +148,7 @@ func NewCreateBlueprintVersionUsingPOST1Forbidden() *CreateBlueprintVersionUsing return &CreateBlueprintVersionUsingPOST1Forbidden{} } -/*CreateBlueprintVersionUsingPOST1Forbidden handles this case with default header values. +/* CreateBlueprintVersionUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -172,7 +169,7 @@ func NewCreateBlueprintVersionUsingPOST1NotFound() *CreateBlueprintVersionUsingP return &CreateBlueprintVersionUsingPOST1NotFound{} } -/*CreateBlueprintVersionUsingPOST1NotFound handles this case with default header values. +/* CreateBlueprintVersionUsingPOST1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -183,7 +180,6 @@ type CreateBlueprintVersionUsingPOST1NotFound struct { func (o *CreateBlueprintVersionUsingPOST1NotFound) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions][%d] createBlueprintVersionUsingPOST1NotFound %+v", 404, o.Payload) } - func (o *CreateBlueprintVersionUsingPOST1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/delete_blueprint_using_delete1_parameters.go b/pkg/client/blueprint/delete_blueprint_using_delete1_parameters.go index f9036a50..bd41a22d 100644 --- a/pkg/client/blueprint/delete_blueprint_using_delete1_parameters.go +++ b/pkg/client/blueprint/delete_blueprint_using_delete1_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteBlueprintUsingDELETE1Params creates a new DeleteBlueprintUsingDELETE1Params object -// with the default values initialized. +// NewDeleteBlueprintUsingDELETE1Params creates a new DeleteBlueprintUsingDELETE1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteBlueprintUsingDELETE1Params() *DeleteBlueprintUsingDELETE1Params { - var () return &DeleteBlueprintUsingDELETE1Params{ - timeout: cr.DefaultTimeout, } } // NewDeleteBlueprintUsingDELETE1ParamsWithTimeout creates a new DeleteBlueprintUsingDELETE1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteBlueprintUsingDELETE1ParamsWithTimeout(timeout time.Duration) *DeleteBlueprintUsingDELETE1Params { - var () return &DeleteBlueprintUsingDELETE1Params{ - timeout: timeout, } } // NewDeleteBlueprintUsingDELETE1ParamsWithContext creates a new DeleteBlueprintUsingDELETE1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteBlueprintUsingDELETE1ParamsWithContext(ctx context.Context) *DeleteBlueprintUsingDELETE1Params { - var () return &DeleteBlueprintUsingDELETE1Params{ - Context: ctx, } } // NewDeleteBlueprintUsingDELETE1ParamsWithHTTPClient creates a new DeleteBlueprintUsingDELETE1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteBlueprintUsingDELETE1ParamsWithHTTPClient(client *http.Client) *DeleteBlueprintUsingDELETE1Params { - var () return &DeleteBlueprintUsingDELETE1Params{ HTTPClient: client, } } -/*DeleteBlueprintUsingDELETE1Params contains all the parameters to send to the API endpoint -for the delete blueprint using d e l e t e 1 operation typically these are written to a http.Request +/* DeleteBlueprintUsingDELETE1Params contains all the parameters to send to the API endpoint + for the delete blueprint using d e l e t e 1 operation. + + Typically these are written to a http.Request. */ type DeleteBlueprintUsingDELETE1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteBlueprintUsingDELETE1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete blueprint using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlueprintUsingDELETE1Params) WithDefaults() *DeleteBlueprintUsingDELETE1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete blueprint using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlueprintUsingDELETE1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete blueprint using d e l e t e 1 params func (o *DeleteBlueprintUsingDELETE1Params) WithTimeout(timeout time.Duration) *DeleteBlueprintUsingDELETE1Params { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteBlueprintUsingDELETE1Params) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/delete_blueprint_using_delete1_responses.go b/pkg/client/blueprint/delete_blueprint_using_delete1_responses.go index 687aa676..84a1e40d 100644 --- a/pkg/client/blueprint/delete_blueprint_using_delete1_responses.go +++ b/pkg/client/blueprint/delete_blueprint_using_delete1_responses.go @@ -47,7 +47,6 @@ func (o *DeleteBlueprintUsingDELETE1Reader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeleteBlueprintUsingDELETE1NoContent() *DeleteBlueprintUsingDELETE1NoCon return &DeleteBlueprintUsingDELETE1NoContent{} } -/*DeleteBlueprintUsingDELETE1NoContent handles this case with default header values. +/* DeleteBlueprintUsingDELETE1NoContent describes a response with status code 204, with default header values. No Content */ @@ -79,7 +78,7 @@ func NewDeleteBlueprintUsingDELETE1Unauthorized() *DeleteBlueprintUsingDELETE1Un return &DeleteBlueprintUsingDELETE1Unauthorized{} } -/*DeleteBlueprintUsingDELETE1Unauthorized handles this case with default header values. +/* DeleteBlueprintUsingDELETE1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -100,7 +99,7 @@ func NewDeleteBlueprintUsingDELETE1Forbidden() *DeleteBlueprintUsingDELETE1Forbi return &DeleteBlueprintUsingDELETE1Forbidden{} } -/*DeleteBlueprintUsingDELETE1Forbidden handles this case with default header values. +/* DeleteBlueprintUsingDELETE1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -121,7 +120,7 @@ func NewDeleteBlueprintUsingDELETE1NotFound() *DeleteBlueprintUsingDELETE1NotFou return &DeleteBlueprintUsingDELETE1NotFound{} } -/*DeleteBlueprintUsingDELETE1NotFound handles this case with default header values. +/* DeleteBlueprintUsingDELETE1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type DeleteBlueprintUsingDELETE1NotFound struct { func (o *DeleteBlueprintUsingDELETE1NotFound) Error() string { return fmt.Sprintf("[DELETE /blueprint/api/blueprints/{blueprintId}][%d] deleteBlueprintUsingDELETE1NotFound %+v", 404, o.Payload) } - func (o *DeleteBlueprintUsingDELETE1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_parameters.go b/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_parameters.go index b865fff0..8d2aebbe 100644 --- a/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_parameters.go +++ b/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetBlueprintInputsSchemaUsingGET1Params creates a new GetBlueprintInputsSchemaUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintInputsSchemaUsingGET1Params creates a new GetBlueprintInputsSchemaUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintInputsSchemaUsingGET1Params() *GetBlueprintInputsSchemaUsingGET1Params { - var () return &GetBlueprintInputsSchemaUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintInputsSchemaUsingGET1ParamsWithTimeout creates a new GetBlueprintInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintInputsSchemaUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintInputsSchemaUsingGET1Params { - var () return &GetBlueprintInputsSchemaUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintInputsSchemaUsingGET1ParamsWithContext creates a new GetBlueprintInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintInputsSchemaUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintInputsSchemaUsingGET1Params { - var () return &GetBlueprintInputsSchemaUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintInputsSchemaUsingGET1ParamsWithHTTPClient creates a new GetBlueprintInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintInputsSchemaUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintInputsSchemaUsingGET1Params { - var () return &GetBlueprintInputsSchemaUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintInputsSchemaUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint inputs schema using get1 operation typically these are written to a http.Request +/* GetBlueprintInputsSchemaUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint inputs schema using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintInputsSchemaUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId */ BlueprintID string @@ -76,6 +76,21 @@ type GetBlueprintInputsSchemaUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint inputs schema using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintInputsSchemaUsingGET1Params) WithDefaults() *GetBlueprintInputsSchemaUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint inputs schema using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintInputsSchemaUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint inputs schema using get1 params func (o *GetBlueprintInputsSchemaUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintInputsSchemaUsingGET1Params { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetBlueprintInputsSchemaUsingGET1Params) WriteToRequest(r runtime.Clien // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_responses.go b/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_responses.go index be1e7599..bc55157b 100644 --- a/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_responses.go +++ b/pkg/client/blueprint/get_blueprint_inputs_schema_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintInputsSchemaUsingGET1Reader) ReadResponse(response runtime. return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintInputsSchemaUsingGET1OK() *GetBlueprintInputsSchemaUsingGET1 return &GetBlueprintInputsSchemaUsingGET1OK{} } -/*GetBlueprintInputsSchemaUsingGET1OK handles this case with default header values. +/* GetBlueprintInputsSchemaUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintInputsSchemaUsingGET1OK struct { func (o *GetBlueprintInputsSchemaUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/inputs-schema][%d] getBlueprintInputsSchemaUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintInputsSchemaUsingGET1OK) GetPayload() *models.PropertyDefinition { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintInputsSchemaUsingGET1Unauthorized() *GetBlueprintInputsSchem return &GetBlueprintInputsSchemaUsingGET1Unauthorized{} } -/*GetBlueprintInputsSchemaUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintInputsSchemaUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintInputsSchemaUsingGET1Forbidden() *GetBlueprintInputsSchemaUs return &GetBlueprintInputsSchemaUsingGET1Forbidden{} } -/*GetBlueprintInputsSchemaUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintInputsSchemaUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintInputsSchemaUsingGET1NotFound() *GetBlueprintInputsSchemaUsi return &GetBlueprintInputsSchemaUsingGET1NotFound{} } -/*GetBlueprintInputsSchemaUsingGET1NotFound handles this case with default header values. +/* GetBlueprintInputsSchemaUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintInputsSchemaUsingGET1NotFound struct { func (o *GetBlueprintInputsSchemaUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/inputs-schema][%d] getBlueprintInputsSchemaUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintInputsSchemaUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/get_blueprint_using_get1_parameters.go b/pkg/client/blueprint/get_blueprint_using_get1_parameters.go index 4cc47a2b..e20033b6 100644 --- a/pkg/client/blueprint/get_blueprint_using_get1_parameters.go +++ b/pkg/client/blueprint/get_blueprint_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetBlueprintUsingGET1Params creates a new GetBlueprintUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintUsingGET1Params creates a new GetBlueprintUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintUsingGET1Params() *GetBlueprintUsingGET1Params { - var () return &GetBlueprintUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintUsingGET1ParamsWithTimeout creates a new GetBlueprintUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintUsingGET1Params { - var () return &GetBlueprintUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintUsingGET1ParamsWithContext creates a new GetBlueprintUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintUsingGET1Params { - var () return &GetBlueprintUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintUsingGET1ParamsWithHTTPClient creates a new GetBlueprintUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintUsingGET1Params { - var () return &GetBlueprintUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint using get1 operation typically these are written to a http.Request +/* GetBlueprintUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintUsingGET1Params struct { - /*DollarSelect - Fields to include in content. Use * to get all fields. + /* DollarSelect. + Fields to include in content. Use * to get all fields. */ DollarSelect []string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID @@ -82,6 +85,21 @@ type GetBlueprintUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintUsingGET1Params) WithDefaults() *GetBlueprintUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint using get1 params func (o *GetBlueprintUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintUsingGET1Params { o.SetTimeout(timeout) @@ -156,28 +174,32 @@ func (o *GetBlueprintUsingGET1Params) WriteToRequest(r runtime.ClientRequest, re } var res []error - valuesDollarSelect := o.DollarSelect + if o.DollarSelect != nil { - joinedDollarSelect := swag.JoinByFormat(valuesDollarSelect, "multi") - // query array param $select - if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { - return err + // binding items for $select + joinedDollarSelect := o.bindParamDollarSelect(reg) + + // query array param $select + if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { + return err + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId @@ -190,3 +212,20 @@ func (o *GetBlueprintUsingGET1Params) WriteToRequest(r runtime.ClientRequest, re } return nil } + +// bindParamGetBlueprintUsingGET1 binds the parameter $select +func (o *GetBlueprintUsingGET1Params) bindParamDollarSelect(formats strfmt.Registry) []string { + dollarSelectIR := o.DollarSelect + + var dollarSelectIC []string + for _, dollarSelectIIR := range dollarSelectIR { // explode []string + + dollarSelectIIV := dollarSelectIIR // string as string + dollarSelectIC = append(dollarSelectIC, dollarSelectIIV) + } + + // items.CollectionFormat: "multi" + dollarSelectIS := swag.JoinByFormat(dollarSelectIC, "multi") + + return dollarSelectIS +} diff --git a/pkg/client/blueprint/get_blueprint_using_get1_responses.go b/pkg/client/blueprint/get_blueprint_using_get1_responses.go index 5045ea11..42f26009 100644 --- a/pkg/client/blueprint/get_blueprint_using_get1_responses.go +++ b/pkg/client/blueprint/get_blueprint_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintUsingGET1Reader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintUsingGET1OK() *GetBlueprintUsingGET1OK { return &GetBlueprintUsingGET1OK{} } -/*GetBlueprintUsingGET1OK handles this case with default header values. +/* GetBlueprintUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintUsingGET1OK struct { func (o *GetBlueprintUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}][%d] getBlueprintUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintUsingGET1OK) GetPayload() *models.Blueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintUsingGET1Unauthorized() *GetBlueprintUsingGET1Unauthorized { return &GetBlueprintUsingGET1Unauthorized{} } -/*GetBlueprintUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintUsingGET1Forbidden() *GetBlueprintUsingGET1Forbidden { return &GetBlueprintUsingGET1Forbidden{} } -/*GetBlueprintUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintUsingGET1NotFound() *GetBlueprintUsingGET1NotFound { return &GetBlueprintUsingGET1NotFound{} } -/*GetBlueprintUsingGET1NotFound handles this case with default header values. +/* GetBlueprintUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintUsingGET1NotFound struct { func (o *GetBlueprintUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}][%d] getBlueprintUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_parameters.go b/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_parameters.go index 145541c4..c8a51b05 100644 --- a/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_parameters.go +++ b/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetBlueprintVersionInputsSchemaUsingGET1Params creates a new GetBlueprintVersionInputsSchemaUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintVersionInputsSchemaUsingGET1Params creates a new GetBlueprintVersionInputsSchemaUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintVersionInputsSchemaUsingGET1Params() *GetBlueprintVersionInputsSchemaUsingGET1Params { - var () return &GetBlueprintVersionInputsSchemaUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithTimeout creates a new GetBlueprintVersionInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintVersionInputsSchemaUsingGET1Params { - var () return &GetBlueprintVersionInputsSchemaUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithContext creates a new GetBlueprintVersionInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintVersionInputsSchemaUsingGET1Params { - var () return &GetBlueprintVersionInputsSchemaUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithHTTPClient creates a new GetBlueprintVersionInputsSchemaUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintVersionInputsSchemaUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintVersionInputsSchemaUsingGET1Params { - var () return &GetBlueprintVersionInputsSchemaUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintVersionInputsSchemaUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint version inputs schema using get1 operation typically these are written to a http.Request +/* GetBlueprintVersionInputsSchemaUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint version inputs schema using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintVersionInputsSchemaUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId */ BlueprintID string - /*Version - version + /* Version. + + version */ Version string @@ -81,6 +82,21 @@ type GetBlueprintVersionInputsSchemaUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint version inputs schema using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintVersionInputsSchemaUsingGET1Params) WithDefaults() *GetBlueprintVersionInputsSchemaUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint version inputs schema using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintVersionInputsSchemaUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint version inputs schema using get1 params func (o *GetBlueprintVersionInputsSchemaUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintVersionInputsSchemaUsingGET1Params { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetBlueprintVersionInputsSchemaUsingGET1Params) WriteToRequest(r runtim // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_responses.go b/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_responses.go index ba6e6c2a..602061ab 100644 --- a/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_responses.go +++ b/pkg/client/blueprint/get_blueprint_version_inputs_schema_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintVersionInputsSchemaUsingGET1Reader) ReadResponse(response r return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintVersionInputsSchemaUsingGET1OK() *GetBlueprintVersionInputsS return &GetBlueprintVersionInputsSchemaUsingGET1OK{} } -/*GetBlueprintVersionInputsSchemaUsingGET1OK handles this case with default header values. +/* GetBlueprintVersionInputsSchemaUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintVersionInputsSchemaUsingGET1OK struct { func (o *GetBlueprintVersionInputsSchemaUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions/{version}/inputs-schema][%d] getBlueprintVersionInputsSchemaUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintVersionInputsSchemaUsingGET1OK) GetPayload() *models.PropertyDefinition { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintVersionInputsSchemaUsingGET1Unauthorized() *GetBlueprintVers return &GetBlueprintVersionInputsSchemaUsingGET1Unauthorized{} } -/*GetBlueprintVersionInputsSchemaUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintVersionInputsSchemaUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintVersionInputsSchemaUsingGET1Forbidden() *GetBlueprintVersion return &GetBlueprintVersionInputsSchemaUsingGET1Forbidden{} } -/*GetBlueprintVersionInputsSchemaUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintVersionInputsSchemaUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintVersionInputsSchemaUsingGET1NotFound() *GetBlueprintVersionI return &GetBlueprintVersionInputsSchemaUsingGET1NotFound{} } -/*GetBlueprintVersionInputsSchemaUsingGET1NotFound handles this case with default header values. +/* GetBlueprintVersionInputsSchemaUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintVersionInputsSchemaUsingGET1NotFound struct { func (o *GetBlueprintVersionInputsSchemaUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions/{version}/inputs-schema][%d] getBlueprintVersionInputsSchemaUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintVersionInputsSchemaUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/get_blueprint_version_using_get1_parameters.go b/pkg/client/blueprint/get_blueprint_version_using_get1_parameters.go index 5e582c17..36ff7c60 100644 --- a/pkg/client/blueprint/get_blueprint_version_using_get1_parameters.go +++ b/pkg/client/blueprint/get_blueprint_version_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetBlueprintVersionUsingGET1Params creates a new GetBlueprintVersionUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintVersionUsingGET1Params creates a new GetBlueprintVersionUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintVersionUsingGET1Params() *GetBlueprintVersionUsingGET1Params { - var () return &GetBlueprintVersionUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintVersionUsingGET1ParamsWithTimeout creates a new GetBlueprintVersionUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintVersionUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintVersionUsingGET1Params { - var () return &GetBlueprintVersionUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintVersionUsingGET1ParamsWithContext creates a new GetBlueprintVersionUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintVersionUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintVersionUsingGET1Params { - var () return &GetBlueprintVersionUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintVersionUsingGET1ParamsWithHTTPClient creates a new GetBlueprintVersionUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintVersionUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintVersionUsingGET1Params { - var () return &GetBlueprintVersionUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintVersionUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint version using get1 operation typically these are written to a http.Request +/* GetBlueprintVersionUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint version using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintVersionUsingGET1Params struct { - /*DollarSelect - Fields to include in content. Use * to get all fields. + /* DollarSelect. + Fields to include in content. Use * to get all fields. */ DollarSelect []string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*Version - version + /* Version. + + version */ Version string @@ -82,6 +85,21 @@ type GetBlueprintVersionUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint version using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintVersionUsingGET1Params) WithDefaults() *GetBlueprintVersionUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint version using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintVersionUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint version using get1 params func (o *GetBlueprintVersionUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintVersionUsingGET1Params { o.SetTimeout(timeout) @@ -156,12 +174,15 @@ func (o *GetBlueprintVersionUsingGET1Params) WriteToRequest(r runtime.ClientRequ } var res []error - valuesDollarSelect := o.DollarSelect + if o.DollarSelect != nil { - joinedDollarSelect := swag.JoinByFormat(valuesDollarSelect, "multi") - // query array param $select - if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { - return err + // binding items for $select + joinedDollarSelect := o.bindParamDollarSelect(reg) + + // query array param $select + if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { + return err + } } // path param blueprintId @@ -179,3 +200,20 @@ func (o *GetBlueprintVersionUsingGET1Params) WriteToRequest(r runtime.ClientRequ } return nil } + +// bindParamGetBlueprintVersionUsingGET1 binds the parameter $select +func (o *GetBlueprintVersionUsingGET1Params) bindParamDollarSelect(formats strfmt.Registry) []string { + dollarSelectIR := o.DollarSelect + + var dollarSelectIC []string + for _, dollarSelectIIR := range dollarSelectIR { // explode []string + + dollarSelectIIV := dollarSelectIIR // string as string + dollarSelectIC = append(dollarSelectIC, dollarSelectIIV) + } + + // items.CollectionFormat: "multi" + dollarSelectIS := swag.JoinByFormat(dollarSelectIC, "multi") + + return dollarSelectIS +} diff --git a/pkg/client/blueprint/get_blueprint_version_using_get1_responses.go b/pkg/client/blueprint/get_blueprint_version_using_get1_responses.go index 7c1b7a82..44f50398 100644 --- a/pkg/client/blueprint/get_blueprint_version_using_get1_responses.go +++ b/pkg/client/blueprint/get_blueprint_version_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintVersionUsingGET1Reader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintVersionUsingGET1OK() *GetBlueprintVersionUsingGET1OK { return &GetBlueprintVersionUsingGET1OK{} } -/*GetBlueprintVersionUsingGET1OK handles this case with default header values. +/* GetBlueprintVersionUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintVersionUsingGET1OK struct { func (o *GetBlueprintVersionUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions/{version}][%d] getBlueprintVersionUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintVersionUsingGET1OK) GetPayload() *models.BlueprintVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintVersionUsingGET1Unauthorized() *GetBlueprintVersionUsingGET1 return &GetBlueprintVersionUsingGET1Unauthorized{} } -/*GetBlueprintVersionUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintVersionUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintVersionUsingGET1Forbidden() *GetBlueprintVersionUsingGET1For return &GetBlueprintVersionUsingGET1Forbidden{} } -/*GetBlueprintVersionUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintVersionUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintVersionUsingGET1NotFound() *GetBlueprintVersionUsingGET1NotF return &GetBlueprintVersionUsingGET1NotFound{} } -/*GetBlueprintVersionUsingGET1NotFound handles this case with default header values. +/* GetBlueprintVersionUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintVersionUsingGET1NotFound struct { func (o *GetBlueprintVersionUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions/{version}][%d] getBlueprintVersionUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintVersionUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/list_blueprint_versions_using_get_parameters.go b/pkg/client/blueprint/list_blueprint_versions_using_get_parameters.go index f813d7cd..db1794dd 100644 --- a/pkg/client/blueprint/list_blueprint_versions_using_get_parameters.go +++ b/pkg/client/blueprint/list_blueprint_versions_using_get_parameters.go @@ -17,88 +17,100 @@ import ( "github.com/go-openapi/swag" ) -// NewListBlueprintVersionsUsingGETParams creates a new ListBlueprintVersionsUsingGETParams object -// with the default values initialized. +// NewListBlueprintVersionsUsingGETParams creates a new ListBlueprintVersionsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListBlueprintVersionsUsingGETParams() *ListBlueprintVersionsUsingGETParams { - var () return &ListBlueprintVersionsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewListBlueprintVersionsUsingGETParamsWithTimeout creates a new ListBlueprintVersionsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListBlueprintVersionsUsingGETParamsWithTimeout(timeout time.Duration) *ListBlueprintVersionsUsingGETParams { - var () return &ListBlueprintVersionsUsingGETParams{ - timeout: timeout, } } // NewListBlueprintVersionsUsingGETParamsWithContext creates a new ListBlueprintVersionsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListBlueprintVersionsUsingGETParamsWithContext(ctx context.Context) *ListBlueprintVersionsUsingGETParams { - var () return &ListBlueprintVersionsUsingGETParams{ - Context: ctx, } } // NewListBlueprintVersionsUsingGETParamsWithHTTPClient creates a new ListBlueprintVersionsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListBlueprintVersionsUsingGETParamsWithHTTPClient(client *http.Client) *ListBlueprintVersionsUsingGETParams { - var () return &ListBlueprintVersionsUsingGETParams{ HTTPClient: client, } } -/*ListBlueprintVersionsUsingGETParams contains all the parameters to send to the API endpoint -for the list blueprint versions using g e t operation typically these are written to a http.Request +/* ListBlueprintVersionsUsingGETParams contains all the parameters to send to the API endpoint + for the list blueprint versions using g e t operation. + + Typically these are written to a http.Request. */ type ListBlueprintVersionsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name, version. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name, version. */ DollarOrderby []string - /*DollarSelect - Fields to include in content. Use * to get all fields. + /* DollarSelect. + + Fields to include in content. Use * to get all fields. */ DollarSelect []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*Status - Filter by blueprint status: versioned / released + /* Status. + + Filter by blueprint status: versioned / released */ Status *string - /*Version - Filter by version + /* Version. + + Filter by version */ Version *string @@ -107,6 +119,21 @@ type ListBlueprintVersionsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list blueprint versions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintVersionsUsingGETParams) WithDefaults() *ListBlueprintVersionsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list blueprint versions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintVersionsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list blueprint versions using get params func (o *ListBlueprintVersionsUsingGETParams) WithTimeout(timeout time.Duration) *ListBlueprintVersionsUsingGETParams { o.SetTimeout(timeout) @@ -236,68 +263,77 @@ func (o *ListBlueprintVersionsUsingGETParams) WriteToRequest(r runtime.ClientReq } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } - valuesDollarSelect := o.DollarSelect + if o.DollarSelect != nil { - joinedDollarSelect := swag.JoinByFormat(valuesDollarSelect, "multi") - // query array param $select - if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { - return err + // binding items for $select + joinedDollarSelect := o.bindParamDollarSelect(reg) + + // query array param $select + if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId @@ -309,32 +345,34 @@ func (o *ListBlueprintVersionsUsingGETParams) WriteToRequest(r runtime.ClientReq // 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.Version != nil { // query param version var qrVersion string + if o.Version != nil { qrVersion = *o.Version } qVersion := qrVersion if qVersion != "" { + if err := r.SetQueryParam("version", qVersion); err != nil { return err } } - } if len(res) > 0 { @@ -342,3 +380,37 @@ func (o *ListBlueprintVersionsUsingGETParams) WriteToRequest(r runtime.ClientReq } return nil } + +// bindParamListBlueprintVersionsUsingGET binds the parameter $orderby +func (o *ListBlueprintVersionsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamListBlueprintVersionsUsingGET binds the parameter $select +func (o *ListBlueprintVersionsUsingGETParams) bindParamDollarSelect(formats strfmt.Registry) []string { + dollarSelectIR := o.DollarSelect + + var dollarSelectIC []string + for _, dollarSelectIIR := range dollarSelectIR { // explode []string + + dollarSelectIIV := dollarSelectIIR // string as string + dollarSelectIC = append(dollarSelectIC, dollarSelectIIV) + } + + // items.CollectionFormat: "multi" + dollarSelectIS := swag.JoinByFormat(dollarSelectIC, "multi") + + return dollarSelectIS +} diff --git a/pkg/client/blueprint/list_blueprint_versions_using_get_responses.go b/pkg/client/blueprint/list_blueprint_versions_using_get_responses.go index 8f0f5a36..1f86a453 100644 --- a/pkg/client/blueprint/list_blueprint_versions_using_get_responses.go +++ b/pkg/client/blueprint/list_blueprint_versions_using_get_responses.go @@ -53,7 +53,6 @@ func (o *ListBlueprintVersionsUsingGETReader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewListBlueprintVersionsUsingGETOK() *ListBlueprintVersionsUsingGETOK { return &ListBlueprintVersionsUsingGETOK{} } -/*ListBlueprintVersionsUsingGETOK handles this case with default header values. +/* ListBlueprintVersionsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -75,7 +74,6 @@ type ListBlueprintVersionsUsingGETOK struct { func (o *ListBlueprintVersionsUsingGETOK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions][%d] listBlueprintVersionsUsingGETOK %+v", 200, o.Payload) } - func (o *ListBlueprintVersionsUsingGETOK) GetPayload() *models.PageOfBlueprintVersion { return o.Payload } @@ -97,7 +95,7 @@ func NewListBlueprintVersionsUsingGETBadRequest() *ListBlueprintVersionsUsingGET return &ListBlueprintVersionsUsingGETBadRequest{} } -/*ListBlueprintVersionsUsingGETBadRequest handles this case with default header values. +/* ListBlueprintVersionsUsingGETBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,7 +106,6 @@ type ListBlueprintVersionsUsingGETBadRequest struct { func (o *ListBlueprintVersionsUsingGETBadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions][%d] listBlueprintVersionsUsingGETBadRequest %+v", 400, o.Payload) } - func (o *ListBlueprintVersionsUsingGETBadRequest) GetPayload() *models.Error { return o.Payload } @@ -130,7 +127,7 @@ func NewListBlueprintVersionsUsingGETUnauthorized() *ListBlueprintVersionsUsingG return &ListBlueprintVersionsUsingGETUnauthorized{} } -/*ListBlueprintVersionsUsingGETUnauthorized handles this case with default header values. +/* ListBlueprintVersionsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,7 +148,7 @@ func NewListBlueprintVersionsUsingGETForbidden() *ListBlueprintVersionsUsingGETF return &ListBlueprintVersionsUsingGETForbidden{} } -/*ListBlueprintVersionsUsingGETForbidden handles this case with default header values. +/* ListBlueprintVersionsUsingGETForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -172,7 +169,7 @@ func NewListBlueprintVersionsUsingGETNotFound() *ListBlueprintVersionsUsingGETNo return &ListBlueprintVersionsUsingGETNotFound{} } -/*ListBlueprintVersionsUsingGETNotFound handles this case with default header values. +/* ListBlueprintVersionsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -183,7 +180,6 @@ type ListBlueprintVersionsUsingGETNotFound struct { func (o *ListBlueprintVersionsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints/{blueprintId}/versions][%d] listBlueprintVersionsUsingGETNotFound %+v", 404, o.Payload) } - func (o *ListBlueprintVersionsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/list_blueprints_using_get1_parameters.go b/pkg/client/blueprint/list_blueprints_using_get1_parameters.go index b8aef4ea..dbd9a469 100644 --- a/pkg/client/blueprint/list_blueprints_using_get1_parameters.go +++ b/pkg/client/blueprint/list_blueprints_using_get1_parameters.go @@ -17,98 +17,110 @@ import ( "github.com/go-openapi/swag" ) -// NewListBlueprintsUsingGET1Params creates a new ListBlueprintsUsingGET1Params object -// with the default values initialized. +// NewListBlueprintsUsingGET1Params creates a new ListBlueprintsUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListBlueprintsUsingGET1Params() *ListBlueprintsUsingGET1Params { - var () return &ListBlueprintsUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewListBlueprintsUsingGET1ParamsWithTimeout creates a new ListBlueprintsUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListBlueprintsUsingGET1ParamsWithTimeout(timeout time.Duration) *ListBlueprintsUsingGET1Params { - var () return &ListBlueprintsUsingGET1Params{ - timeout: timeout, } } // NewListBlueprintsUsingGET1ParamsWithContext creates a new ListBlueprintsUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListBlueprintsUsingGET1ParamsWithContext(ctx context.Context) *ListBlueprintsUsingGET1Params { - var () return &ListBlueprintsUsingGET1Params{ - Context: ctx, } } // NewListBlueprintsUsingGET1ParamsWithHTTPClient creates a new ListBlueprintsUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListBlueprintsUsingGET1ParamsWithHTTPClient(client *http.Client) *ListBlueprintsUsingGET1Params { - var () return &ListBlueprintsUsingGET1Params{ HTTPClient: client, } } -/*ListBlueprintsUsingGET1Params contains all the parameters to send to the API endpoint -for the list blueprints using get1 operation typically these are written to a http.Request +/* ListBlueprintsUsingGET1Params contains all the parameters to send to the API endpoint + for the list blueprints using get1 operation. + + Typically these are written to a http.Request. */ type ListBlueprintsUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name. */ DollarOrderby []string - /*DollarSelect - Fields to include in content. Use * to get all fields. + /* DollarSelect. + + Fields to include in content. Use * to get all fields. */ DollarSelect []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Name - Filter by name + /* Name. + + Filter by name */ Name *string - /*Projects - A comma-separated list. Results must be associated with one of these project IDs. + /* Projects. + + A comma-separated list. Results must be associated with one of these project IDs. */ Projects []string - /*Released - Filter blueprints with at least one released version + /* Released. + + Filter blueprints with at least one released version */ Released *bool - /*Search - Search by name and description + /* Search. + + Search by name and description */ Search *string - /*Versioned - Filter blueprints with at least one version + /* Versioned. + + Filter blueprints with at least one version */ Versioned *bool @@ -117,6 +129,21 @@ type ListBlueprintsUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list blueprints using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintsUsingGET1Params) WithDefaults() *ListBlueprintsUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list blueprints using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintsUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list blueprints using get1 params func (o *ListBlueprintsUsingGET1Params) WithTimeout(timeout time.Duration) *ListBlueprintsUsingGET1Params { o.SetTimeout(timeout) @@ -268,140 +295,156 @@ func (o *ListBlueprintsUsingGET1Params) WriteToRequest(r runtime.ClientRequest, } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } - valuesDollarSelect := o.DollarSelect + if o.DollarSelect != nil { - joinedDollarSelect := swag.JoinByFormat(valuesDollarSelect, "multi") - // query array param $select - if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { - return err + // binding items for $select + joinedDollarSelect := o.bindParamDollarSelect(reg) + + // query array param $select + if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); 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 } } - } - valuesProjects := o.Projects + if o.Projects != nil { - joinedProjects := swag.JoinByFormat(valuesProjects, "multi") - // query array param projects - if err := r.SetQueryParam("projects", joinedProjects...); err != nil { - return err + // binding items for projects + joinedProjects := o.bindParamProjects(reg) + + // query array param projects + if err := r.SetQueryParam("projects", joinedProjects...); err != nil { + return err + } } if o.Released != nil { // query param released var qrReleased bool + if o.Released != nil { qrReleased = *o.Released } qReleased := swag.FormatBool(qrReleased) if qReleased != "" { + if err := r.SetQueryParam("released", qReleased); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if o.Versioned != nil { // query param versioned var qrVersioned bool + if o.Versioned != nil { qrVersioned = *o.Versioned } qVersioned := swag.FormatBool(qrVersioned) if qVersioned != "" { + if err := r.SetQueryParam("versioned", qVersioned); err != nil { return err } } - } if len(res) > 0 { @@ -409,3 +452,54 @@ func (o *ListBlueprintsUsingGET1Params) WriteToRequest(r runtime.ClientRequest, } return nil } + +// bindParamListBlueprintsUsingGET1 binds the parameter $orderby +func (o *ListBlueprintsUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamListBlueprintsUsingGET1 binds the parameter $select +func (o *ListBlueprintsUsingGET1Params) bindParamDollarSelect(formats strfmt.Registry) []string { + dollarSelectIR := o.DollarSelect + + var dollarSelectIC []string + for _, dollarSelectIIR := range dollarSelectIR { // explode []string + + dollarSelectIIV := dollarSelectIIR // string as string + dollarSelectIC = append(dollarSelectIC, dollarSelectIIV) + } + + // items.CollectionFormat: "multi" + dollarSelectIS := swag.JoinByFormat(dollarSelectIC, "multi") + + return dollarSelectIS +} + +// bindParamListBlueprintsUsingGET1 binds the parameter projects +func (o *ListBlueprintsUsingGET1Params) bindParamProjects(formats strfmt.Registry) []string { + projectsIR := o.Projects + + var projectsIC []string + for _, projectsIIR := range projectsIR { // explode []string + + projectsIIV := projectsIIR // string as string + projectsIC = append(projectsIC, projectsIIV) + } + + // items.CollectionFormat: "multi" + projectsIS := swag.JoinByFormat(projectsIC, "multi") + + return projectsIS +} diff --git a/pkg/client/blueprint/list_blueprints_using_get1_responses.go b/pkg/client/blueprint/list_blueprints_using_get1_responses.go index 40da2182..beeed121 100644 --- a/pkg/client/blueprint/list_blueprints_using_get1_responses.go +++ b/pkg/client/blueprint/list_blueprints_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *ListBlueprintsUsingGET1Reader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewListBlueprintsUsingGET1OK() *ListBlueprintsUsingGET1OK { return &ListBlueprintsUsingGET1OK{} } -/*ListBlueprintsUsingGET1OK handles this case with default header values. +/* ListBlueprintsUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ListBlueprintsUsingGET1OK struct { func (o *ListBlueprintsUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints][%d] listBlueprintsUsingGET1OK %+v", 200, o.Payload) } - func (o *ListBlueprintsUsingGET1OK) GetPayload() *models.PageOfBlueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewListBlueprintsUsingGET1BadRequest() *ListBlueprintsUsingGET1BadRequest { return &ListBlueprintsUsingGET1BadRequest{} } -/*ListBlueprintsUsingGET1BadRequest handles this case with default header values. +/* ListBlueprintsUsingGET1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type ListBlueprintsUsingGET1BadRequest struct { func (o *ListBlueprintsUsingGET1BadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprints][%d] listBlueprintsUsingGET1BadRequest %+v", 400, o.Payload) } - func (o *ListBlueprintsUsingGET1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewListBlueprintsUsingGET1Unauthorized() *ListBlueprintsUsingGET1Unauthoriz return &ListBlueprintsUsingGET1Unauthorized{} } -/*ListBlueprintsUsingGET1Unauthorized handles this case with default header values. +/* ListBlueprintsUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewListBlueprintsUsingGET1Forbidden() *ListBlueprintsUsingGET1Forbidden { return &ListBlueprintsUsingGET1Forbidden{} } -/*ListBlueprintsUsingGET1Forbidden handles this case with default header values. +/* ListBlueprintsUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint/release_blueprint_version_using_post1_parameters.go b/pkg/client/blueprint/release_blueprint_version_using_post1_parameters.go index 06ef3195..e080c4bc 100644 --- a/pkg/client/blueprint/release_blueprint_version_using_post1_parameters.go +++ b/pkg/client/blueprint/release_blueprint_version_using_post1_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewReleaseBlueprintVersionUsingPOST1Params creates a new ReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized. +// NewReleaseBlueprintVersionUsingPOST1Params creates a new ReleaseBlueprintVersionUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewReleaseBlueprintVersionUsingPOST1Params() *ReleaseBlueprintVersionUsingPOST1Params { - var () return &ReleaseBlueprintVersionUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewReleaseBlueprintVersionUsingPOST1ParamsWithTimeout creates a new ReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewReleaseBlueprintVersionUsingPOST1ParamsWithTimeout(timeout time.Duration) *ReleaseBlueprintVersionUsingPOST1Params { - var () return &ReleaseBlueprintVersionUsingPOST1Params{ - timeout: timeout, } } // NewReleaseBlueprintVersionUsingPOST1ParamsWithContext creates a new ReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewReleaseBlueprintVersionUsingPOST1ParamsWithContext(ctx context.Context) *ReleaseBlueprintVersionUsingPOST1Params { - var () return &ReleaseBlueprintVersionUsingPOST1Params{ - Context: ctx, } } // NewReleaseBlueprintVersionUsingPOST1ParamsWithHTTPClient creates a new ReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewReleaseBlueprintVersionUsingPOST1ParamsWithHTTPClient(client *http.Client) *ReleaseBlueprintVersionUsingPOST1Params { - var () return &ReleaseBlueprintVersionUsingPOST1Params{ HTTPClient: client, } } -/*ReleaseBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint -for the release blueprint version using p o s t 1 operation typically these are written to a http.Request +/* ReleaseBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint + for the release blueprint version using p o s t 1 operation. + + Typically these are written to a http.Request. */ type ReleaseBlueprintVersionUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*Version - version + /* Version. + + version */ Version string @@ -81,6 +84,21 @@ type ReleaseBlueprintVersionUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the release blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReleaseBlueprintVersionUsingPOST1Params) WithDefaults() *ReleaseBlueprintVersionUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the release blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReleaseBlueprintVersionUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the release blueprint version using p o s t 1 params func (o *ReleaseBlueprintVersionUsingPOST1Params) WithTimeout(timeout time.Duration) *ReleaseBlueprintVersionUsingPOST1Params { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *ReleaseBlueprintVersionUsingPOST1Params) WriteToRequest(r runtime.Clien // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/release_blueprint_version_using_post1_responses.go b/pkg/client/blueprint/release_blueprint_version_using_post1_responses.go index 9fe1dc7f..9135bf00 100644 --- a/pkg/client/blueprint/release_blueprint_version_using_post1_responses.go +++ b/pkg/client/blueprint/release_blueprint_version_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *ReleaseBlueprintVersionUsingPOST1Reader) ReadResponse(response runtime. return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewReleaseBlueprintVersionUsingPOST1OK() *ReleaseBlueprintVersionUsingPOST1 return &ReleaseBlueprintVersionUsingPOST1OK{} } -/*ReleaseBlueprintVersionUsingPOST1OK handles this case with default header values. +/* ReleaseBlueprintVersionUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ReleaseBlueprintVersionUsingPOST1OK struct { func (o *ReleaseBlueprintVersionUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/release][%d] releaseBlueprintVersionUsingPOST1OK %+v", 200, o.Payload) } - func (o *ReleaseBlueprintVersionUsingPOST1OK) GetPayload() *models.BlueprintVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewReleaseBlueprintVersionUsingPOST1Unauthorized() *ReleaseBlueprintVersion return &ReleaseBlueprintVersionUsingPOST1Unauthorized{} } -/*ReleaseBlueprintVersionUsingPOST1Unauthorized handles this case with default header values. +/* ReleaseBlueprintVersionUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewReleaseBlueprintVersionUsingPOST1Forbidden() *ReleaseBlueprintVersionUsi return &ReleaseBlueprintVersionUsingPOST1Forbidden{} } -/*ReleaseBlueprintVersionUsingPOST1Forbidden handles this case with default header values. +/* ReleaseBlueprintVersionUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewReleaseBlueprintVersionUsingPOST1NotFound() *ReleaseBlueprintVersionUsin return &ReleaseBlueprintVersionUsingPOST1NotFound{} } -/*ReleaseBlueprintVersionUsingPOST1NotFound handles this case with default header values. +/* ReleaseBlueprintVersionUsingPOST1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type ReleaseBlueprintVersionUsingPOST1NotFound struct { func (o *ReleaseBlueprintVersionUsingPOST1NotFound) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/release][%d] releaseBlueprintVersionUsingPOST1NotFound %+v", 404, o.Payload) } - func (o *ReleaseBlueprintVersionUsingPOST1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/restore_blueprint_version_using_post1_parameters.go b/pkg/client/blueprint/restore_blueprint_version_using_post1_parameters.go index b269ca83..5fcd6c60 100644 --- a/pkg/client/blueprint/restore_blueprint_version_using_post1_parameters.go +++ b/pkg/client/blueprint/restore_blueprint_version_using_post1_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRestoreBlueprintVersionUsingPOST1Params creates a new RestoreBlueprintVersionUsingPOST1Params object -// with the default values initialized. +// NewRestoreBlueprintVersionUsingPOST1Params creates a new RestoreBlueprintVersionUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRestoreBlueprintVersionUsingPOST1Params() *RestoreBlueprintVersionUsingPOST1Params { - var () return &RestoreBlueprintVersionUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewRestoreBlueprintVersionUsingPOST1ParamsWithTimeout creates a new RestoreBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRestoreBlueprintVersionUsingPOST1ParamsWithTimeout(timeout time.Duration) *RestoreBlueprintVersionUsingPOST1Params { - var () return &RestoreBlueprintVersionUsingPOST1Params{ - timeout: timeout, } } // NewRestoreBlueprintVersionUsingPOST1ParamsWithContext creates a new RestoreBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRestoreBlueprintVersionUsingPOST1ParamsWithContext(ctx context.Context) *RestoreBlueprintVersionUsingPOST1Params { - var () return &RestoreBlueprintVersionUsingPOST1Params{ - Context: ctx, } } // NewRestoreBlueprintVersionUsingPOST1ParamsWithHTTPClient creates a new RestoreBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRestoreBlueprintVersionUsingPOST1ParamsWithHTTPClient(client *http.Client) *RestoreBlueprintVersionUsingPOST1Params { - var () return &RestoreBlueprintVersionUsingPOST1Params{ HTTPClient: client, } } -/*RestoreBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint -for the restore blueprint version using p o s t 1 operation typically these are written to a http.Request +/* RestoreBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint + for the restore blueprint version using p o s t 1 operation. + + Typically these are written to a http.Request. */ type RestoreBlueprintVersionUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*Version - version + /* Version. + + version */ Version string @@ -81,6 +84,21 @@ type RestoreBlueprintVersionUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the restore blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestoreBlueprintVersionUsingPOST1Params) WithDefaults() *RestoreBlueprintVersionUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restore blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestoreBlueprintVersionUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the restore blueprint version using p o s t 1 params func (o *RestoreBlueprintVersionUsingPOST1Params) WithTimeout(timeout time.Duration) *RestoreBlueprintVersionUsingPOST1Params { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *RestoreBlueprintVersionUsingPOST1Params) WriteToRequest(r runtime.Clien // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/restore_blueprint_version_using_post1_responses.go b/pkg/client/blueprint/restore_blueprint_version_using_post1_responses.go index 1cd8db96..67840594 100644 --- a/pkg/client/blueprint/restore_blueprint_version_using_post1_responses.go +++ b/pkg/client/blueprint/restore_blueprint_version_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *RestoreBlueprintVersionUsingPOST1Reader) ReadResponse(response runtime. return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewRestoreBlueprintVersionUsingPOST1OK() *RestoreBlueprintVersionUsingPOST1 return &RestoreBlueprintVersionUsingPOST1OK{} } -/*RestoreBlueprintVersionUsingPOST1OK handles this case with default header values. +/* RestoreBlueprintVersionUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type RestoreBlueprintVersionUsingPOST1OK struct { func (o *RestoreBlueprintVersionUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/restore][%d] restoreBlueprintVersionUsingPOST1OK %+v", 200, o.Payload) } - func (o *RestoreBlueprintVersionUsingPOST1OK) GetPayload() *models.Blueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewRestoreBlueprintVersionUsingPOST1Unauthorized() *RestoreBlueprintVersion return &RestoreBlueprintVersionUsingPOST1Unauthorized{} } -/*RestoreBlueprintVersionUsingPOST1Unauthorized handles this case with default header values. +/* RestoreBlueprintVersionUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewRestoreBlueprintVersionUsingPOST1Forbidden() *RestoreBlueprintVersionUsi return &RestoreBlueprintVersionUsingPOST1Forbidden{} } -/*RestoreBlueprintVersionUsingPOST1Forbidden handles this case with default header values. +/* RestoreBlueprintVersionUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewRestoreBlueprintVersionUsingPOST1NotFound() *RestoreBlueprintVersionUsin return &RestoreBlueprintVersionUsingPOST1NotFound{} } -/*RestoreBlueprintVersionUsingPOST1NotFound handles this case with default header values. +/* RestoreBlueprintVersionUsingPOST1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type RestoreBlueprintVersionUsingPOST1NotFound struct { func (o *RestoreBlueprintVersionUsingPOST1NotFound) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/restore][%d] restoreBlueprintVersionUsingPOST1NotFound %+v", 404, o.Payload) } - func (o *RestoreBlueprintVersionUsingPOST1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/un_release_blueprint_version_using_post1_parameters.go b/pkg/client/blueprint/un_release_blueprint_version_using_post1_parameters.go index 04dbc446..6f4fdf81 100644 --- a/pkg/client/blueprint/un_release_blueprint_version_using_post1_parameters.go +++ b/pkg/client/blueprint/un_release_blueprint_version_using_post1_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUnReleaseBlueprintVersionUsingPOST1Params creates a new UnReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized. +// NewUnReleaseBlueprintVersionUsingPOST1Params creates a new UnReleaseBlueprintVersionUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUnReleaseBlueprintVersionUsingPOST1Params() *UnReleaseBlueprintVersionUsingPOST1Params { - var () return &UnReleaseBlueprintVersionUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewUnReleaseBlueprintVersionUsingPOST1ParamsWithTimeout creates a new UnReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUnReleaseBlueprintVersionUsingPOST1ParamsWithTimeout(timeout time.Duration) *UnReleaseBlueprintVersionUsingPOST1Params { - var () return &UnReleaseBlueprintVersionUsingPOST1Params{ - timeout: timeout, } } // NewUnReleaseBlueprintVersionUsingPOST1ParamsWithContext creates a new UnReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUnReleaseBlueprintVersionUsingPOST1ParamsWithContext(ctx context.Context) *UnReleaseBlueprintVersionUsingPOST1Params { - var () return &UnReleaseBlueprintVersionUsingPOST1Params{ - Context: ctx, } } // NewUnReleaseBlueprintVersionUsingPOST1ParamsWithHTTPClient creates a new UnReleaseBlueprintVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUnReleaseBlueprintVersionUsingPOST1ParamsWithHTTPClient(client *http.Client) *UnReleaseBlueprintVersionUsingPOST1Params { - var () return &UnReleaseBlueprintVersionUsingPOST1Params{ HTTPClient: client, } } -/*UnReleaseBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint -for the un release blueprint version using p o s t 1 operation typically these are written to a http.Request +/* UnReleaseBlueprintVersionUsingPOST1Params contains all the parameters to send to the API endpoint + for the un release blueprint version using p o s t 1 operation. + + Typically these are written to a http.Request. */ type UnReleaseBlueprintVersionUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID - /*Version - version + /* Version. + + version */ Version string @@ -81,6 +84,21 @@ type UnReleaseBlueprintVersionUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the un release blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnReleaseBlueprintVersionUsingPOST1Params) WithDefaults() *UnReleaseBlueprintVersionUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the un release blueprint version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnReleaseBlueprintVersionUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the un release blueprint version using p o s t 1 params func (o *UnReleaseBlueprintVersionUsingPOST1Params) WithTimeout(timeout time.Duration) *UnReleaseBlueprintVersionUsingPOST1Params { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *UnReleaseBlueprintVersionUsingPOST1Params) WriteToRequest(r runtime.Cli // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param blueprintId diff --git a/pkg/client/blueprint/un_release_blueprint_version_using_post1_responses.go b/pkg/client/blueprint/un_release_blueprint_version_using_post1_responses.go index 6cb5a172..d4716474 100644 --- a/pkg/client/blueprint/un_release_blueprint_version_using_post1_responses.go +++ b/pkg/client/blueprint/un_release_blueprint_version_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *UnReleaseBlueprintVersionUsingPOST1Reader) ReadResponse(response runtim return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewUnReleaseBlueprintVersionUsingPOST1OK() *UnReleaseBlueprintVersionUsingP return &UnReleaseBlueprintVersionUsingPOST1OK{} } -/*UnReleaseBlueprintVersionUsingPOST1OK handles this case with default header values. +/* UnReleaseBlueprintVersionUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type UnReleaseBlueprintVersionUsingPOST1OK struct { func (o *UnReleaseBlueprintVersionUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/unrelease][%d] unReleaseBlueprintVersionUsingPOST1OK %+v", 200, o.Payload) } - func (o *UnReleaseBlueprintVersionUsingPOST1OK) GetPayload() *models.BlueprintVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewUnReleaseBlueprintVersionUsingPOST1Unauthorized() *UnReleaseBlueprintVer return &UnReleaseBlueprintVersionUsingPOST1Unauthorized{} } -/*UnReleaseBlueprintVersionUsingPOST1Unauthorized handles this case with default header values. +/* UnReleaseBlueprintVersionUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewUnReleaseBlueprintVersionUsingPOST1Forbidden() *UnReleaseBlueprintVersio return &UnReleaseBlueprintVersionUsingPOST1Forbidden{} } -/*UnReleaseBlueprintVersionUsingPOST1Forbidden handles this case with default header values. +/* UnReleaseBlueprintVersionUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewUnReleaseBlueprintVersionUsingPOST1NotFound() *UnReleaseBlueprintVersion return &UnReleaseBlueprintVersionUsingPOST1NotFound{} } -/*UnReleaseBlueprintVersionUsingPOST1NotFound handles this case with default header values. +/* UnReleaseBlueprintVersionUsingPOST1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type UnReleaseBlueprintVersionUsingPOST1NotFound struct { func (o *UnReleaseBlueprintVersionUsingPOST1NotFound) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprints/{blueprintId}/versions/{version}/actions/unrelease][%d] unReleaseBlueprintVersionUsingPOST1NotFound %+v", 404, o.Payload) } - func (o *UnReleaseBlueprintVersionUsingPOST1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint/update_blueprint_using_put1_parameters.go b/pkg/client/blueprint/update_blueprint_using_put1_parameters.go index 6c7cb32e..141e2705 100644 --- a/pkg/client/blueprint/update_blueprint_using_put1_parameters.go +++ b/pkg/client/blueprint/update_blueprint_using_put1_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateBlueprintUsingPUT1Params creates a new UpdateBlueprintUsingPUT1Params object -// with the default values initialized. +// NewUpdateBlueprintUsingPUT1Params creates a new UpdateBlueprintUsingPUT1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateBlueprintUsingPUT1Params() *UpdateBlueprintUsingPUT1Params { - var () return &UpdateBlueprintUsingPUT1Params{ - timeout: cr.DefaultTimeout, } } // NewUpdateBlueprintUsingPUT1ParamsWithTimeout creates a new UpdateBlueprintUsingPUT1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateBlueprintUsingPUT1ParamsWithTimeout(timeout time.Duration) *UpdateBlueprintUsingPUT1Params { - var () return &UpdateBlueprintUsingPUT1Params{ - timeout: timeout, } } // NewUpdateBlueprintUsingPUT1ParamsWithContext creates a new UpdateBlueprintUsingPUT1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateBlueprintUsingPUT1ParamsWithContext(ctx context.Context) *UpdateBlueprintUsingPUT1Params { - var () return &UpdateBlueprintUsingPUT1Params{ - Context: ctx, } } // NewUpdateBlueprintUsingPUT1ParamsWithHTTPClient creates a new UpdateBlueprintUsingPUT1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateBlueprintUsingPUT1ParamsWithHTTPClient(client *http.Client) *UpdateBlueprintUsingPUT1Params { - var () return &UpdateBlueprintUsingPUT1Params{ HTTPClient: client, } } -/*UpdateBlueprintUsingPUT1Params contains all the parameters to send to the API endpoint -for the update blueprint using p u t 1 operation typically these are written to a http.Request +/* UpdateBlueprintUsingPUT1Params contains all the parameters to send to the API endpoint + for the update blueprint using p u t 1 operation. + + Typically these are written to a http.Request. */ type UpdateBlueprintUsingPUT1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Blueprint - Blueprint object + /* Blueprint. + + Blueprint object */ Blueprint *models.Blueprint - /*BlueprintID - blueprintId + /* BlueprintID. + + blueprintId + + Format: uuid */ BlueprintID strfmt.UUID @@ -83,6 +86,21 @@ type UpdateBlueprintUsingPUT1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update blueprint using p u t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBlueprintUsingPUT1Params) WithDefaults() *UpdateBlueprintUsingPUT1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update blueprint using p u t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBlueprintUsingPUT1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update blueprint using p u t 1 params func (o *UpdateBlueprintUsingPUT1Params) WithTimeout(timeout time.Duration) *UpdateBlueprintUsingPUT1Params { o.SetTimeout(timeout) @@ -161,18 +179,18 @@ func (o *UpdateBlueprintUsingPUT1Params) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Blueprint != nil { if err := r.SetBodyParam(o.Blueprint); err != nil { return err diff --git a/pkg/client/blueprint/update_blueprint_using_put1_responses.go b/pkg/client/blueprint/update_blueprint_using_put1_responses.go index bcdd5b19..2f52fd4f 100644 --- a/pkg/client/blueprint/update_blueprint_using_put1_responses.go +++ b/pkg/client/blueprint/update_blueprint_using_put1_responses.go @@ -47,7 +47,6 @@ func (o *UpdateBlueprintUsingPUT1Reader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewUpdateBlueprintUsingPUT1OK() *UpdateBlueprintUsingPUT1OK { return &UpdateBlueprintUsingPUT1OK{} } -/*UpdateBlueprintUsingPUT1OK handles this case with default header values. +/* UpdateBlueprintUsingPUT1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type UpdateBlueprintUsingPUT1OK struct { func (o *UpdateBlueprintUsingPUT1OK) Error() string { return fmt.Sprintf("[PUT /blueprint/api/blueprints/{blueprintId}][%d] updateBlueprintUsingPUT1OK %+v", 200, o.Payload) } - func (o *UpdateBlueprintUsingPUT1OK) GetPayload() *models.Blueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewUpdateBlueprintUsingPUT1Unauthorized() *UpdateBlueprintUsingPUT1Unauthor return &UpdateBlueprintUsingPUT1Unauthorized{} } -/*UpdateBlueprintUsingPUT1Unauthorized handles this case with default header values. +/* UpdateBlueprintUsingPUT1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewUpdateBlueprintUsingPUT1Forbidden() *UpdateBlueprintUsingPUT1Forbidden { return &UpdateBlueprintUsingPUT1Forbidden{} } -/*UpdateBlueprintUsingPUT1Forbidden handles this case with default header values. +/* UpdateBlueprintUsingPUT1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewUpdateBlueprintUsingPUT1NotFound() *UpdateBlueprintUsingPUT1NotFound { return &UpdateBlueprintUsingPUT1NotFound{} } -/*UpdateBlueprintUsingPUT1NotFound handles this case with default header values. +/* UpdateBlueprintUsingPUT1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type UpdateBlueprintUsingPUT1NotFound struct { func (o *UpdateBlueprintUsingPUT1NotFound) Error() string { return fmt.Sprintf("[PUT /blueprint/api/blueprints/{blueprintId}][%d] updateBlueprintUsingPUT1NotFound %+v", 404, o.Payload) } - func (o *UpdateBlueprintUsingPUT1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/blueprint_requests_client.go b/pkg/client/blueprint_requests/blueprint_requests_client.go index 6a2450db..3294bc22 100644 --- a/pkg/client/blueprint_requests/blueprint_requests_client.go +++ b/pkg/client/blueprint_requests/blueprint_requests_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestUsingPOSTParams) (*CancelBlueprintRequestUsingPOSTOK, error) + CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestUsingPOSTParams, opts ...ClientOption) (*CancelBlueprintRequestUsingPOSTOK, error) - CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequestUsingPOST1Params) (*CreateBlueprintRequestUsingPOST1Created, *CreateBlueprintRequestUsingPOST1Accepted, error) + CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequestUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintRequestUsingPOST1Created, *CreateBlueprintRequestUsingPOST1Accepted, error) - DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintRequestUsingDELETE1Params) (*DeleteBlueprintRequestUsingDELETE1NoContent, error) + DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintRequestUsingDELETE1Params, opts ...ClientOption) (*DeleteBlueprintRequestUsingDELETE1NoContent, error) - GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Params) (*GetBlueprintPlanUsingGET1OK, error) + GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Params, opts ...ClientOption) (*GetBlueprintPlanUsingGET1OK, error) - GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGET1Params) (*GetBlueprintRequestUsingGET1OK, error) + GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGET1Params, opts ...ClientOption) (*GetBlueprintRequestUsingGET1OK, error) - GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResourcesPlanUsingGET1Params) (*GetBlueprintResourcesPlanUsingGET1OK, error) + GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResourcesPlanUsingGET1Params, opts ...ClientOption) (*GetBlueprintResourcesPlanUsingGET1OK, error) - ListBlueprintRequestsUsingGET1(params *ListBlueprintRequestsUsingGET1Params) (*ListBlueprintRequestsUsingGET1OK, error) + ListBlueprintRequestsUsingGET1(params *ListBlueprintRequestsUsingGET1Params, opts ...ClientOption) (*ListBlueprintRequestsUsingGET1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +50,12 @@ type ClientService interface { /* CancelBlueprintRequestUsingPOST cancels request */ -func (a *Client) CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestUsingPOSTParams) (*CancelBlueprintRequestUsingPOSTOK, error) { +func (a *Client) CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestUsingPOSTParams, opts ...ClientOption) (*CancelBlueprintRequestUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCancelBlueprintRequestUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "cancelBlueprintRequestUsingPOST", Method: "POST", PathPattern: "/blueprint/api/blueprint-requests/{requestId}/actions/cancel", @@ -64,7 +66,12 @@ func (a *Client) CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestU Reader: &CancelBlueprintRequestUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) CancelBlueprintRequestUsingPOST(params *CancelBlueprintRequestU /* CreateBlueprintRequestUsingPOST1 creates a blueprint request */ -func (a *Client) CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequestUsingPOST1Params) (*CreateBlueprintRequestUsingPOST1Created, *CreateBlueprintRequestUsingPOST1Accepted, error) { +func (a *Client) CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequestUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintRequestUsingPOST1Created, *CreateBlueprintRequestUsingPOST1Accepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlueprintRequestUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlueprintRequestUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprint-requests", @@ -98,7 +104,12 @@ func (a *Client) CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequest Reader: &CreateBlueprintRequestUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -116,13 +127,12 @@ func (a *Client) CreateBlueprintRequestUsingPOST1(params *CreateBlueprintRequest /* DeleteBlueprintRequestUsingDELETE1 deletes request */ -func (a *Client) DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintRequestUsingDELETE1Params) (*DeleteBlueprintRequestUsingDELETE1NoContent, error) { +func (a *Client) DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintRequestUsingDELETE1Params, opts ...ClientOption) (*DeleteBlueprintRequestUsingDELETE1NoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteBlueprintRequestUsingDELETE1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteBlueprintRequestUsingDELETE_1", Method: "DELETE", PathPattern: "/blueprint/api/blueprint-requests/{requestId}", @@ -133,7 +143,12 @@ func (a *Client) DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintReque Reader: &DeleteBlueprintRequestUsingDELETE1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -150,13 +165,12 @@ func (a *Client) DeleteBlueprintRequestUsingDELETE1(params *DeleteBlueprintReque /* GetBlueprintPlanUsingGET1 returns request plan */ -func (a *Client) GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Params) (*GetBlueprintPlanUsingGET1OK, error) { +func (a *Client) GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Params, opts ...ClientOption) (*GetBlueprintPlanUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintPlanUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintPlanUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-requests/{requestId}/plan", @@ -167,7 +181,12 @@ func (a *Client) GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Para Reader: &GetBlueprintPlanUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -184,13 +203,12 @@ func (a *Client) GetBlueprintPlanUsingGET1(params *GetBlueprintPlanUsingGET1Para /* GetBlueprintRequestUsingGET1 returns blueprint request details */ -func (a *Client) GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGET1Params) (*GetBlueprintRequestUsingGET1OK, error) { +func (a *Client) GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGET1Params, opts ...ClientOption) (*GetBlueprintRequestUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintRequestUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintRequestUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-requests/{requestId}", @@ -201,7 +219,12 @@ func (a *Client) GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGE Reader: &GetBlueprintRequestUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -218,13 +241,12 @@ func (a *Client) GetBlueprintRequestUsingGET1(params *GetBlueprintRequestUsingGE /* GetBlueprintResourcesPlanUsingGET1 returns request resources plan */ -func (a *Client) GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResourcesPlanUsingGET1Params) (*GetBlueprintResourcesPlanUsingGET1OK, error) { +func (a *Client) GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResourcesPlanUsingGET1Params, opts ...ClientOption) (*GetBlueprintResourcesPlanUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlueprintResourcesPlanUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlueprintResourcesPlanUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-requests/{requestId}/resources-plan", @@ -235,7 +257,12 @@ func (a *Client) GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResource Reader: &GetBlueprintResourcesPlanUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -252,13 +279,12 @@ func (a *Client) GetBlueprintResourcesPlanUsingGET1(params *GetBlueprintResource /* ListBlueprintRequestsUsingGET1 lists blueprint requests */ -func (a *Client) ListBlueprintRequestsUsingGET1(params *ListBlueprintRequestsUsingGET1Params) (*ListBlueprintRequestsUsingGET1OK, error) { +func (a *Client) ListBlueprintRequestsUsingGET1(params *ListBlueprintRequestsUsingGET1Params, opts ...ClientOption) (*ListBlueprintRequestsUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewListBlueprintRequestsUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listBlueprintRequestsUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-requests", @@ -269,7 +295,12 @@ func (a *Client) ListBlueprintRequestsUsingGET1(params *ListBlueprintRequestsUsi Reader: &ListBlueprintRequestsUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_parameters.go b/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_parameters.go index 1452e9b1..9f4ef07c 100644 --- a/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_parameters.go +++ b/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_parameters.go @@ -17,75 +17,68 @@ import ( "github.com/go-openapi/swag" ) -// NewCancelBlueprintRequestUsingPOSTParams creates a new CancelBlueprintRequestUsingPOSTParams object -// with the default values initialized. +// NewCancelBlueprintRequestUsingPOSTParams creates a new CancelBlueprintRequestUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCancelBlueprintRequestUsingPOSTParams() *CancelBlueprintRequestUsingPOSTParams { - var ( - forceDefault = bool(true) - ) return &CancelBlueprintRequestUsingPOSTParams{ - Force: &forceDefault, - timeout: cr.DefaultTimeout, } } // NewCancelBlueprintRequestUsingPOSTParamsWithTimeout creates a new CancelBlueprintRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCancelBlueprintRequestUsingPOSTParamsWithTimeout(timeout time.Duration) *CancelBlueprintRequestUsingPOSTParams { - var ( - forceDefault = bool(true) - ) return &CancelBlueprintRequestUsingPOSTParams{ - Force: &forceDefault, - timeout: timeout, } } // NewCancelBlueprintRequestUsingPOSTParamsWithContext creates a new CancelBlueprintRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCancelBlueprintRequestUsingPOSTParamsWithContext(ctx context.Context) *CancelBlueprintRequestUsingPOSTParams { - var ( - forceDefault = bool(true) - ) return &CancelBlueprintRequestUsingPOSTParams{ - Force: &forceDefault, - Context: ctx, } } // NewCancelBlueprintRequestUsingPOSTParamsWithHTTPClient creates a new CancelBlueprintRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCancelBlueprintRequestUsingPOSTParamsWithHTTPClient(client *http.Client) *CancelBlueprintRequestUsingPOSTParams { - var ( - forceDefault = bool(true) - ) return &CancelBlueprintRequestUsingPOSTParams{ - Force: &forceDefault, HTTPClient: client, } } -/*CancelBlueprintRequestUsingPOSTParams contains all the parameters to send to the API endpoint -for the cancel blueprint request using p o s t operation typically these are written to a http.Request +/* CancelBlueprintRequestUsingPOSTParams contains all the parameters to send to the API endpoint + for the cancel blueprint request using p o s t operation. + + Typically these are written to a http.Request. */ type CancelBlueprintRequestUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Force - Force cancellation of in progress tasks + /* Force. + + Force cancellation of in progress tasks + + Default: true */ Force *bool - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -94,6 +87,32 @@ type CancelBlueprintRequestUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the cancel blueprint request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CancelBlueprintRequestUsingPOSTParams) WithDefaults() *CancelBlueprintRequestUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the cancel blueprint request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CancelBlueprintRequestUsingPOSTParams) SetDefaults() { + var ( + forceDefault = bool(true) + ) + + val := CancelBlueprintRequestUsingPOSTParams{ + Force: &forceDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the cancel blueprint request using p o s t params func (o *CancelBlueprintRequestUsingPOSTParams) WithTimeout(timeout time.Duration) *CancelBlueprintRequestUsingPOSTParams { o.SetTimeout(timeout) @@ -172,32 +191,34 @@ func (o *CancelBlueprintRequestUsingPOSTParams) WriteToRequest(r runtime.ClientR // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Force != nil { // query param force var qrForce bool + if o.Force != nil { qrForce = *o.Force } qForce := swag.FormatBool(qrForce) if qForce != "" { + if err := r.SetQueryParam("force", qForce); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_responses.go b/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_responses.go index 308147c1..cbad12e6 100644 --- a/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_responses.go +++ b/pkg/client/blueprint_requests/cancel_blueprint_request_using_post_responses.go @@ -47,7 +47,6 @@ func (o *CancelBlueprintRequestUsingPOSTReader) ReadResponse(response runtime.Cl return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCancelBlueprintRequestUsingPOSTOK() *CancelBlueprintRequestUsingPOSTOK { return &CancelBlueprintRequestUsingPOSTOK{} } -/*CancelBlueprintRequestUsingPOSTOK handles this case with default header values. +/* CancelBlueprintRequestUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -79,7 +78,7 @@ func NewCancelBlueprintRequestUsingPOSTUnauthorized() *CancelBlueprintRequestUsi return &CancelBlueprintRequestUsingPOSTUnauthorized{} } -/*CancelBlueprintRequestUsingPOSTUnauthorized handles this case with default header values. +/* CancelBlueprintRequestUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -100,7 +99,7 @@ func NewCancelBlueprintRequestUsingPOSTForbidden() *CancelBlueprintRequestUsingP return &CancelBlueprintRequestUsingPOSTForbidden{} } -/*CancelBlueprintRequestUsingPOSTForbidden handles this case with default header values. +/* CancelBlueprintRequestUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -121,7 +120,7 @@ func NewCancelBlueprintRequestUsingPOSTNotFound() *CancelBlueprintRequestUsingPO return &CancelBlueprintRequestUsingPOSTNotFound{} } -/*CancelBlueprintRequestUsingPOSTNotFound handles this case with default header values. +/* CancelBlueprintRequestUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type CancelBlueprintRequestUsingPOSTNotFound struct { func (o *CancelBlueprintRequestUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-requests/{requestId}/actions/cancel][%d] cancelBlueprintRequestUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *CancelBlueprintRequestUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/create_blueprint_request_using_post1_parameters.go b/pkg/client/blueprint_requests/create_blueprint_request_using_post1_parameters.go index 92ab5806..98608b08 100644 --- a/pkg/client/blueprint_requests/create_blueprint_request_using_post1_parameters.go +++ b/pkg/client/blueprint_requests/create_blueprint_request_using_post1_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlueprintRequestUsingPOST1Params creates a new CreateBlueprintRequestUsingPOST1Params object -// with the default values initialized. +// NewCreateBlueprintRequestUsingPOST1Params creates a new CreateBlueprintRequestUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlueprintRequestUsingPOST1Params() *CreateBlueprintRequestUsingPOST1Params { - var () return &CreateBlueprintRequestUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateBlueprintRequestUsingPOST1ParamsWithTimeout creates a new CreateBlueprintRequestUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlueprintRequestUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateBlueprintRequestUsingPOST1Params { - var () return &CreateBlueprintRequestUsingPOST1Params{ - timeout: timeout, } } // NewCreateBlueprintRequestUsingPOST1ParamsWithContext creates a new CreateBlueprintRequestUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlueprintRequestUsingPOST1ParamsWithContext(ctx context.Context) *CreateBlueprintRequestUsingPOST1Params { - var () return &CreateBlueprintRequestUsingPOST1Params{ - Context: ctx, } } // NewCreateBlueprintRequestUsingPOST1ParamsWithHTTPClient creates a new CreateBlueprintRequestUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlueprintRequestUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateBlueprintRequestUsingPOST1Params { - var () return &CreateBlueprintRequestUsingPOST1Params{ HTTPClient: client, } } -/*CreateBlueprintRequestUsingPOST1Params contains all the parameters to send to the API endpoint -for the create blueprint request using p o s t 1 operation typically these are written to a http.Request +/* CreateBlueprintRequestUsingPOST1Params contains all the parameters to send to the API endpoint + for the create blueprint request using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateBlueprintRequestUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Request - request + /* Request. + + request */ Request *models.BlueprintRequest @@ -78,6 +78,21 @@ type CreateBlueprintRequestUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create blueprint request using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintRequestUsingPOST1Params) WithDefaults() *CreateBlueprintRequestUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create blueprint request using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintRequestUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create blueprint request using p o s t 1 params func (o *CreateBlueprintRequestUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateBlueprintRequestUsingPOST1Params { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateBlueprintRequestUsingPOST1Params) WriteToRequest(r runtime.Client // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/blueprint_requests/create_blueprint_request_using_post1_responses.go b/pkg/client/blueprint_requests/create_blueprint_request_using_post1_responses.go index 60932a50..17028066 100644 --- a/pkg/client/blueprint_requests/create_blueprint_request_using_post1_responses.go +++ b/pkg/client/blueprint_requests/create_blueprint_request_using_post1_responses.go @@ -53,7 +53,6 @@ func (o *CreateBlueprintRequestUsingPOST1Reader) ReadResponse(response runtime.C return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewCreateBlueprintRequestUsingPOST1Created() *CreateBlueprintRequestUsingPO return &CreateBlueprintRequestUsingPOST1Created{} } -/*CreateBlueprintRequestUsingPOST1Created handles this case with default header values. +/* CreateBlueprintRequestUsingPOST1Created describes a response with status code 201, with default header values. Created */ @@ -75,7 +74,6 @@ type CreateBlueprintRequestUsingPOST1Created struct { func (o *CreateBlueprintRequestUsingPOST1Created) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-requests][%d] createBlueprintRequestUsingPOST1Created %+v", 201, o.Payload) } - func (o *CreateBlueprintRequestUsingPOST1Created) GetPayload() *models.BlueprintRequest { return o.Payload } @@ -97,7 +95,7 @@ func NewCreateBlueprintRequestUsingPOST1Accepted() *CreateBlueprintRequestUsingP return &CreateBlueprintRequestUsingPOST1Accepted{} } -/*CreateBlueprintRequestUsingPOST1Accepted handles this case with default header values. +/* CreateBlueprintRequestUsingPOST1Accepted describes a response with status code 202, with default header values. Accepted */ @@ -108,7 +106,6 @@ type CreateBlueprintRequestUsingPOST1Accepted struct { func (o *CreateBlueprintRequestUsingPOST1Accepted) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-requests][%d] createBlueprintRequestUsingPOST1Accepted %+v", 202, o.Payload) } - func (o *CreateBlueprintRequestUsingPOST1Accepted) GetPayload() *models.BlueprintRequest { return o.Payload } @@ -130,7 +127,7 @@ func NewCreateBlueprintRequestUsingPOST1BadRequest() *CreateBlueprintRequestUsin return &CreateBlueprintRequestUsingPOST1BadRequest{} } -/*CreateBlueprintRequestUsingPOST1BadRequest handles this case with default header values. +/* CreateBlueprintRequestUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -141,7 +138,6 @@ type CreateBlueprintRequestUsingPOST1BadRequest struct { func (o *CreateBlueprintRequestUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-requests][%d] createBlueprintRequestUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateBlueprintRequestUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -163,7 +159,7 @@ func NewCreateBlueprintRequestUsingPOST1Unauthorized() *CreateBlueprintRequestUs return &CreateBlueprintRequestUsingPOST1Unauthorized{} } -/*CreateBlueprintRequestUsingPOST1Unauthorized handles this case with default header values. +/* CreateBlueprintRequestUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -184,7 +180,7 @@ func NewCreateBlueprintRequestUsingPOST1Forbidden() *CreateBlueprintRequestUsing return &CreateBlueprintRequestUsingPOST1Forbidden{} } -/*CreateBlueprintRequestUsingPOST1Forbidden handles this case with default header values. +/* CreateBlueprintRequestUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_parameters.go b/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_parameters.go index 20970a7e..f8a2078c 100644 --- a/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_parameters.go +++ b/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteBlueprintRequestUsingDELETE1Params creates a new DeleteBlueprintRequestUsingDELETE1Params object -// with the default values initialized. +// NewDeleteBlueprintRequestUsingDELETE1Params creates a new DeleteBlueprintRequestUsingDELETE1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteBlueprintRequestUsingDELETE1Params() *DeleteBlueprintRequestUsingDELETE1Params { - var () return &DeleteBlueprintRequestUsingDELETE1Params{ - timeout: cr.DefaultTimeout, } } // NewDeleteBlueprintRequestUsingDELETE1ParamsWithTimeout creates a new DeleteBlueprintRequestUsingDELETE1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteBlueprintRequestUsingDELETE1ParamsWithTimeout(timeout time.Duration) *DeleteBlueprintRequestUsingDELETE1Params { - var () return &DeleteBlueprintRequestUsingDELETE1Params{ - timeout: timeout, } } // NewDeleteBlueprintRequestUsingDELETE1ParamsWithContext creates a new DeleteBlueprintRequestUsingDELETE1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteBlueprintRequestUsingDELETE1ParamsWithContext(ctx context.Context) *DeleteBlueprintRequestUsingDELETE1Params { - var () return &DeleteBlueprintRequestUsingDELETE1Params{ - Context: ctx, } } // NewDeleteBlueprintRequestUsingDELETE1ParamsWithHTTPClient creates a new DeleteBlueprintRequestUsingDELETE1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteBlueprintRequestUsingDELETE1ParamsWithHTTPClient(client *http.Client) *DeleteBlueprintRequestUsingDELETE1Params { - var () return &DeleteBlueprintRequestUsingDELETE1Params{ HTTPClient: client, } } -/*DeleteBlueprintRequestUsingDELETE1Params contains all the parameters to send to the API endpoint -for the delete blueprint request using d e l e t e 1 operation typically these are written to a http.Request +/* DeleteBlueprintRequestUsingDELETE1Params contains all the parameters to send to the API endpoint + for the delete blueprint request using d e l e t e 1 operation. + + Typically these are written to a http.Request. */ type DeleteBlueprintRequestUsingDELETE1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Force - Force delete if not in final stage + /* Force. + + Force delete if not in final stage */ Force *bool - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -82,6 +85,21 @@ type DeleteBlueprintRequestUsingDELETE1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete blueprint request using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlueprintRequestUsingDELETE1Params) WithDefaults() *DeleteBlueprintRequestUsingDELETE1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete blueprint request using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlueprintRequestUsingDELETE1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete blueprint request using d e l e t e 1 params func (o *DeleteBlueprintRequestUsingDELETE1Params) WithTimeout(timeout time.Duration) *DeleteBlueprintRequestUsingDELETE1Params { o.SetTimeout(timeout) @@ -160,32 +178,34 @@ func (o *DeleteBlueprintRequestUsingDELETE1Params) WriteToRequest(r runtime.Clie // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Force != nil { // query param force var qrForce bool + if o.Force != nil { qrForce = *o.Force } qForce := swag.FormatBool(qrForce) if qForce != "" { + if err := r.SetQueryParam("force", qForce); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_responses.go b/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_responses.go index c4a5265e..3fee387f 100644 --- a/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_responses.go +++ b/pkg/client/blueprint_requests/delete_blueprint_request_using_delete1_responses.go @@ -47,7 +47,6 @@ func (o *DeleteBlueprintRequestUsingDELETE1Reader) ReadResponse(response runtime return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeleteBlueprintRequestUsingDELETE1NoContent() *DeleteBlueprintRequestUsi return &DeleteBlueprintRequestUsingDELETE1NoContent{} } -/*DeleteBlueprintRequestUsingDELETE1NoContent handles this case with default header values. +/* DeleteBlueprintRequestUsingDELETE1NoContent describes a response with status code 204, with default header values. No Content */ @@ -79,7 +78,7 @@ func NewDeleteBlueprintRequestUsingDELETE1Unauthorized() *DeleteBlueprintRequest return &DeleteBlueprintRequestUsingDELETE1Unauthorized{} } -/*DeleteBlueprintRequestUsingDELETE1Unauthorized handles this case with default header values. +/* DeleteBlueprintRequestUsingDELETE1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -100,7 +99,7 @@ func NewDeleteBlueprintRequestUsingDELETE1Forbidden() *DeleteBlueprintRequestUsi return &DeleteBlueprintRequestUsingDELETE1Forbidden{} } -/*DeleteBlueprintRequestUsingDELETE1Forbidden handles this case with default header values. +/* DeleteBlueprintRequestUsingDELETE1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -121,7 +120,7 @@ func NewDeleteBlueprintRequestUsingDELETE1NotFound() *DeleteBlueprintRequestUsin return &DeleteBlueprintRequestUsingDELETE1NotFound{} } -/*DeleteBlueprintRequestUsingDELETE1NotFound handles this case with default header values. +/* DeleteBlueprintRequestUsingDELETE1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type DeleteBlueprintRequestUsingDELETE1NotFound struct { func (o *DeleteBlueprintRequestUsingDELETE1NotFound) Error() string { return fmt.Sprintf("[DELETE /blueprint/api/blueprint-requests/{requestId}][%d] deleteBlueprintRequestUsingDELETE1NotFound %+v", 404, o.Payload) } - func (o *DeleteBlueprintRequestUsingDELETE1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_parameters.go b/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_parameters.go index c2c9b510..01118c19 100644 --- a/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_parameters.go +++ b/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetBlueprintPlanUsingGET1Params creates a new GetBlueprintPlanUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintPlanUsingGET1Params creates a new GetBlueprintPlanUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintPlanUsingGET1Params() *GetBlueprintPlanUsingGET1Params { - var () return &GetBlueprintPlanUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintPlanUsingGET1ParamsWithTimeout creates a new GetBlueprintPlanUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintPlanUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintPlanUsingGET1Params { - var () return &GetBlueprintPlanUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintPlanUsingGET1ParamsWithContext creates a new GetBlueprintPlanUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintPlanUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintPlanUsingGET1Params { - var () return &GetBlueprintPlanUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintPlanUsingGET1ParamsWithHTTPClient creates a new GetBlueprintPlanUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintPlanUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintPlanUsingGET1Params { - var () return &GetBlueprintPlanUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintPlanUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint plan using get1 operation typically these are written to a http.Request +/* GetBlueprintPlanUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint plan using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintPlanUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Expand - Detailed plan + /* Expand. + + Detailed plan */ Expand *bool - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -82,6 +85,21 @@ type GetBlueprintPlanUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint plan using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintPlanUsingGET1Params) WithDefaults() *GetBlueprintPlanUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint plan using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintPlanUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint plan using get1 params func (o *GetBlueprintPlanUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintPlanUsingGET1Params { o.SetTimeout(timeout) @@ -160,32 +178,34 @@ func (o *GetBlueprintPlanUsingGET1Params) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Expand != nil { // query param expand var qrExpand bool + if o.Expand != nil { qrExpand = *o.Expand } qExpand := swag.FormatBool(qrExpand) if qExpand != "" { + if err := r.SetQueryParam("expand", qExpand); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_responses.go b/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_responses.go index 46f97ac2..bc5a01ad 100644 --- a/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_responses.go +++ b/pkg/client/blueprint_requests/get_blueprint_plan_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintPlanUsingGET1Reader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintPlanUsingGET1OK() *GetBlueprintPlanUsingGET1OK { return &GetBlueprintPlanUsingGET1OK{} } -/*GetBlueprintPlanUsingGET1OK handles this case with default header values. +/* GetBlueprintPlanUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintPlanUsingGET1OK struct { func (o *GetBlueprintPlanUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}/plan][%d] getBlueprintPlanUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintPlanUsingGET1OK) GetPayload() *models.BlueprintPlan { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintPlanUsingGET1Unauthorized() *GetBlueprintPlanUsingGET1Unauth return &GetBlueprintPlanUsingGET1Unauthorized{} } -/*GetBlueprintPlanUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintPlanUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintPlanUsingGET1Forbidden() *GetBlueprintPlanUsingGET1Forbidden return &GetBlueprintPlanUsingGET1Forbidden{} } -/*GetBlueprintPlanUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintPlanUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintPlanUsingGET1NotFound() *GetBlueprintPlanUsingGET1NotFound { return &GetBlueprintPlanUsingGET1NotFound{} } -/*GetBlueprintPlanUsingGET1NotFound handles this case with default header values. +/* GetBlueprintPlanUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintPlanUsingGET1NotFound struct { func (o *GetBlueprintPlanUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}/plan][%d] getBlueprintPlanUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintPlanUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/get_blueprint_request_using_get1_parameters.go b/pkg/client/blueprint_requests/get_blueprint_request_using_get1_parameters.go index b6b712a9..46f077c1 100644 --- a/pkg/client/blueprint_requests/get_blueprint_request_using_get1_parameters.go +++ b/pkg/client/blueprint_requests/get_blueprint_request_using_get1_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetBlueprintRequestUsingGET1Params creates a new GetBlueprintRequestUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintRequestUsingGET1Params creates a new GetBlueprintRequestUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintRequestUsingGET1Params() *GetBlueprintRequestUsingGET1Params { - var () return &GetBlueprintRequestUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintRequestUsingGET1ParamsWithTimeout creates a new GetBlueprintRequestUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintRequestUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintRequestUsingGET1Params { - var () return &GetBlueprintRequestUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintRequestUsingGET1ParamsWithContext creates a new GetBlueprintRequestUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintRequestUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintRequestUsingGET1Params { - var () return &GetBlueprintRequestUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintRequestUsingGET1ParamsWithHTTPClient creates a new GetBlueprintRequestUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintRequestUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintRequestUsingGET1Params { - var () return &GetBlueprintRequestUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintRequestUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint request using get1 operation typically these are written to a http.Request +/* GetBlueprintRequestUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint request using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintRequestUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -76,6 +78,21 @@ type GetBlueprintRequestUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint request using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintRequestUsingGET1Params) WithDefaults() *GetBlueprintRequestUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint request using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintRequestUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint request using get1 params func (o *GetBlueprintRequestUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintRequestUsingGET1Params { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetBlueprintRequestUsingGET1Params) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/blueprint_requests/get_blueprint_request_using_get1_responses.go b/pkg/client/blueprint_requests/get_blueprint_request_using_get1_responses.go index d026ac67..81da3d76 100644 --- a/pkg/client/blueprint_requests/get_blueprint_request_using_get1_responses.go +++ b/pkg/client/blueprint_requests/get_blueprint_request_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintRequestUsingGET1Reader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintRequestUsingGET1OK() *GetBlueprintRequestUsingGET1OK { return &GetBlueprintRequestUsingGET1OK{} } -/*GetBlueprintRequestUsingGET1OK handles this case with default header values. +/* GetBlueprintRequestUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintRequestUsingGET1OK struct { func (o *GetBlueprintRequestUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}][%d] getBlueprintRequestUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintRequestUsingGET1OK) GetPayload() *models.BlueprintRequest { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintRequestUsingGET1Unauthorized() *GetBlueprintRequestUsingGET1 return &GetBlueprintRequestUsingGET1Unauthorized{} } -/*GetBlueprintRequestUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintRequestUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintRequestUsingGET1Forbidden() *GetBlueprintRequestUsingGET1For return &GetBlueprintRequestUsingGET1Forbidden{} } -/*GetBlueprintRequestUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintRequestUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintRequestUsingGET1NotFound() *GetBlueprintRequestUsingGET1NotF return &GetBlueprintRequestUsingGET1NotFound{} } -/*GetBlueprintRequestUsingGET1NotFound handles this case with default header values. +/* GetBlueprintRequestUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintRequestUsingGET1NotFound struct { func (o *GetBlueprintRequestUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}][%d] getBlueprintRequestUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintRequestUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_parameters.go b/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_parameters.go index ac0487b8..4c96fade 100644 --- a/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_parameters.go +++ b/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetBlueprintResourcesPlanUsingGET1Params creates a new GetBlueprintResourcesPlanUsingGET1Params object -// with the default values initialized. +// NewGetBlueprintResourcesPlanUsingGET1Params creates a new GetBlueprintResourcesPlanUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlueprintResourcesPlanUsingGET1Params() *GetBlueprintResourcesPlanUsingGET1Params { - var () return &GetBlueprintResourcesPlanUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetBlueprintResourcesPlanUsingGET1ParamsWithTimeout creates a new GetBlueprintResourcesPlanUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlueprintResourcesPlanUsingGET1ParamsWithTimeout(timeout time.Duration) *GetBlueprintResourcesPlanUsingGET1Params { - var () return &GetBlueprintResourcesPlanUsingGET1Params{ - timeout: timeout, } } // NewGetBlueprintResourcesPlanUsingGET1ParamsWithContext creates a new GetBlueprintResourcesPlanUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlueprintResourcesPlanUsingGET1ParamsWithContext(ctx context.Context) *GetBlueprintResourcesPlanUsingGET1Params { - var () return &GetBlueprintResourcesPlanUsingGET1Params{ - Context: ctx, } } // NewGetBlueprintResourcesPlanUsingGET1ParamsWithHTTPClient creates a new GetBlueprintResourcesPlanUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlueprintResourcesPlanUsingGET1ParamsWithHTTPClient(client *http.Client) *GetBlueprintResourcesPlanUsingGET1Params { - var () return &GetBlueprintResourcesPlanUsingGET1Params{ HTTPClient: client, } } -/*GetBlueprintResourcesPlanUsingGET1Params contains all the parameters to send to the API endpoint -for the get blueprint resources plan using get1 operation typically these are written to a http.Request +/* GetBlueprintResourcesPlanUsingGET1Params contains all the parameters to send to the API endpoint + for the get blueprint resources plan using get1 operation. + + Typically these are written to a http.Request. */ type GetBlueprintResourcesPlanUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Expand - Detailed plan + /* Expand. + + Detailed plan */ Expand *bool - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -82,6 +85,21 @@ type GetBlueprintResourcesPlanUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get blueprint resources plan using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintResourcesPlanUsingGET1Params) WithDefaults() *GetBlueprintResourcesPlanUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get blueprint resources plan using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlueprintResourcesPlanUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get blueprint resources plan using get1 params func (o *GetBlueprintResourcesPlanUsingGET1Params) WithTimeout(timeout time.Duration) *GetBlueprintResourcesPlanUsingGET1Params { o.SetTimeout(timeout) @@ -160,32 +178,34 @@ func (o *GetBlueprintResourcesPlanUsingGET1Params) WriteToRequest(r runtime.Clie // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Expand != nil { // query param expand var qrExpand bool + if o.Expand != nil { qrExpand = *o.Expand } qExpand := swag.FormatBool(qrExpand) if qExpand != "" { + if err := r.SetQueryParam("expand", qExpand); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_responses.go b/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_responses.go index dcaefb7b..f62e35e4 100644 --- a/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_responses.go +++ b/pkg/client/blueprint_requests/get_blueprint_resources_plan_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetBlueprintResourcesPlanUsingGET1Reader) ReadResponse(response runtime return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetBlueprintResourcesPlanUsingGET1OK() *GetBlueprintResourcesPlanUsingGE return &GetBlueprintResourcesPlanUsingGET1OK{} } -/*GetBlueprintResourcesPlanUsingGET1OK handles this case with default header values. +/* GetBlueprintResourcesPlanUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetBlueprintResourcesPlanUsingGET1OK struct { func (o *GetBlueprintResourcesPlanUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}/resources-plan][%d] getBlueprintResourcesPlanUsingGET1OK %+v", 200, o.Payload) } - func (o *GetBlueprintResourcesPlanUsingGET1OK) GetPayload() *models.BlueprintResourcesPlan { return o.Payload } @@ -91,7 +89,7 @@ func NewGetBlueprintResourcesPlanUsingGET1Unauthorized() *GetBlueprintResourcesP return &GetBlueprintResourcesPlanUsingGET1Unauthorized{} } -/*GetBlueprintResourcesPlanUsingGET1Unauthorized handles this case with default header values. +/* GetBlueprintResourcesPlanUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetBlueprintResourcesPlanUsingGET1Forbidden() *GetBlueprintResourcesPlan return &GetBlueprintResourcesPlanUsingGET1Forbidden{} } -/*GetBlueprintResourcesPlanUsingGET1Forbidden handles this case with default header values. +/* GetBlueprintResourcesPlanUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetBlueprintResourcesPlanUsingGET1NotFound() *GetBlueprintResourcesPlanU return &GetBlueprintResourcesPlanUsingGET1NotFound{} } -/*GetBlueprintResourcesPlanUsingGET1NotFound handles this case with default header values. +/* GetBlueprintResourcesPlanUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetBlueprintResourcesPlanUsingGET1NotFound struct { func (o *GetBlueprintResourcesPlanUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests/{requestId}/resources-plan][%d] getBlueprintResourcesPlanUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetBlueprintResourcesPlanUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_parameters.go b/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_parameters.go index 4187fced..cc0806f0 100644 --- a/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_parameters.go +++ b/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_parameters.go @@ -17,83 +17,92 @@ import ( "github.com/go-openapi/swag" ) -// NewListBlueprintRequestsUsingGET1Params creates a new ListBlueprintRequestsUsingGET1Params object -// with the default values initialized. +// NewListBlueprintRequestsUsingGET1Params creates a new ListBlueprintRequestsUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListBlueprintRequestsUsingGET1Params() *ListBlueprintRequestsUsingGET1Params { - var () return &ListBlueprintRequestsUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewListBlueprintRequestsUsingGET1ParamsWithTimeout creates a new ListBlueprintRequestsUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListBlueprintRequestsUsingGET1ParamsWithTimeout(timeout time.Duration) *ListBlueprintRequestsUsingGET1Params { - var () return &ListBlueprintRequestsUsingGET1Params{ - timeout: timeout, } } // NewListBlueprintRequestsUsingGET1ParamsWithContext creates a new ListBlueprintRequestsUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListBlueprintRequestsUsingGET1ParamsWithContext(ctx context.Context) *ListBlueprintRequestsUsingGET1Params { - var () return &ListBlueprintRequestsUsingGET1Params{ - Context: ctx, } } // NewListBlueprintRequestsUsingGET1ParamsWithHTTPClient creates a new ListBlueprintRequestsUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListBlueprintRequestsUsingGET1ParamsWithHTTPClient(client *http.Client) *ListBlueprintRequestsUsingGET1Params { - var () return &ListBlueprintRequestsUsingGET1Params{ HTTPClient: client, } } -/*ListBlueprintRequestsUsingGET1Params contains all the parameters to send to the API endpoint -for the list blueprint requests using get1 operation typically these are written to a http.Request +/* ListBlueprintRequestsUsingGET1Params contains all the parameters to send to the API endpoint + for the list blueprint requests using get1 operation. + + Typically these are written to a http.Request. */ type ListBlueprintRequestsUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy. */ DollarOrderby []string - /*DollarSelect - Fields to include in content. Use * to get all fields. + /* DollarSelect. + + Fields to include in content. Use * to get all fields. */ DollarSelect []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*DeploymentID - Deployment Id filter + /* DeploymentID. + + Deployment Id filter */ DeploymentID *string - /*IncludePlan - Plan Requests filter + /* IncludePlan. + + Plan Requests filter */ IncludePlan *bool @@ -102,6 +111,21 @@ type ListBlueprintRequestsUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list blueprint requests using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintRequestsUsingGET1Params) WithDefaults() *ListBlueprintRequestsUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list blueprint requests using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBlueprintRequestsUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list blueprint requests using get1 params func (o *ListBlueprintRequestsUsingGET1Params) WithTimeout(timeout time.Duration) *ListBlueprintRequestsUsingGET1Params { o.SetTimeout(timeout) @@ -220,100 +244,111 @@ func (o *ListBlueprintRequestsUsingGET1Params) WriteToRequest(r runtime.ClientRe } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } - valuesDollarSelect := o.DollarSelect + if o.DollarSelect != nil { - joinedDollarSelect := swag.JoinByFormat(valuesDollarSelect, "multi") - // query array param $select - if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { - return err + // binding items for $select + joinedDollarSelect := o.bindParamDollarSelect(reg) + + // query array param $select + if err := r.SetQueryParam("$select", joinedDollarSelect...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.DeploymentID != nil { // query param deploymentId var qrDeploymentID string + if o.DeploymentID != nil { qrDeploymentID = *o.DeploymentID } qDeploymentID := qrDeploymentID if qDeploymentID != "" { + if err := r.SetQueryParam("deploymentId", qDeploymentID); err != nil { return err } } - } if o.IncludePlan != nil { // query param includePlan var qrIncludePlan bool + if o.IncludePlan != nil { qrIncludePlan = *o.IncludePlan } qIncludePlan := swag.FormatBool(qrIncludePlan) if qIncludePlan != "" { + if err := r.SetQueryParam("includePlan", qIncludePlan); err != nil { return err } } - } if len(res) > 0 { @@ -321,3 +356,37 @@ func (o *ListBlueprintRequestsUsingGET1Params) WriteToRequest(r runtime.ClientRe } return nil } + +// bindParamListBlueprintRequestsUsingGET1 binds the parameter $orderby +func (o *ListBlueprintRequestsUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamListBlueprintRequestsUsingGET1 binds the parameter $select +func (o *ListBlueprintRequestsUsingGET1Params) bindParamDollarSelect(formats strfmt.Registry) []string { + dollarSelectIR := o.DollarSelect + + var dollarSelectIC []string + for _, dollarSelectIIR := range dollarSelectIR { // explode []string + + dollarSelectIIV := dollarSelectIIR // string as string + dollarSelectIC = append(dollarSelectIC, dollarSelectIIV) + } + + // items.CollectionFormat: "multi" + dollarSelectIS := swag.JoinByFormat(dollarSelectIC, "multi") + + return dollarSelectIS +} diff --git a/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_responses.go b/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_responses.go index 861b9b35..c3777206 100644 --- a/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_responses.go +++ b/pkg/client/blueprint_requests/list_blueprint_requests_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *ListBlueprintRequestsUsingGET1Reader) ReadResponse(response runtime.Cli return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewListBlueprintRequestsUsingGET1OK() *ListBlueprintRequestsUsingGET1OK { return &ListBlueprintRequestsUsingGET1OK{} } -/*ListBlueprintRequestsUsingGET1OK handles this case with default header values. +/* ListBlueprintRequestsUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ListBlueprintRequestsUsingGET1OK struct { func (o *ListBlueprintRequestsUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests][%d] listBlueprintRequestsUsingGET1OK %+v", 200, o.Payload) } - func (o *ListBlueprintRequestsUsingGET1OK) GetPayload() *models.PageOfBlueprintRequest { return o.Payload } @@ -91,7 +89,7 @@ func NewListBlueprintRequestsUsingGET1BadRequest() *ListBlueprintRequestsUsingGE return &ListBlueprintRequestsUsingGET1BadRequest{} } -/*ListBlueprintRequestsUsingGET1BadRequest handles this case with default header values. +/* ListBlueprintRequestsUsingGET1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type ListBlueprintRequestsUsingGET1BadRequest struct { func (o *ListBlueprintRequestsUsingGET1BadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-requests][%d] listBlueprintRequestsUsingGET1BadRequest %+v", 400, o.Payload) } - func (o *ListBlueprintRequestsUsingGET1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewListBlueprintRequestsUsingGET1Unauthorized() *ListBlueprintRequestsUsing return &ListBlueprintRequestsUsingGET1Unauthorized{} } -/*ListBlueprintRequestsUsingGET1Unauthorized handles this case with default header values. +/* ListBlueprintRequestsUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewListBlueprintRequestsUsingGET1Forbidden() *ListBlueprintRequestsUsingGET return &ListBlueprintRequestsUsingGET1Forbidden{} } -/*ListBlueprintRequestsUsingGET1Forbidden handles this case with default header values. +/* ListBlueprintRequestsUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/blueprint_terraform_integrations_client.go b/pkg/client/blueprint_terraform_integrations/blueprint_terraform_integrations_client.go index 44c1794e..a1547fe4 100644 --- a/pkg/client/blueprint_terraform_integrations/blueprint_terraform_integrations_client.go +++ b/pkg/client/blueprint_terraform_integrations/blueprint_terraform_integrations_client.go @@ -25,27 +25,30 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFromMappingUsingPOST1Params) (*CreateBlueprintFromMappingUsingPOST1OK, error) + CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFromMappingUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintFromMappingUsingPOST1OK, error) - CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMappingUsingPOST1Params) (*CreateBlueprintMappingUsingPOST1OK, error) + CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMappingUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintMappingUsingPOST1OK, error) - CreateTerraformVersionUsingPOST1(params *CreateTerraformVersionUsingPOST1Params) (*CreateTerraformVersionUsingPOST1Created, error) + CreateTerraformVersionUsingPOST1(params *CreateTerraformVersionUsingPOST1Params, opts ...ClientOption) (*CreateTerraformVersionUsingPOST1Created, error) - DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersionUsingDELETE1Params) (*DeleteTerraformVersionUsingDELETE1NoContent, error) + DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersionUsingDELETE1Params, opts ...ClientOption) (*DeleteTerraformVersionUsingDELETE1NoContent, error) - GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSourceTreeUsingGET1Params) (*GetConfigurationSourceTreeUsingGET1OK, error) + GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSourceTreeUsingGET1Params, opts ...ClientOption) (*GetConfigurationSourceTreeUsingGET1OK, error) - GetTerraformConfigurationSourceCommitListUsingGET1(params *GetTerraformConfigurationSourceCommitListUsingGET1Params) (*GetTerraformConfigurationSourceCommitListUsingGET1OK, error) + GetTerraformConfigurationSourceCommitListUsingGET1(params *GetTerraformConfigurationSourceCommitListUsingGET1Params, opts ...ClientOption) (*GetTerraformConfigurationSourceCommitListUsingGET1OK, error) - GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformConfigurationSourcesUsingGET1Params) (*GetTerraformConfigurationSourcesUsingGET1OK, error) + GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformConfigurationSourcesUsingGET1Params, opts ...ClientOption) (*GetTerraformConfigurationSourcesUsingGET1OK, error) - GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGET1Params) (*GetTerraformVersionUsingGET1OK, error) + GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGET1Params, opts ...ClientOption) (*GetTerraformVersionUsingGET1OK, error) - ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsingGET1Params) (*ListTerraformVersionsUsingGET1OK, error) + ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsingGET1Params, opts ...ClientOption) (*ListTerraformVersionsUsingGET1OK, error) - UpdateTerraformVersionUsingPATCH1(params *UpdateTerraformVersionUsingPATCH1Params) (*UpdateTerraformVersionUsingPATCH1OK, error) + UpdateTerraformVersionUsingPATCH1(params *UpdateTerraformVersionUsingPATCH1Params, opts ...ClientOption) (*UpdateTerraformVersionUsingPATCH1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -53,13 +56,12 @@ type ClientService interface { /* CreateBlueprintFromMappingUsingPOST1 creates a blueprint from a terraform blueprint configuration obtained from create blueprint mapping */ -func (a *Client) CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFromMappingUsingPOST1Params) (*CreateBlueprintFromMappingUsingPOST1OK, error) { +func (a *Client) CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFromMappingUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintFromMappingUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlueprintFromMappingUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlueprintFromMappingUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprint-integrations/terraform/create-blueprint-from-mapping", @@ -70,7 +72,12 @@ func (a *Client) CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFro Reader: &CreateBlueprintFromMappingUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -87,13 +94,12 @@ func (a *Client) CreateBlueprintFromMappingUsingPOST1(params *CreateBlueprintFro /* CreateBlueprintMappingUsingPOST1 retrieves and parses the specified terraform configuration file s and returns relevant information for blueprint construction */ -func (a *Client) CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMappingUsingPOST1Params) (*CreateBlueprintMappingUsingPOST1OK, error) { +func (a *Client) CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMappingUsingPOST1Params, opts ...ClientOption) (*CreateBlueprintMappingUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlueprintMappingUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlueprintMappingUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprint-integrations/terraform/create-blueprint-mapping", @@ -104,7 +110,12 @@ func (a *Client) CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMapping Reader: &CreateBlueprintMappingUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) CreateBlueprintMappingUsingPOST1(params *CreateBlueprintMapping /* CreateTerraformVersionUsingPOST1 creates a version */ -func (a *Client) CreateTerraformVersionUsingPOST1(params *CreateTerraformVersionUsingPOST1Params) (*CreateTerraformVersionUsingPOST1Created, error) { +func (a *Client) CreateTerraformVersionUsingPOST1(params *CreateTerraformVersionUsingPOST1Params, opts ...ClientOption) (*CreateTerraformVersionUsingPOST1Created, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateTerraformVersionUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createTerraformVersionUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprint-integrations/terraform/versions", @@ -138,7 +148,12 @@ func (a *Client) CreateTerraformVersionUsingPOST1(params *CreateTerraformVersion Reader: &CreateTerraformVersionUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -155,13 +170,12 @@ func (a *Client) CreateTerraformVersionUsingPOST1(params *CreateTerraformVersion /* DeleteTerraformVersionUsingDELETE1 deletes a terraform version */ -func (a *Client) DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersionUsingDELETE1Params) (*DeleteTerraformVersionUsingDELETE1NoContent, error) { +func (a *Client) DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersionUsingDELETE1Params, opts ...ClientOption) (*DeleteTerraformVersionUsingDELETE1NoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteTerraformVersionUsingDELETE1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteTerraformVersionUsingDELETE_1", Method: "DELETE", PathPattern: "/blueprint/api/blueprint-integrations/terraform/versions/{versionId}", @@ -172,7 +186,12 @@ func (a *Client) DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersi Reader: &DeleteTerraformVersionUsingDELETE1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -189,13 +208,12 @@ func (a *Client) DeleteTerraformVersionUsingDELETE1(params *DeleteTerraformVersi /* GetConfigurationSourceTreeUsingGET1 shows directories of the configuration source repository that correspond to terraform configurations */ -func (a *Client) GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSourceTreeUsingGET1Params) (*GetConfigurationSourceTreeUsingGET1OK, error) { +func (a *Client) GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSourceTreeUsingGET1Params, opts ...ClientOption) (*GetConfigurationSourceTreeUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetConfigurationSourceTreeUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getConfigurationSourceTreeUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-integrations/terraform/get-configuration-source-tree", @@ -206,7 +224,12 @@ func (a *Client) GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSou Reader: &GetConfigurationSourceTreeUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -223,13 +246,12 @@ func (a *Client) GetConfigurationSourceTreeUsingGET1(params *GetConfigurationSou /* GetTerraformConfigurationSourceCommitListUsingGET1 returns a paginated list of commits for a specified configuration source */ -func (a *Client) GetTerraformConfigurationSourceCommitListUsingGET1(params *GetTerraformConfigurationSourceCommitListUsingGET1Params) (*GetTerraformConfigurationSourceCommitListUsingGET1OK, error) { +func (a *Client) GetTerraformConfigurationSourceCommitListUsingGET1(params *GetTerraformConfigurationSourceCommitListUsingGET1Params, opts ...ClientOption) (*GetTerraformConfigurationSourceCommitListUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTerraformConfigurationSourceCommitListUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTerraformConfigurationSourceCommitListUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-integrations/terraform/get-configuration-source-commits", @@ -240,7 +262,12 @@ func (a *Client) GetTerraformConfigurationSourceCommitListUsingGET1(params *GetT Reader: &GetTerraformConfigurationSourceCommitListUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -257,13 +284,12 @@ func (a *Client) GetTerraformConfigurationSourceCommitListUsingGET1(params *GetT /* GetTerraformConfigurationSourcesUsingGET1 returns a paginated list of configuration sources configured as storage for terraform configurations */ -func (a *Client) GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformConfigurationSourcesUsingGET1Params) (*GetTerraformConfigurationSourcesUsingGET1OK, error) { +func (a *Client) GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformConfigurationSourcesUsingGET1Params, opts ...ClientOption) (*GetTerraformConfigurationSourcesUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTerraformConfigurationSourcesUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTerraformConfigurationSourcesUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-integrations/terraform/get-configuration-sources", @@ -274,7 +300,12 @@ func (a *Client) GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformC Reader: &GetTerraformConfigurationSourcesUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -291,13 +322,12 @@ func (a *Client) GetTerraformConfigurationSourcesUsingGET1(params *GetTerraformC /* GetTerraformVersionUsingGET1 returns terraform version details */ -func (a *Client) GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGET1Params) (*GetTerraformVersionUsingGET1OK, error) { +func (a *Client) GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGET1Params, opts ...ClientOption) (*GetTerraformVersionUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTerraformVersionUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTerraformVersionUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-integrations/terraform/versions/{versionId}", @@ -308,7 +338,12 @@ func (a *Client) GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGE Reader: &GetTerraformVersionUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -325,13 +360,12 @@ func (a *Client) GetTerraformVersionUsingGET1(params *GetTerraformVersionUsingGE /* ListTerraformVersionsUsingGET1 lists terraform versions */ -func (a *Client) ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsingGET1Params) (*ListTerraformVersionsUsingGET1OK, error) { +func (a *Client) ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsingGET1Params, opts ...ClientOption) (*ListTerraformVersionsUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewListTerraformVersionsUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listTerraformVersionsUsingGET_1", Method: "GET", PathPattern: "/blueprint/api/blueprint-integrations/terraform/versions", @@ -342,7 +376,12 @@ func (a *Client) ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsi Reader: &ListTerraformVersionsUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -359,13 +398,12 @@ func (a *Client) ListTerraformVersionsUsingGET1(params *ListTerraformVersionsUsi /* UpdateTerraformVersionUsingPATCH1 updates a terraform version */ -func (a *Client) UpdateTerraformVersionUsingPATCH1(params *UpdateTerraformVersionUsingPATCH1Params) (*UpdateTerraformVersionUsingPATCH1OK, error) { +func (a *Client) UpdateTerraformVersionUsingPATCH1(params *UpdateTerraformVersionUsingPATCH1Params, opts ...ClientOption) (*UpdateTerraformVersionUsingPATCH1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateTerraformVersionUsingPATCH1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateTerraformVersionUsingPATCH_1", Method: "PATCH", PathPattern: "/blueprint/api/blueprint-integrations/terraform/versions/{versionId}", @@ -376,7 +414,12 @@ func (a *Client) UpdateTerraformVersionUsingPATCH1(params *UpdateTerraformVersio Reader: &UpdateTerraformVersionUsingPATCH1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_parameters.go b/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_parameters.go index ea1b623f..73659dfc 100644 --- a/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlueprintFromMappingUsingPOST1Params creates a new CreateBlueprintFromMappingUsingPOST1Params object -// with the default values initialized. +// NewCreateBlueprintFromMappingUsingPOST1Params creates a new CreateBlueprintFromMappingUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlueprintFromMappingUsingPOST1Params() *CreateBlueprintFromMappingUsingPOST1Params { - var () return &CreateBlueprintFromMappingUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateBlueprintFromMappingUsingPOST1ParamsWithTimeout creates a new CreateBlueprintFromMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlueprintFromMappingUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateBlueprintFromMappingUsingPOST1Params { - var () return &CreateBlueprintFromMappingUsingPOST1Params{ - timeout: timeout, } } // NewCreateBlueprintFromMappingUsingPOST1ParamsWithContext creates a new CreateBlueprintFromMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlueprintFromMappingUsingPOST1ParamsWithContext(ctx context.Context) *CreateBlueprintFromMappingUsingPOST1Params { - var () return &CreateBlueprintFromMappingUsingPOST1Params{ - Context: ctx, } } // NewCreateBlueprintFromMappingUsingPOST1ParamsWithHTTPClient creates a new CreateBlueprintFromMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlueprintFromMappingUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateBlueprintFromMappingUsingPOST1Params { - var () return &CreateBlueprintFromMappingUsingPOST1Params{ HTTPClient: client, } } -/*CreateBlueprintFromMappingUsingPOST1Params contains all the parameters to send to the API endpoint -for the create blueprint from mapping using p o s t 1 operation typically these are written to a http.Request +/* CreateBlueprintFromMappingUsingPOST1Params contains all the parameters to send to the API endpoint + for the create blueprint from mapping using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateBlueprintFromMappingUsingPOST1Params struct { - /*TerraformBlueprintConfig - A Terraform blueprint configuration. + /* TerraformBlueprintConfig. + A Terraform blueprint configuration. */ TerraformBlueprintConfig *models.TerraformBlueprintConfig @@ -73,6 +72,21 @@ type CreateBlueprintFromMappingUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create blueprint from mapping using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintFromMappingUsingPOST1Params) WithDefaults() *CreateBlueprintFromMappingUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create blueprint from mapping using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintFromMappingUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create blueprint from mapping using p o s t 1 params func (o *CreateBlueprintFromMappingUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateBlueprintFromMappingUsingPOST1Params { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *CreateBlueprintFromMappingUsingPOST1Params) WriteToRequest(r runtime.Cl return err } var res []error - if o.TerraformBlueprintConfig != nil { if err := r.SetBodyParam(o.TerraformBlueprintConfig); err != nil { return err diff --git a/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_responses.go b/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_responses.go index ebcd3e0c..48db02f9 100644 --- a/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/create_blueprint_from_mapping_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *CreateBlueprintFromMappingUsingPOST1Reader) ReadResponse(response runti return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateBlueprintFromMappingUsingPOST1OK() *CreateBlueprintFromMappingUsin return &CreateBlueprintFromMappingUsingPOST1OK{} } -/*CreateBlueprintFromMappingUsingPOST1OK handles this case with default header values. +/* CreateBlueprintFromMappingUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type CreateBlueprintFromMappingUsingPOST1OK struct { func (o *CreateBlueprintFromMappingUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/create-blueprint-from-mapping][%d] createBlueprintFromMappingUsingPOST1OK %+v", 200, o.Payload) } - func (o *CreateBlueprintFromMappingUsingPOST1OK) GetPayload() *models.Blueprint { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateBlueprintFromMappingUsingPOST1BadRequest() *CreateBlueprintFromMap return &CreateBlueprintFromMappingUsingPOST1BadRequest{} } -/*CreateBlueprintFromMappingUsingPOST1BadRequest handles this case with default header values. +/* CreateBlueprintFromMappingUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type CreateBlueprintFromMappingUsingPOST1BadRequest struct { func (o *CreateBlueprintFromMappingUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/create-blueprint-from-mapping][%d] createBlueprintFromMappingUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateBlueprintFromMappingUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateBlueprintFromMappingUsingPOST1Unauthorized() *CreateBlueprintFromM return &CreateBlueprintFromMappingUsingPOST1Unauthorized{} } -/*CreateBlueprintFromMappingUsingPOST1Unauthorized handles this case with default header values. +/* CreateBlueprintFromMappingUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateBlueprintFromMappingUsingPOST1Forbidden() *CreateBlueprintFromMapp return &CreateBlueprintFromMappingUsingPOST1Forbidden{} } -/*CreateBlueprintFromMappingUsingPOST1Forbidden handles this case with default header values. +/* CreateBlueprintFromMappingUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_parameters.go b/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_parameters.go index 079dd9e3..782105ba 100644 --- a/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlueprintMappingUsingPOST1Params creates a new CreateBlueprintMappingUsingPOST1Params object -// with the default values initialized. +// NewCreateBlueprintMappingUsingPOST1Params creates a new CreateBlueprintMappingUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlueprintMappingUsingPOST1Params() *CreateBlueprintMappingUsingPOST1Params { - var () return &CreateBlueprintMappingUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateBlueprintMappingUsingPOST1ParamsWithTimeout creates a new CreateBlueprintMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlueprintMappingUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateBlueprintMappingUsingPOST1Params { - var () return &CreateBlueprintMappingUsingPOST1Params{ - timeout: timeout, } } // NewCreateBlueprintMappingUsingPOST1ParamsWithContext creates a new CreateBlueprintMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlueprintMappingUsingPOST1ParamsWithContext(ctx context.Context) *CreateBlueprintMappingUsingPOST1Params { - var () return &CreateBlueprintMappingUsingPOST1Params{ - Context: ctx, } } // NewCreateBlueprintMappingUsingPOST1ParamsWithHTTPClient creates a new CreateBlueprintMappingUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlueprintMappingUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateBlueprintMappingUsingPOST1Params { - var () return &CreateBlueprintMappingUsingPOST1Params{ HTTPClient: client, } } -/*CreateBlueprintMappingUsingPOST1Params contains all the parameters to send to the API endpoint -for the create blueprint mapping using p o s t 1 operation typically these are written to a http.Request +/* CreateBlueprintMappingUsingPOST1Params contains all the parameters to send to the API endpoint + for the create blueprint mapping using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateBlueprintMappingUsingPOST1Params struct { - /*ConfigurationSourceReference - configurationSourceReference + /* ConfigurationSourceReference. + configurationSourceReference */ ConfigurationSourceReference *models.TerraformConfigurationSourceReference @@ -73,6 +72,21 @@ type CreateBlueprintMappingUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create blueprint mapping using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintMappingUsingPOST1Params) WithDefaults() *CreateBlueprintMappingUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create blueprint mapping using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlueprintMappingUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create blueprint mapping using p o s t 1 params func (o *CreateBlueprintMappingUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateBlueprintMappingUsingPOST1Params { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *CreateBlueprintMappingUsingPOST1Params) WriteToRequest(r runtime.Client return err } var res []error - if o.ConfigurationSourceReference != nil { if err := r.SetBodyParam(o.ConfigurationSourceReference); err != nil { return err diff --git a/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_responses.go b/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_responses.go index 15ad9ad2..875ca8d8 100644 --- a/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/create_blueprint_mapping_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *CreateBlueprintMappingUsingPOST1Reader) ReadResponse(response runtime.C return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateBlueprintMappingUsingPOST1OK() *CreateBlueprintMappingUsingPOST1OK return &CreateBlueprintMappingUsingPOST1OK{} } -/*CreateBlueprintMappingUsingPOST1OK handles this case with default header values. +/* CreateBlueprintMappingUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type CreateBlueprintMappingUsingPOST1OK struct { func (o *CreateBlueprintMappingUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/create-blueprint-mapping][%d] createBlueprintMappingUsingPOST1OK %+v", 200, o.Payload) } - func (o *CreateBlueprintMappingUsingPOST1OK) GetPayload() *models.TerraformToBlueprintMapping { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateBlueprintMappingUsingPOST1BadRequest() *CreateBlueprintMappingUsin return &CreateBlueprintMappingUsingPOST1BadRequest{} } -/*CreateBlueprintMappingUsingPOST1BadRequest handles this case with default header values. +/* CreateBlueprintMappingUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type CreateBlueprintMappingUsingPOST1BadRequest struct { func (o *CreateBlueprintMappingUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/create-blueprint-mapping][%d] createBlueprintMappingUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateBlueprintMappingUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateBlueprintMappingUsingPOST1Unauthorized() *CreateBlueprintMappingUs return &CreateBlueprintMappingUsingPOST1Unauthorized{} } -/*CreateBlueprintMappingUsingPOST1Unauthorized handles this case with default header values. +/* CreateBlueprintMappingUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateBlueprintMappingUsingPOST1Forbidden() *CreateBlueprintMappingUsing return &CreateBlueprintMappingUsingPOST1Forbidden{} } -/*CreateBlueprintMappingUsingPOST1Forbidden handles this case with default header values. +/* CreateBlueprintMappingUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_parameters.go b/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_parameters.go index 66fc65fe..95a89a63 100644 --- a/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateTerraformVersionUsingPOST1Params creates a new CreateTerraformVersionUsingPOST1Params object -// with the default values initialized. +// NewCreateTerraformVersionUsingPOST1Params creates a new CreateTerraformVersionUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateTerraformVersionUsingPOST1Params() *CreateTerraformVersionUsingPOST1Params { - var () return &CreateTerraformVersionUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreateTerraformVersionUsingPOST1ParamsWithTimeout creates a new CreateTerraformVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateTerraformVersionUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreateTerraformVersionUsingPOST1Params { - var () return &CreateTerraformVersionUsingPOST1Params{ - timeout: timeout, } } // NewCreateTerraformVersionUsingPOST1ParamsWithContext creates a new CreateTerraformVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateTerraformVersionUsingPOST1ParamsWithContext(ctx context.Context) *CreateTerraformVersionUsingPOST1Params { - var () return &CreateTerraformVersionUsingPOST1Params{ - Context: ctx, } } // NewCreateTerraformVersionUsingPOST1ParamsWithHTTPClient creates a new CreateTerraformVersionUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateTerraformVersionUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreateTerraformVersionUsingPOST1Params { - var () return &CreateTerraformVersionUsingPOST1Params{ HTTPClient: client, } } -/*CreateTerraformVersionUsingPOST1Params contains all the parameters to send to the API endpoint -for the create terraform version using p o s t 1 operation typically these are written to a http.Request +/* CreateTerraformVersionUsingPOST1Params contains all the parameters to send to the API endpoint + for the create terraform version using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreateTerraformVersionUsingPOST1Params struct { - /*TerraformVersion - Terraform version + /* TerraformVersion. + Terraform version */ TerraformVersion *models.TerraformVersion @@ -73,6 +72,21 @@ type CreateTerraformVersionUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create terraform version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTerraformVersionUsingPOST1Params) WithDefaults() *CreateTerraformVersionUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create terraform version using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTerraformVersionUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create terraform version using p o s t 1 params func (o *CreateTerraformVersionUsingPOST1Params) WithTimeout(timeout time.Duration) *CreateTerraformVersionUsingPOST1Params { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *CreateTerraformVersionUsingPOST1Params) WriteToRequest(r runtime.Client return err } var res []error - if o.TerraformVersion != nil { if err := r.SetBodyParam(o.TerraformVersion); err != nil { return err diff --git a/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_responses.go b/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_responses.go index a80fcdd8..81e4085f 100644 --- a/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/create_terraform_version_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *CreateTerraformVersionUsingPOST1Reader) ReadResponse(response runtime.C return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateTerraformVersionUsingPOST1Created() *CreateTerraformVersionUsingPO return &CreateTerraformVersionUsingPOST1Created{} } -/*CreateTerraformVersionUsingPOST1Created handles this case with default header values. +/* CreateTerraformVersionUsingPOST1Created describes a response with status code 201, with default header values. Created */ @@ -69,7 +68,6 @@ type CreateTerraformVersionUsingPOST1Created struct { func (o *CreateTerraformVersionUsingPOST1Created) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/versions][%d] createTerraformVersionUsingPOST1Created %+v", 201, o.Payload) } - func (o *CreateTerraformVersionUsingPOST1Created) GetPayload() *models.TerraformVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateTerraformVersionUsingPOST1BadRequest() *CreateTerraformVersionUsin return &CreateTerraformVersionUsingPOST1BadRequest{} } -/*CreateTerraformVersionUsingPOST1BadRequest handles this case with default header values. +/* CreateTerraformVersionUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type CreateTerraformVersionUsingPOST1BadRequest struct { func (o *CreateTerraformVersionUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-integrations/terraform/versions][%d] createTerraformVersionUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *CreateTerraformVersionUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateTerraformVersionUsingPOST1Unauthorized() *CreateTerraformVersionUs return &CreateTerraformVersionUsingPOST1Unauthorized{} } -/*CreateTerraformVersionUsingPOST1Unauthorized handles this case with default header values. +/* CreateTerraformVersionUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateTerraformVersionUsingPOST1Forbidden() *CreateTerraformVersionUsing return &CreateTerraformVersionUsingPOST1Forbidden{} } -/*CreateTerraformVersionUsingPOST1Forbidden handles this case with default header values. +/* CreateTerraformVersionUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_parameters.go b/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_parameters.go index e637b195..8dae2016 100644 --- a/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteTerraformVersionUsingDELETE1Params creates a new DeleteTerraformVersionUsingDELETE1Params object -// with the default values initialized. +// NewDeleteTerraformVersionUsingDELETE1Params creates a new DeleteTerraformVersionUsingDELETE1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteTerraformVersionUsingDELETE1Params() *DeleteTerraformVersionUsingDELETE1Params { - var () return &DeleteTerraformVersionUsingDELETE1Params{ - timeout: cr.DefaultTimeout, } } // NewDeleteTerraformVersionUsingDELETE1ParamsWithTimeout creates a new DeleteTerraformVersionUsingDELETE1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteTerraformVersionUsingDELETE1ParamsWithTimeout(timeout time.Duration) *DeleteTerraformVersionUsingDELETE1Params { - var () return &DeleteTerraformVersionUsingDELETE1Params{ - timeout: timeout, } } // NewDeleteTerraformVersionUsingDELETE1ParamsWithContext creates a new DeleteTerraformVersionUsingDELETE1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteTerraformVersionUsingDELETE1ParamsWithContext(ctx context.Context) *DeleteTerraformVersionUsingDELETE1Params { - var () return &DeleteTerraformVersionUsingDELETE1Params{ - Context: ctx, } } // NewDeleteTerraformVersionUsingDELETE1ParamsWithHTTPClient creates a new DeleteTerraformVersionUsingDELETE1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteTerraformVersionUsingDELETE1ParamsWithHTTPClient(client *http.Client) *DeleteTerraformVersionUsingDELETE1Params { - var () return &DeleteTerraformVersionUsingDELETE1Params{ HTTPClient: client, } } -/*DeleteTerraformVersionUsingDELETE1Params contains all the parameters to send to the API endpoint -for the delete terraform version using d e l e t e 1 operation typically these are written to a http.Request +/* DeleteTerraformVersionUsingDELETE1Params contains all the parameters to send to the API endpoint + for the delete terraform version using d e l e t e 1 operation. + + Typically these are written to a http.Request. */ type DeleteTerraformVersionUsingDELETE1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*VersionID - versionId + /* VersionID. + + versionId + + Format: uuid */ VersionID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteTerraformVersionUsingDELETE1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete terraform version using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTerraformVersionUsingDELETE1Params) WithDefaults() *DeleteTerraformVersionUsingDELETE1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete terraform version using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTerraformVersionUsingDELETE1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete terraform version using d e l e t e 1 params func (o *DeleteTerraformVersionUsingDELETE1Params) WithTimeout(timeout time.Duration) *DeleteTerraformVersionUsingDELETE1Params { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteTerraformVersionUsingDELETE1Params) WriteToRequest(r runtime.Clie // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param versionId diff --git a/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_responses.go b/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_responses.go index 424ef4bd..d8a9885e 100644 --- a/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/delete_terraform_version_using_delete1_responses.go @@ -47,7 +47,6 @@ func (o *DeleteTerraformVersionUsingDELETE1Reader) ReadResponse(response runtime return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeleteTerraformVersionUsingDELETE1NoContent() *DeleteTerraformVersionUsi return &DeleteTerraformVersionUsingDELETE1NoContent{} } -/*DeleteTerraformVersionUsingDELETE1NoContent handles this case with default header values. +/* DeleteTerraformVersionUsingDELETE1NoContent describes a response with status code 204, with default header values. No Content */ @@ -79,7 +78,7 @@ func NewDeleteTerraformVersionUsingDELETE1Unauthorized() *DeleteTerraformVersion return &DeleteTerraformVersionUsingDELETE1Unauthorized{} } -/*DeleteTerraformVersionUsingDELETE1Unauthorized handles this case with default header values. +/* DeleteTerraformVersionUsingDELETE1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -100,7 +99,7 @@ func NewDeleteTerraformVersionUsingDELETE1Forbidden() *DeleteTerraformVersionUsi return &DeleteTerraformVersionUsingDELETE1Forbidden{} } -/*DeleteTerraformVersionUsingDELETE1Forbidden handles this case with default header values. +/* DeleteTerraformVersionUsingDELETE1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -121,7 +120,7 @@ func NewDeleteTerraformVersionUsingDELETE1NotFound() *DeleteTerraformVersionUsin return &DeleteTerraformVersionUsingDELETE1NotFound{} } -/*DeleteTerraformVersionUsingDELETE1NotFound handles this case with default header values. +/* DeleteTerraformVersionUsingDELETE1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type DeleteTerraformVersionUsingDELETE1NotFound struct { func (o *DeleteTerraformVersionUsingDELETE1NotFound) Error() string { return fmt.Sprintf("[DELETE /blueprint/api/blueprint-integrations/terraform/versions/{versionId}][%d] deleteTerraformVersionUsingDELETE1NotFound %+v", 404, o.Payload) } - func (o *DeleteTerraformVersionUsingDELETE1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_parameters.go b/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_parameters.go index 7dd04d78..c969456e 100644 --- a/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetConfigurationSourceTreeUsingGET1Params creates a new GetConfigurationSourceTreeUsingGET1Params object -// with the default values initialized. +// NewGetConfigurationSourceTreeUsingGET1Params creates a new GetConfigurationSourceTreeUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetConfigurationSourceTreeUsingGET1Params() *GetConfigurationSourceTreeUsingGET1Params { - var () return &GetConfigurationSourceTreeUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetConfigurationSourceTreeUsingGET1ParamsWithTimeout creates a new GetConfigurationSourceTreeUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetConfigurationSourceTreeUsingGET1ParamsWithTimeout(timeout time.Duration) *GetConfigurationSourceTreeUsingGET1Params { - var () return &GetConfigurationSourceTreeUsingGET1Params{ - timeout: timeout, } } // NewGetConfigurationSourceTreeUsingGET1ParamsWithContext creates a new GetConfigurationSourceTreeUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetConfigurationSourceTreeUsingGET1ParamsWithContext(ctx context.Context) *GetConfigurationSourceTreeUsingGET1Params { - var () return &GetConfigurationSourceTreeUsingGET1Params{ - Context: ctx, } } // NewGetConfigurationSourceTreeUsingGET1ParamsWithHTTPClient creates a new GetConfigurationSourceTreeUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetConfigurationSourceTreeUsingGET1ParamsWithHTTPClient(client *http.Client) *GetConfigurationSourceTreeUsingGET1Params { - var () return &GetConfigurationSourceTreeUsingGET1Params{ HTTPClient: client, } } -/*GetConfigurationSourceTreeUsingGET1Params contains all the parameters to send to the API endpoint -for the get configuration source tree using get1 operation typically these are written to a http.Request +/* GetConfigurationSourceTreeUsingGET1Params contains all the parameters to send to the API endpoint + for the get configuration source tree using get1 operation. + + Typically these are written to a http.Request. */ type GetConfigurationSourceTreeUsingGET1Params struct { - /*CommitID - The commit ID corresponding to the version of the configuration source. + /* CommitID. + The commit ID corresponding to the version of the configuration source. */ CommitID *string - /*ConfigurationSourceID - The ID of the configuration source to inspect. + /* ConfigurationSourceID. + + The ID of the configuration source to inspect. + + Format: uuid */ ConfigurationSourceID strfmt.UUID - /*Path - A file path prefix. The prefix is interpreted in the context of the configuration source's path prefix. Results will only include directories under this path. + /* Path. + + A file path prefix. The prefix is interpreted in the context of the configuration source's path prefix. Results will only include directories under this path. */ Path *string @@ -81,6 +84,21 @@ type GetConfigurationSourceTreeUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get configuration source tree using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigurationSourceTreeUsingGET1Params) WithDefaults() *GetConfigurationSourceTreeUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get configuration source tree using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigurationSourceTreeUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get configuration source tree using get1 params func (o *GetConfigurationSourceTreeUsingGET1Params) WithTimeout(timeout time.Duration) *GetConfigurationSourceTreeUsingGET1Params { o.SetTimeout(timeout) @@ -159,22 +177,24 @@ func (o *GetConfigurationSourceTreeUsingGET1Params) WriteToRequest(r runtime.Cli // query param commitId var qrCommitID string + if o.CommitID != nil { qrCommitID = *o.CommitID } qCommitID := qrCommitID if qCommitID != "" { + if err := r.SetQueryParam("commitId", qCommitID); err != nil { return err } } - } // query param configurationSourceId qrConfigurationSourceID := o.ConfigurationSourceID qConfigurationSourceID := qrConfigurationSourceID.String() if qConfigurationSourceID != "" { + if err := r.SetQueryParam("configurationSourceId", qConfigurationSourceID); err != nil { return err } @@ -184,16 +204,17 @@ func (o *GetConfigurationSourceTreeUsingGET1Params) WriteToRequest(r runtime.Cli // query param path var qrPath string + if o.Path != nil { qrPath = *o.Path } qPath := qrPath if qPath != "" { + if err := r.SetQueryParam("path", qPath); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_responses.go b/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_responses.go index fd022e26..62e30cfb 100644 --- a/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/get_configuration_source_tree_using_get1_responses.go @@ -53,7 +53,6 @@ func (o *GetConfigurationSourceTreeUsingGET1Reader) ReadResponse(response runtim return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewGetConfigurationSourceTreeUsingGET1OK() *GetConfigurationSourceTreeUsing return &GetConfigurationSourceTreeUsingGET1OK{} } -/*GetConfigurationSourceTreeUsingGET1OK handles this case with default header values. +/* GetConfigurationSourceTreeUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -75,7 +74,6 @@ type GetConfigurationSourceTreeUsingGET1OK struct { func (o *GetConfigurationSourceTreeUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-source-tree][%d] getConfigurationSourceTreeUsingGET1OK %+v", 200, o.Payload) } - func (o *GetConfigurationSourceTreeUsingGET1OK) GetPayload() *models.FileTree { return o.Payload } @@ -97,7 +95,7 @@ func NewGetConfigurationSourceTreeUsingGET1BadRequest() *GetConfigurationSourceT return &GetConfigurationSourceTreeUsingGET1BadRequest{} } -/*GetConfigurationSourceTreeUsingGET1BadRequest handles this case with default header values. +/* GetConfigurationSourceTreeUsingGET1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,7 +106,6 @@ type GetConfigurationSourceTreeUsingGET1BadRequest struct { func (o *GetConfigurationSourceTreeUsingGET1BadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-source-tree][%d] getConfigurationSourceTreeUsingGET1BadRequest %+v", 400, o.Payload) } - func (o *GetConfigurationSourceTreeUsingGET1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -130,7 +127,7 @@ func NewGetConfigurationSourceTreeUsingGET1Unauthorized() *GetConfigurationSourc return &GetConfigurationSourceTreeUsingGET1Unauthorized{} } -/*GetConfigurationSourceTreeUsingGET1Unauthorized handles this case with default header values. +/* GetConfigurationSourceTreeUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,7 +148,7 @@ func NewGetConfigurationSourceTreeUsingGET1Forbidden() *GetConfigurationSourceTr return &GetConfigurationSourceTreeUsingGET1Forbidden{} } -/*GetConfigurationSourceTreeUsingGET1Forbidden handles this case with default header values. +/* GetConfigurationSourceTreeUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -172,7 +169,7 @@ func NewGetConfigurationSourceTreeUsingGET1NotFound() *GetConfigurationSourceTre return &GetConfigurationSourceTreeUsingGET1NotFound{} } -/*GetConfigurationSourceTreeUsingGET1NotFound handles this case with default header values. +/* GetConfigurationSourceTreeUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -183,7 +180,6 @@ type GetConfigurationSourceTreeUsingGET1NotFound struct { func (o *GetConfigurationSourceTreeUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-source-tree][%d] getConfigurationSourceTreeUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetConfigurationSourceTreeUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_parameters.go b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_parameters.go index d097976d..a52550ef 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetTerraformConfigurationSourceCommitListUsingGET1Params creates a new GetTerraformConfigurationSourceCommitListUsingGET1Params object -// with the default values initialized. +// NewGetTerraformConfigurationSourceCommitListUsingGET1Params creates a new GetTerraformConfigurationSourceCommitListUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTerraformConfigurationSourceCommitListUsingGET1Params() *GetTerraformConfigurationSourceCommitListUsingGET1Params { - var () return &GetTerraformConfigurationSourceCommitListUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithTimeout creates a new GetTerraformConfigurationSourceCommitListUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithTimeout(timeout time.Duration) *GetTerraformConfigurationSourceCommitListUsingGET1Params { - var () return &GetTerraformConfigurationSourceCommitListUsingGET1Params{ - timeout: timeout, } } // NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithContext creates a new GetTerraformConfigurationSourceCommitListUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithContext(ctx context.Context) *GetTerraformConfigurationSourceCommitListUsingGET1Params { - var () return &GetTerraformConfigurationSourceCommitListUsingGET1Params{ - Context: ctx, } } // NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithHTTPClient creates a new GetTerraformConfigurationSourceCommitListUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTerraformConfigurationSourceCommitListUsingGET1ParamsWithHTTPClient(client *http.Client) *GetTerraformConfigurationSourceCommitListUsingGET1Params { - var () return &GetTerraformConfigurationSourceCommitListUsingGET1Params{ HTTPClient: client, } } -/*GetTerraformConfigurationSourceCommitListUsingGET1Params contains all the parameters to send to the API endpoint -for the get terraform configuration source commit list using get1 operation typically these are written to a http.Request +/* GetTerraformConfigurationSourceCommitListUsingGET1Params contains all the parameters to send to the API endpoint + for the get terraform configuration source commit list using get1 operation. + + Typically these are written to a http.Request. */ type GetTerraformConfigurationSourceCommitListUsingGET1Params struct { - /*ConfigurationSourceID - A Configuration Source ID. + /* ConfigurationSourceID. + A Configuration Source ID. */ ConfigurationSourceID string @@ -71,6 +70,21 @@ type GetTerraformConfigurationSourceCommitListUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get terraform configuration source commit list using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformConfigurationSourceCommitListUsingGET1Params) WithDefaults() *GetTerraformConfigurationSourceCommitListUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get terraform configuration source commit list using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformConfigurationSourceCommitListUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get terraform configuration source commit list using get1 params func (o *GetTerraformConfigurationSourceCommitListUsingGET1Params) WithTimeout(timeout time.Duration) *GetTerraformConfigurationSourceCommitListUsingGET1Params { o.SetTimeout(timeout) @@ -127,6 +141,7 @@ func (o *GetTerraformConfigurationSourceCommitListUsingGET1Params) WriteToReques qrConfigurationSourceID := o.ConfigurationSourceID qConfigurationSourceID := qrConfigurationSourceID if qConfigurationSourceID != "" { + if err := r.SetQueryParam("configurationSourceId", qConfigurationSourceID); err != nil { return err } diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_responses.go b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_responses.go index 1b8ca4f7..64fe85cc 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_source_commit_list_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetTerraformConfigurationSourceCommitListUsingGET1Reader) ReadResponse( return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetTerraformConfigurationSourceCommitListUsingGET1OK() *GetTerraformConf return &GetTerraformConfigurationSourceCommitListUsingGET1OK{} } -/*GetTerraformConfigurationSourceCommitListUsingGET1OK handles this case with default header values. +/* GetTerraformConfigurationSourceCommitListUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetTerraformConfigurationSourceCommitListUsingGET1OK struct { func (o *GetTerraformConfigurationSourceCommitListUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-source-commits][%d] getTerraformConfigurationSourceCommitListUsingGET1OK %+v", 200, o.Payload) } - func (o *GetTerraformConfigurationSourceCommitListUsingGET1OK) GetPayload() *models.PageOfCommitDetails { return o.Payload } @@ -91,7 +89,7 @@ func NewGetTerraformConfigurationSourceCommitListUsingGET1BadRequest() *GetTerra return &GetTerraformConfigurationSourceCommitListUsingGET1BadRequest{} } -/*GetTerraformConfigurationSourceCommitListUsingGET1BadRequest handles this case with default header values. +/* GetTerraformConfigurationSourceCommitListUsingGET1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type GetTerraformConfigurationSourceCommitListUsingGET1BadRequest struct { func (o *GetTerraformConfigurationSourceCommitListUsingGET1BadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-source-commits][%d] getTerraformConfigurationSourceCommitListUsingGET1BadRequest %+v", 400, o.Payload) } - func (o *GetTerraformConfigurationSourceCommitListUsingGET1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewGetTerraformConfigurationSourceCommitListUsingGET1Unauthorized() *GetTer return &GetTerraformConfigurationSourceCommitListUsingGET1Unauthorized{} } -/*GetTerraformConfigurationSourceCommitListUsingGET1Unauthorized handles this case with default header values. +/* GetTerraformConfigurationSourceCommitListUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewGetTerraformConfigurationSourceCommitListUsingGET1Forbidden() *GetTerraf return &GetTerraformConfigurationSourceCommitListUsingGET1Forbidden{} } -/*GetTerraformConfigurationSourceCommitListUsingGET1Forbidden handles this case with default header values. +/* GetTerraformConfigurationSourceCommitListUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_parameters.go b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_parameters.go index 6dd249e3..70245488 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_parameters.go @@ -17,58 +17,58 @@ import ( "github.com/go-openapi/swag" ) -// NewGetTerraformConfigurationSourcesUsingGET1Params creates a new GetTerraformConfigurationSourcesUsingGET1Params object -// with the default values initialized. +// NewGetTerraformConfigurationSourcesUsingGET1Params creates a new GetTerraformConfigurationSourcesUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTerraformConfigurationSourcesUsingGET1Params() *GetTerraformConfigurationSourcesUsingGET1Params { - var () return &GetTerraformConfigurationSourcesUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetTerraformConfigurationSourcesUsingGET1ParamsWithTimeout creates a new GetTerraformConfigurationSourcesUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTerraformConfigurationSourcesUsingGET1ParamsWithTimeout(timeout time.Duration) *GetTerraformConfigurationSourcesUsingGET1Params { - var () return &GetTerraformConfigurationSourcesUsingGET1Params{ - timeout: timeout, } } // NewGetTerraformConfigurationSourcesUsingGET1ParamsWithContext creates a new GetTerraformConfigurationSourcesUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTerraformConfigurationSourcesUsingGET1ParamsWithContext(ctx context.Context) *GetTerraformConfigurationSourcesUsingGET1Params { - var () return &GetTerraformConfigurationSourcesUsingGET1Params{ - Context: ctx, } } // NewGetTerraformConfigurationSourcesUsingGET1ParamsWithHTTPClient creates a new GetTerraformConfigurationSourcesUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTerraformConfigurationSourcesUsingGET1ParamsWithHTTPClient(client *http.Client) *GetTerraformConfigurationSourcesUsingGET1Params { - var () return &GetTerraformConfigurationSourcesUsingGET1Params{ HTTPClient: client, } } -/*GetTerraformConfigurationSourcesUsingGET1Params contains all the parameters to send to the API endpoint -for the get terraform configuration sources using get1 operation typically these are written to a http.Request +/* GetTerraformConfigurationSourcesUsingGET1Params contains all the parameters to send to the API endpoint + for the get terraform configuration sources using get1 operation. + + Typically these are written to a http.Request. */ type GetTerraformConfigurationSourcesUsingGET1Params struct { - /*Projects - A comma-separated list of project IDs. Results will be filtered so only configuration sources accessible from one or more of these projects will be returned. + /* Projects. + A comma-separated list of project IDs. Results will be filtered so only configuration sources accessible from one or more of these projects will be returned. */ Projects []string - /*Search - A search parameter to search based on configuration source name or repository. + /* Search. + + A search parameter to search based on configuration source name or repository. */ Search *string @@ -77,6 +77,21 @@ type GetTerraformConfigurationSourcesUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get terraform configuration sources using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformConfigurationSourcesUsingGET1Params) WithDefaults() *GetTerraformConfigurationSourcesUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get terraform configuration sources using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformConfigurationSourcesUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get terraform configuration sources using get1 params func (o *GetTerraformConfigurationSourcesUsingGET1Params) WithTimeout(timeout time.Duration) *GetTerraformConfigurationSourcesUsingGET1Params { o.SetTimeout(timeout) @@ -140,28 +155,32 @@ func (o *GetTerraformConfigurationSourcesUsingGET1Params) WriteToRequest(r runti } var res []error - valuesProjects := o.Projects + if o.Projects != nil { - joinedProjects := swag.JoinByFormat(valuesProjects, "multi") - // query array param projects - if err := r.SetQueryParam("projects", joinedProjects...); err != nil { - return err + // binding items for projects + joinedProjects := o.bindParamProjects(reg) + + // query array param projects + if err := r.SetQueryParam("projects", joinedProjects...); err != nil { + return err + } } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -169,3 +188,20 @@ func (o *GetTerraformConfigurationSourcesUsingGET1Params) WriteToRequest(r runti } return nil } + +// bindParamGetTerraformConfigurationSourcesUsingGET1 binds the parameter projects +func (o *GetTerraformConfigurationSourcesUsingGET1Params) bindParamProjects(formats strfmt.Registry) []string { + projectsIR := o.Projects + + var projectsIC []string + for _, projectsIIR := range projectsIR { // explode []string + + projectsIIV := projectsIIR // string as string + projectsIC = append(projectsIC, projectsIIV) + } + + // items.CollectionFormat: "multi" + projectsIS := swag.JoinByFormat(projectsIC, "multi") + + return projectsIS +} diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_responses.go b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_responses.go index 5ebfc868..9d94ca7c 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_configuration_sources_using_get1_responses.go @@ -41,7 +41,6 @@ func (o *GetTerraformConfigurationSourcesUsingGET1Reader) ReadResponse(response return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetTerraformConfigurationSourcesUsingGET1OK() *GetTerraformConfiguration return &GetTerraformConfigurationSourcesUsingGET1OK{} } -/*GetTerraformConfigurationSourcesUsingGET1OK handles this case with default header values. +/* GetTerraformConfigurationSourcesUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetTerraformConfigurationSourcesUsingGET1OK struct { func (o *GetTerraformConfigurationSourcesUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/get-configuration-sources][%d] getTerraformConfigurationSourcesUsingGET1OK %+v", 200, o.Payload) } - func (o *GetTerraformConfigurationSourcesUsingGET1OK) GetPayload() *models.PageOfBlueprintContentSource { return o.Payload } @@ -85,7 +83,7 @@ func NewGetTerraformConfigurationSourcesUsingGET1Unauthorized() *GetTerraformCon return &GetTerraformConfigurationSourcesUsingGET1Unauthorized{} } -/*GetTerraformConfigurationSourcesUsingGET1Unauthorized handles this case with default header values. +/* GetTerraformConfigurationSourcesUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetTerraformConfigurationSourcesUsingGET1Forbidden() *GetTerraformConfig return &GetTerraformConfigurationSourcesUsingGET1Forbidden{} } -/*GetTerraformConfigurationSourcesUsingGET1Forbidden handles this case with default header values. +/* GetTerraformConfigurationSourcesUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_parameters.go b/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_parameters.go index 1fc4ec89..5c9c13af 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_parameters.go @@ -16,53 +16,54 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetTerraformVersionUsingGET1Params creates a new GetTerraformVersionUsingGET1Params object -// with the default values initialized. +// NewGetTerraformVersionUsingGET1Params creates a new GetTerraformVersionUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTerraformVersionUsingGET1Params() *GetTerraformVersionUsingGET1Params { - var () return &GetTerraformVersionUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetTerraformVersionUsingGET1ParamsWithTimeout creates a new GetTerraformVersionUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTerraformVersionUsingGET1ParamsWithTimeout(timeout time.Duration) *GetTerraformVersionUsingGET1Params { - var () return &GetTerraformVersionUsingGET1Params{ - timeout: timeout, } } // NewGetTerraformVersionUsingGET1ParamsWithContext creates a new GetTerraformVersionUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTerraformVersionUsingGET1ParamsWithContext(ctx context.Context) *GetTerraformVersionUsingGET1Params { - var () return &GetTerraformVersionUsingGET1Params{ - Context: ctx, } } // NewGetTerraformVersionUsingGET1ParamsWithHTTPClient creates a new GetTerraformVersionUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTerraformVersionUsingGET1ParamsWithHTTPClient(client *http.Client) *GetTerraformVersionUsingGET1Params { - var () return &GetTerraformVersionUsingGET1Params{ HTTPClient: client, } } -/*GetTerraformVersionUsingGET1Params contains all the parameters to send to the API endpoint -for the get terraform version using get1 operation typically these are written to a http.Request +/* GetTerraformVersionUsingGET1Params contains all the parameters to send to the API endpoint + for the get terraform version using get1 operation. + + Typically these are written to a http.Request. */ type GetTerraformVersionUsingGET1Params struct { - /*VersionID - versionId + /* VersionID. + + versionId + Format: uuid */ VersionID strfmt.UUID @@ -71,6 +72,21 @@ type GetTerraformVersionUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get terraform version using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformVersionUsingGET1Params) WithDefaults() *GetTerraformVersionUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get terraform version using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTerraformVersionUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get terraform version using get1 params func (o *GetTerraformVersionUsingGET1Params) WithTimeout(timeout time.Duration) *GetTerraformVersionUsingGET1Params { o.SetTimeout(timeout) diff --git a/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_responses.go b/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_responses.go index 36a42ea5..792be6a3 100644 --- a/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/get_terraform_version_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *GetTerraformVersionUsingGET1Reader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetTerraformVersionUsingGET1OK() *GetTerraformVersionUsingGET1OK { return &GetTerraformVersionUsingGET1OK{} } -/*GetTerraformVersionUsingGET1OK handles this case with default header values. +/* GetTerraformVersionUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetTerraformVersionUsingGET1OK struct { func (o *GetTerraformVersionUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/versions/{versionId}][%d] getTerraformVersionUsingGET1OK %+v", 200, o.Payload) } - func (o *GetTerraformVersionUsingGET1OK) GetPayload() *models.TerraformVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewGetTerraformVersionUsingGET1Unauthorized() *GetTerraformVersionUsingGET1 return &GetTerraformVersionUsingGET1Unauthorized{} } -/*GetTerraformVersionUsingGET1Unauthorized handles this case with default header values. +/* GetTerraformVersionUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetTerraformVersionUsingGET1Forbidden() *GetTerraformVersionUsingGET1For return &GetTerraformVersionUsingGET1Forbidden{} } -/*GetTerraformVersionUsingGET1Forbidden handles this case with default header values. +/* GetTerraformVersionUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetTerraformVersionUsingGET1NotFound() *GetTerraformVersionUsingGET1NotF return &GetTerraformVersionUsingGET1NotFound{} } -/*GetTerraformVersionUsingGET1NotFound handles this case with default header values. +/* GetTerraformVersionUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetTerraformVersionUsingGET1NotFound struct { func (o *GetTerraformVersionUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/versions/{versionId}][%d] getTerraformVersionUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetTerraformVersionUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_parameters.go b/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_parameters.go index d1e535b3..6333754a 100644 --- a/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_parameters.go @@ -17,68 +17,74 @@ import ( "github.com/go-openapi/swag" ) -// NewListTerraformVersionsUsingGET1Params creates a new ListTerraformVersionsUsingGET1Params object -// with the default values initialized. +// NewListTerraformVersionsUsingGET1Params creates a new ListTerraformVersionsUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListTerraformVersionsUsingGET1Params() *ListTerraformVersionsUsingGET1Params { - var () return &ListTerraformVersionsUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewListTerraformVersionsUsingGET1ParamsWithTimeout creates a new ListTerraformVersionsUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListTerraformVersionsUsingGET1ParamsWithTimeout(timeout time.Duration) *ListTerraformVersionsUsingGET1Params { - var () return &ListTerraformVersionsUsingGET1Params{ - timeout: timeout, } } // NewListTerraformVersionsUsingGET1ParamsWithContext creates a new ListTerraformVersionsUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListTerraformVersionsUsingGET1ParamsWithContext(ctx context.Context) *ListTerraformVersionsUsingGET1Params { - var () return &ListTerraformVersionsUsingGET1Params{ - Context: ctx, } } // NewListTerraformVersionsUsingGET1ParamsWithHTTPClient creates a new ListTerraformVersionsUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListTerraformVersionsUsingGET1ParamsWithHTTPClient(client *http.Client) *ListTerraformVersionsUsingGET1Params { - var () return &ListTerraformVersionsUsingGET1Params{ HTTPClient: client, } } -/*ListTerraformVersionsUsingGET1Params contains all the parameters to send to the API endpoint -for the list terraform versions using get1 operation typically these are written to a http.Request +/* ListTerraformVersionsUsingGET1Params contains all the parameters to send to the API endpoint + for the list terraform versions using get1 operation. + + Typically these are written to a http.Request. */ type ListTerraformVersionsUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, version. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is descending on updatedAt. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, version. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*OnlyEnabled - Include only enabled versions + /* OnlyEnabled. + + Include only enabled versions */ OnlyEnabled *bool @@ -87,6 +93,21 @@ type ListTerraformVersionsUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list terraform versions using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTerraformVersionsUsingGET1Params) WithDefaults() *ListTerraformVersionsUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list terraform versions using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTerraformVersionsUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list terraform versions using get1 params func (o *ListTerraformVersionsUsingGET1Params) WithTimeout(timeout time.Duration) *ListTerraformVersionsUsingGET1Params { o.SetTimeout(timeout) @@ -172,60 +193,66 @@ func (o *ListTerraformVersionsUsingGET1Params) WriteToRequest(r runtime.ClientRe } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.OnlyEnabled != nil { // query param onlyEnabled var qrOnlyEnabled bool + if o.OnlyEnabled != nil { qrOnlyEnabled = *o.OnlyEnabled } qOnlyEnabled := swag.FormatBool(qrOnlyEnabled) if qOnlyEnabled != "" { + if err := r.SetQueryParam("onlyEnabled", qOnlyEnabled); err != nil { return err } } - } if len(res) > 0 { @@ -233,3 +260,20 @@ func (o *ListTerraformVersionsUsingGET1Params) WriteToRequest(r runtime.ClientRe } return nil } + +// bindParamListTerraformVersionsUsingGET1 binds the parameter $orderby +func (o *ListTerraformVersionsUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_responses.go b/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_responses.go index e549c1f0..b59f6e5b 100644 --- a/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/list_terraform_versions_using_get1_responses.go @@ -47,7 +47,6 @@ func (o *ListTerraformVersionsUsingGET1Reader) ReadResponse(response runtime.Cli return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewListTerraformVersionsUsingGET1OK() *ListTerraformVersionsUsingGET1OK { return &ListTerraformVersionsUsingGET1OK{} } -/*ListTerraformVersionsUsingGET1OK handles this case with default header values. +/* ListTerraformVersionsUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ListTerraformVersionsUsingGET1OK struct { func (o *ListTerraformVersionsUsingGET1OK) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/versions][%d] listTerraformVersionsUsingGET1OK %+v", 200, o.Payload) } - func (o *ListTerraformVersionsUsingGET1OK) GetPayload() *models.PageOfTerraformVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewListTerraformVersionsUsingGET1BadRequest() *ListTerraformVersionsUsingGE return &ListTerraformVersionsUsingGET1BadRequest{} } -/*ListTerraformVersionsUsingGET1BadRequest handles this case with default header values. +/* ListTerraformVersionsUsingGET1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type ListTerraformVersionsUsingGET1BadRequest struct { func (o *ListTerraformVersionsUsingGET1BadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/blueprint-integrations/terraform/versions][%d] listTerraformVersionsUsingGET1BadRequest %+v", 400, o.Payload) } - func (o *ListTerraformVersionsUsingGET1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewListTerraformVersionsUsingGET1Unauthorized() *ListTerraformVersionsUsing return &ListTerraformVersionsUsingGET1Unauthorized{} } -/*ListTerraformVersionsUsingGET1Unauthorized handles this case with default header values. +/* ListTerraformVersionsUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewListTerraformVersionsUsingGET1Forbidden() *ListTerraformVersionsUsingGET return &ListTerraformVersionsUsingGET1Forbidden{} } -/*ListTerraformVersionsUsingGET1Forbidden handles this case with default header values. +/* ListTerraformVersionsUsingGET1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_parameters.go b/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_parameters.go index f378d324..39377b7b 100644 --- a/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_parameters.go +++ b/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_parameters.go @@ -18,58 +18,60 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateTerraformVersionUsingPATCH1Params creates a new UpdateTerraformVersionUsingPATCH1Params object -// with the default values initialized. +// NewUpdateTerraformVersionUsingPATCH1Params creates a new UpdateTerraformVersionUsingPATCH1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateTerraformVersionUsingPATCH1Params() *UpdateTerraformVersionUsingPATCH1Params { - var () return &UpdateTerraformVersionUsingPATCH1Params{ - timeout: cr.DefaultTimeout, } } // NewUpdateTerraformVersionUsingPATCH1ParamsWithTimeout creates a new UpdateTerraformVersionUsingPATCH1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateTerraformVersionUsingPATCH1ParamsWithTimeout(timeout time.Duration) *UpdateTerraformVersionUsingPATCH1Params { - var () return &UpdateTerraformVersionUsingPATCH1Params{ - timeout: timeout, } } // NewUpdateTerraformVersionUsingPATCH1ParamsWithContext creates a new UpdateTerraformVersionUsingPATCH1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateTerraformVersionUsingPATCH1ParamsWithContext(ctx context.Context) *UpdateTerraformVersionUsingPATCH1Params { - var () return &UpdateTerraformVersionUsingPATCH1Params{ - Context: ctx, } } // NewUpdateTerraformVersionUsingPATCH1ParamsWithHTTPClient creates a new UpdateTerraformVersionUsingPATCH1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateTerraformVersionUsingPATCH1ParamsWithHTTPClient(client *http.Client) *UpdateTerraformVersionUsingPATCH1Params { - var () return &UpdateTerraformVersionUsingPATCH1Params{ HTTPClient: client, } } -/*UpdateTerraformVersionUsingPATCH1Params contains all the parameters to send to the API endpoint -for the update terraform version using p a t c h 1 operation typically these are written to a http.Request +/* UpdateTerraformVersionUsingPATCH1Params contains all the parameters to send to the API endpoint + for the update terraform version using p a t c h 1 operation. + + Typically these are written to a http.Request. */ type UpdateTerraformVersionUsingPATCH1Params struct { - /*TerraformVersion - Terraform version object + /* TerraformVersion. + Terraform version object */ TerraformVersion *models.TerraformVersion - /*VersionID - versionId + /* VersionID. + + versionId + + Format: uuid */ VersionID strfmt.UUID @@ -78,6 +80,21 @@ type UpdateTerraformVersionUsingPATCH1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update terraform version using p a t c h 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTerraformVersionUsingPATCH1Params) WithDefaults() *UpdateTerraformVersionUsingPATCH1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update terraform version using p a t c h 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTerraformVersionUsingPATCH1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update terraform version using p a t c h 1 params func (o *UpdateTerraformVersionUsingPATCH1Params) WithTimeout(timeout time.Duration) *UpdateTerraformVersionUsingPATCH1Params { o.SetTimeout(timeout) @@ -140,7 +157,6 @@ func (o *UpdateTerraformVersionUsingPATCH1Params) WriteToRequest(r runtime.Clien return err } var res []error - if o.TerraformVersion != nil { if err := r.SetBodyParam(o.TerraformVersion); err != nil { return err diff --git a/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_responses.go b/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_responses.go index e8fe95b4..5cad4327 100644 --- a/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_responses.go +++ b/pkg/client/blueprint_terraform_integrations/update_terraform_version_using_patch1_responses.go @@ -47,7 +47,6 @@ func (o *UpdateTerraformVersionUsingPATCH1Reader) ReadResponse(response runtime. return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewUpdateTerraformVersionUsingPATCH1OK() *UpdateTerraformVersionUsingPATCH1 return &UpdateTerraformVersionUsingPATCH1OK{} } -/*UpdateTerraformVersionUsingPATCH1OK handles this case with default header values. +/* UpdateTerraformVersionUsingPATCH1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type UpdateTerraformVersionUsingPATCH1OK struct { func (o *UpdateTerraformVersionUsingPATCH1OK) Error() string { return fmt.Sprintf("[PATCH /blueprint/api/blueprint-integrations/terraform/versions/{versionId}][%d] updateTerraformVersionUsingPATCH1OK %+v", 200, o.Payload) } - func (o *UpdateTerraformVersionUsingPATCH1OK) GetPayload() *models.TerraformVersion { return o.Payload } @@ -91,7 +89,7 @@ func NewUpdateTerraformVersionUsingPATCH1Unauthorized() *UpdateTerraformVersionU return &UpdateTerraformVersionUsingPATCH1Unauthorized{} } -/*UpdateTerraformVersionUsingPATCH1Unauthorized handles this case with default header values. +/* UpdateTerraformVersionUsingPATCH1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewUpdateTerraformVersionUsingPATCH1Forbidden() *UpdateTerraformVersionUsin return &UpdateTerraformVersionUsingPATCH1Forbidden{} } -/*UpdateTerraformVersionUsingPATCH1Forbidden handles this case with default header values. +/* UpdateTerraformVersionUsingPATCH1Forbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewUpdateTerraformVersionUsingPATCH1NotFound() *UpdateTerraformVersionUsing return &UpdateTerraformVersionUsingPATCH1NotFound{} } -/*UpdateTerraformVersionUsingPATCH1NotFound handles this case with default header values. +/* UpdateTerraformVersionUsingPATCH1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type UpdateTerraformVersionUsingPATCH1NotFound struct { func (o *UpdateTerraformVersionUsingPATCH1NotFound) Error() string { return fmt.Sprintf("[PATCH /blueprint/api/blueprint-integrations/terraform/versions/{versionId}][%d] updateTerraformVersionUsingPATCH1NotFound %+v", 404, o.Payload) } - func (o *UpdateTerraformVersionUsingPATCH1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/blueprint_validation/blueprint_validation_client.go b/pkg/client/blueprint_validation/blueprint_validation_client.go index dd538323..be7d8f31 100644 --- a/pkg/client/blueprint_validation/blueprint_validation_client.go +++ b/pkg/client/blueprint_validation/blueprint_validation_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ValidateBlueprintUsingPOST1(params *ValidateBlueprintUsingPOST1Params) (*ValidateBlueprintUsingPOST1OK, error) + ValidateBlueprintUsingPOST1(params *ValidateBlueprintUsingPOST1Params, opts ...ClientOption) (*ValidateBlueprintUsingPOST1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* ValidateBlueprintUsingPOST1 validates a blueprint */ -func (a *Client) ValidateBlueprintUsingPOST1(params *ValidateBlueprintUsingPOST1Params) (*ValidateBlueprintUsingPOST1OK, error) { +func (a *Client) ValidateBlueprintUsingPOST1(params *ValidateBlueprintUsingPOST1Params, opts ...ClientOption) (*ValidateBlueprintUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewValidateBlueprintUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "validateBlueprintUsingPOST_1", Method: "POST", PathPattern: "/blueprint/api/blueprint-validation", @@ -52,7 +54,12 @@ func (a *Client) ValidateBlueprintUsingPOST1(params *ValidateBlueprintUsingPOST1 Reader: &ValidateBlueprintUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/blueprint_validation/validate_blueprint_using_post1_parameters.go b/pkg/client/blueprint_validation/validate_blueprint_using_post1_parameters.go index 9a379316..07cfbddb 100644 --- a/pkg/client/blueprint_validation/validate_blueprint_using_post1_parameters.go +++ b/pkg/client/blueprint_validation/validate_blueprint_using_post1_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewValidateBlueprintUsingPOST1Params creates a new ValidateBlueprintUsingPOST1Params object -// with the default values initialized. +// NewValidateBlueprintUsingPOST1Params creates a new ValidateBlueprintUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewValidateBlueprintUsingPOST1Params() *ValidateBlueprintUsingPOST1Params { - var () return &ValidateBlueprintUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewValidateBlueprintUsingPOST1ParamsWithTimeout creates a new ValidateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewValidateBlueprintUsingPOST1ParamsWithTimeout(timeout time.Duration) *ValidateBlueprintUsingPOST1Params { - var () return &ValidateBlueprintUsingPOST1Params{ - timeout: timeout, } } // NewValidateBlueprintUsingPOST1ParamsWithContext creates a new ValidateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewValidateBlueprintUsingPOST1ParamsWithContext(ctx context.Context) *ValidateBlueprintUsingPOST1Params { - var () return &ValidateBlueprintUsingPOST1Params{ - Context: ctx, } } // NewValidateBlueprintUsingPOST1ParamsWithHTTPClient creates a new ValidateBlueprintUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewValidateBlueprintUsingPOST1ParamsWithHTTPClient(client *http.Client) *ValidateBlueprintUsingPOST1Params { - var () return &ValidateBlueprintUsingPOST1Params{ HTTPClient: client, } } -/*ValidateBlueprintUsingPOST1Params contains all the parameters to send to the API endpoint -for the validate blueprint using p o s t 1 operation typically these are written to a http.Request +/* ValidateBlueprintUsingPOST1Params contains all the parameters to send to the API endpoint + for the validate blueprint using p o s t 1 operation. + + Typically these are written to a http.Request. */ type ValidateBlueprintUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Request - request + /* Request. + + request */ Request *models.BlueprintValidationRequest @@ -78,6 +78,21 @@ type ValidateBlueprintUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the validate blueprint using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateBlueprintUsingPOST1Params) WithDefaults() *ValidateBlueprintUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate blueprint using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateBlueprintUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the validate blueprint using p o s t 1 params func (o *ValidateBlueprintUsingPOST1Params) WithTimeout(timeout time.Duration) *ValidateBlueprintUsingPOST1Params { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *ValidateBlueprintUsingPOST1Params) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/blueprint_validation/validate_blueprint_using_post1_responses.go b/pkg/client/blueprint_validation/validate_blueprint_using_post1_responses.go index a8bac126..792de9db 100644 --- a/pkg/client/blueprint_validation/validate_blueprint_using_post1_responses.go +++ b/pkg/client/blueprint_validation/validate_blueprint_using_post1_responses.go @@ -47,7 +47,6 @@ func (o *ValidateBlueprintUsingPOST1Reader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewValidateBlueprintUsingPOST1OK() *ValidateBlueprintUsingPOST1OK { return &ValidateBlueprintUsingPOST1OK{} } -/*ValidateBlueprintUsingPOST1OK handles this case with default header values. +/* ValidateBlueprintUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ValidateBlueprintUsingPOST1OK struct { func (o *ValidateBlueprintUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-validation][%d] validateBlueprintUsingPOST1OK %+v", 200, o.Payload) } - func (o *ValidateBlueprintUsingPOST1OK) GetPayload() *models.BlueprintValidationResponse { return o.Payload } @@ -91,7 +89,7 @@ func NewValidateBlueprintUsingPOST1BadRequest() *ValidateBlueprintUsingPOST1BadR return &ValidateBlueprintUsingPOST1BadRequest{} } -/*ValidateBlueprintUsingPOST1BadRequest handles this case with default header values. +/* ValidateBlueprintUsingPOST1BadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type ValidateBlueprintUsingPOST1BadRequest struct { func (o *ValidateBlueprintUsingPOST1BadRequest) Error() string { return fmt.Sprintf("[POST /blueprint/api/blueprint-validation][%d] validateBlueprintUsingPOST1BadRequest %+v", 400, o.Payload) } - func (o *ValidateBlueprintUsingPOST1BadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewValidateBlueprintUsingPOST1Unauthorized() *ValidateBlueprintUsingPOST1Un return &ValidateBlueprintUsingPOST1Unauthorized{} } -/*ValidateBlueprintUsingPOST1Unauthorized handles this case with default header values. +/* ValidateBlueprintUsingPOST1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewValidateBlueprintUsingPOST1Forbidden() *ValidateBlueprintUsingPOST1Forbi return &ValidateBlueprintUsingPOST1Forbidden{} } -/*ValidateBlueprintUsingPOST1Forbidden handles this case with default header values. +/* ValidateBlueprintUsingPOST1Forbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/catalog_admin_items/catalog_admin_items_client.go b/pkg/client/catalog_admin_items/catalog_admin_items_client.go index 4629526c..1cfc189b 100644 --- a/pkg/client/catalog_admin_items/catalog_admin_items_client.go +++ b/pkg/client/catalog_admin_items/catalog_admin_items_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams) (*GetCatalogItemUsingGETOK, error) + GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams, opts ...ClientOption) (*GetCatalogItemUsingGETOK, error) - GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams) (*GetCatalogItemsUsingGETOK, error) + GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams, opts ...ClientOption) (*GetCatalogItemsUsingGETOK, error) - UpdateCatalogItemUsingPATCH(params *UpdateCatalogItemUsingPATCHParams) (*UpdateCatalogItemUsingPATCHOK, error) + UpdateCatalogItemUsingPATCH(params *UpdateCatalogItemUsingPATCHParams, opts ...ClientOption) (*UpdateCatalogItemUsingPATCHOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Returns the catalog item with the specified id. */ -func (a *Client) GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams) (*GetCatalogItemUsingGETOK, error) { +func (a *Client) GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams, opts ...ClientOption) (*GetCatalogItemUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCatalogItemUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCatalogItemUsingGET", Method: "GET", PathPattern: "/catalog/api/admin/items/{id}", @@ -58,7 +60,12 @@ func (a *Client) GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams) (* Reader: &GetCatalogItemUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) GetCatalogItemUsingGET(params *GetCatalogItemUsingGETParams) (* Returns a paginated list of catalog items. */ -func (a *Client) GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams) (*GetCatalogItemsUsingGETOK, error) { +func (a *Client) GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams, opts ...ClientOption) (*GetCatalogItemsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCatalogItemsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCatalogItemsUsingGET", Method: "GET", PathPattern: "/catalog/api/admin/items", @@ -94,7 +100,12 @@ func (a *Client) GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams) Reader: &GetCatalogItemsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) GetCatalogItemsUsingGET(params *GetCatalogItemsUsingGETParams) Updates a catalog item with specified icon id or request limit. */ -func (a *Client) UpdateCatalogItemUsingPATCH(params *UpdateCatalogItemUsingPATCHParams) (*UpdateCatalogItemUsingPATCHOK, error) { +func (a *Client) UpdateCatalogItemUsingPATCH(params *UpdateCatalogItemUsingPATCHParams, opts ...ClientOption) (*UpdateCatalogItemUsingPATCHOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateCatalogItemUsingPATCHParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateCatalogItemUsingPATCH", Method: "PATCH", PathPattern: "/catalog/api/admin/items/{id}", @@ -130,7 +140,12 @@ func (a *Client) UpdateCatalogItemUsingPATCH(params *UpdateCatalogItemUsingPATCH Reader: &UpdateCatalogItemUsingPATCHReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/catalog_admin_items/get_catalog_item_using_get_parameters.go b/pkg/client/catalog_admin_items/get_catalog_item_using_get_parameters.go index 09e9f0a7..6a948f65 100644 --- a/pkg/client/catalog_admin_items/get_catalog_item_using_get_parameters.go +++ b/pkg/client/catalog_admin_items/get_catalog_item_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCatalogItemUsingGETParams creates a new GetCatalogItemUsingGETParams object -// with the default values initialized. +// NewGetCatalogItemUsingGETParams creates a new GetCatalogItemUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCatalogItemUsingGETParams() *GetCatalogItemUsingGETParams { - var () return &GetCatalogItemUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetCatalogItemUsingGETParamsWithTimeout creates a new GetCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCatalogItemUsingGETParamsWithTimeout(timeout time.Duration) *GetCatalogItemUsingGETParams { - var () return &GetCatalogItemUsingGETParams{ - timeout: timeout, } } // NewGetCatalogItemUsingGETParamsWithContext creates a new GetCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCatalogItemUsingGETParamsWithContext(ctx context.Context) *GetCatalogItemUsingGETParams { - var () return &GetCatalogItemUsingGETParams{ - Context: ctx, } } // NewGetCatalogItemUsingGETParamsWithHTTPClient creates a new GetCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCatalogItemUsingGETParamsWithHTTPClient(client *http.Client) *GetCatalogItemUsingGETParams { - var () return &GetCatalogItemUsingGETParams{ HTTPClient: client, } } -/*GetCatalogItemUsingGETParams contains all the parameters to send to the API endpoint -for the get catalog item using g e t operation typically these are written to a http.Request +/* GetCatalogItemUsingGETParams contains all the parameters to send to the API endpoint + for the get catalog item using g e t operation. + + Typically these are written to a http.Request. */ type GetCatalogItemUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog item id + /* ID. + + Catalog item id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetCatalogItemUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get catalog item using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemUsingGETParams) WithDefaults() *GetCatalogItemUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get catalog item using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get catalog item using get params func (o *GetCatalogItemUsingGETParams) WithTimeout(timeout time.Duration) *GetCatalogItemUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetCatalogItemUsingGETParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_admin_items/get_catalog_item_using_get_responses.go b/pkg/client/catalog_admin_items/get_catalog_item_using_get_responses.go index a173dc35..afa1f0f6 100644 --- a/pkg/client/catalog_admin_items/get_catalog_item_using_get_responses.go +++ b/pkg/client/catalog_admin_items/get_catalog_item_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetCatalogItemUsingGETReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetCatalogItemUsingGETOK() *GetCatalogItemUsingGETOK { return &GetCatalogItemUsingGETOK{} } -/*GetCatalogItemUsingGETOK handles this case with default header values. +/* GetCatalogItemUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetCatalogItemUsingGETOK struct { func (o *GetCatalogItemUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/items/{id}][%d] getCatalogItemUsingGETOK %+v", 200, o.Payload) } - func (o *GetCatalogItemUsingGETOK) GetPayload() *models.CatalogItem { return o.Payload } @@ -85,7 +83,7 @@ func NewGetCatalogItemUsingGETUnauthorized() *GetCatalogItemUsingGETUnauthorized return &GetCatalogItemUsingGETUnauthorized{} } -/*GetCatalogItemUsingGETUnauthorized handles this case with default header values. +/* GetCatalogItemUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetCatalogItemUsingGETNotFound() *GetCatalogItemUsingGETNotFound { return &GetCatalogItemUsingGETNotFound{} } -/*GetCatalogItemUsingGETNotFound handles this case with default header values. +/* GetCatalogItemUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetCatalogItemUsingGETNotFound struct { func (o *GetCatalogItemUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/items/{id}][%d] getCatalogItemUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetCatalogItemUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_admin_items/get_catalog_items_using_get_parameters.go b/pkg/client/catalog_admin_items/get_catalog_items_using_get_parameters.go index 5047ee02..3bd13040 100644 --- a/pkg/client/catalog_admin_items/get_catalog_items_using_get_parameters.go +++ b/pkg/client/catalog_admin_items/get_catalog_items_using_get_parameters.go @@ -17,88 +17,98 @@ import ( "github.com/go-openapi/swag" ) -// NewGetCatalogItemsUsingGETParams creates a new GetCatalogItemsUsingGETParams object -// with the default values initialized. +// NewGetCatalogItemsUsingGETParams creates a new GetCatalogItemsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCatalogItemsUsingGETParams() *GetCatalogItemsUsingGETParams { - var () return &GetCatalogItemsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetCatalogItemsUsingGETParamsWithTimeout creates a new GetCatalogItemsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCatalogItemsUsingGETParamsWithTimeout(timeout time.Duration) *GetCatalogItemsUsingGETParams { - var () return &GetCatalogItemsUsingGETParams{ - timeout: timeout, } } // NewGetCatalogItemsUsingGETParamsWithContext creates a new GetCatalogItemsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCatalogItemsUsingGETParamsWithContext(ctx context.Context) *GetCatalogItemsUsingGETParams { - var () return &GetCatalogItemsUsingGETParams{ - Context: ctx, } } // NewGetCatalogItemsUsingGETParamsWithHTTPClient creates a new GetCatalogItemsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCatalogItemsUsingGETParamsWithHTTPClient(client *http.Client) *GetCatalogItemsUsingGETParams { - var () return &GetCatalogItemsUsingGETParams{ HTTPClient: client, } } -/*GetCatalogItemsUsingGETParams contains all the parameters to send to the API endpoint -for the get catalog items using g e t operation typically these are written to a http.Request +/* GetCatalogItemsUsingGETParams contains all the parameters to send to the API endpoint + for the get catalog items using g e t operation. + + Typically these are written to a http.Request. */ type GetCatalogItemsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ProjectID - projectId + /* ProjectID. + + projectId */ ProjectID *string - /*Search - search + /* Search. + + search */ Search *string - /*SourceIds - sourceIds + /* SourceIds. + + sourceIds */ SourceIds []strfmt.UUID - /*Types - types + /* Types. + + types */ Types []string @@ -107,6 +117,21 @@ type GetCatalogItemsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get catalog items using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemsUsingGETParams) WithDefaults() *GetCatalogItemsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get catalog items using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get catalog items using get params func (o *GetCatalogItemsUsingGETParams) WithTimeout(timeout time.Duration) *GetCatalogItemsUsingGETParams { o.SetTimeout(timeout) @@ -236,111 +261,122 @@ func (o *GetCatalogItemsUsingGETParams) WriteToRequest(r runtime.ClientRequest, } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ProjectID != nil { // query param projectId var qrProjectID string + if o.ProjectID != nil { qrProjectID = *o.ProjectID } qProjectID := qrProjectID if qProjectID != "" { + if err := r.SetQueryParam("projectId", qProjectID); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } - var valuesSourceIds []string - for _, v := range o.SourceIds { - valuesSourceIds = append(valuesSourceIds, v.String()) - } + if o.SourceIds != nil { - joinedSourceIds := swag.JoinByFormat(valuesSourceIds, "multi") - // query array param sourceIds - if err := r.SetQueryParam("sourceIds", joinedSourceIds...); err != nil { - return err + // binding items for sourceIds + joinedSourceIds := o.bindParamSourceIds(reg) + + // query array param sourceIds + if err := r.SetQueryParam("sourceIds", joinedSourceIds...); err != nil { + return err + } } - valuesTypes := o.Types + if o.Types != nil { - joinedTypes := swag.JoinByFormat(valuesTypes, "multi") - // query array param types - if err := r.SetQueryParam("types", joinedTypes...); err != nil { - return err + // binding items for types + joinedTypes := o.bindParamTypes(reg) + + // query array param types + if err := r.SetQueryParam("types", joinedTypes...); err != nil { + return err + } } if len(res) > 0 { @@ -348,3 +384,54 @@ func (o *GetCatalogItemsUsingGETParams) WriteToRequest(r runtime.ClientRequest, } return nil } + +// bindParamGetCatalogItemsUsingGET binds the parameter $orderby +func (o *GetCatalogItemsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamGetCatalogItemsUsingGET binds the parameter sourceIds +func (o *GetCatalogItemsUsingGETParams) bindParamSourceIds(formats strfmt.Registry) []string { + sourceIdsIR := o.SourceIds + + var sourceIdsIC []string + for _, sourceIdsIIR := range sourceIdsIR { // explode []strfmt.UUID + + sourceIdsIIV := sourceIdsIIR.String() // strfmt.UUID as string + sourceIdsIC = append(sourceIdsIC, sourceIdsIIV) + } + + // items.CollectionFormat: "multi" + sourceIdsIS := swag.JoinByFormat(sourceIdsIC, "multi") + + return sourceIdsIS +} + +// bindParamGetCatalogItemsUsingGET binds the parameter types +func (o *GetCatalogItemsUsingGETParams) bindParamTypes(formats strfmt.Registry) []string { + typesIR := o.Types + + var typesIC []string + for _, typesIIR := range typesIR { // explode []string + + typesIIV := typesIIR // string as string + typesIC = append(typesIC, typesIIV) + } + + // items.CollectionFormat: "multi" + typesIS := swag.JoinByFormat(typesIC, "multi") + + return typesIS +} diff --git a/pkg/client/catalog_admin_items/get_catalog_items_using_get_responses.go b/pkg/client/catalog_admin_items/get_catalog_items_using_get_responses.go index 7a786f2d..2495ab99 100644 --- a/pkg/client/catalog_admin_items/get_catalog_items_using_get_responses.go +++ b/pkg/client/catalog_admin_items/get_catalog_items_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetCatalogItemsUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetCatalogItemsUsingGETOK() *GetCatalogItemsUsingGETOK { return &GetCatalogItemsUsingGETOK{} } -/*GetCatalogItemsUsingGETOK handles this case with default header values. +/* GetCatalogItemsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetCatalogItemsUsingGETOK struct { func (o *GetCatalogItemsUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/items][%d] getCatalogItemsUsingGETOK %+v", 200, o.Payload) } - func (o *GetCatalogItemsUsingGETOK) GetPayload() *models.PageOfCatalogItem { return o.Payload } @@ -79,7 +77,7 @@ func NewGetCatalogItemsUsingGETUnauthorized() *GetCatalogItemsUsingGETUnauthoriz return &GetCatalogItemsUsingGETUnauthorized{} } -/*GetCatalogItemsUsingGETUnauthorized handles this case with default header values. +/* GetCatalogItemsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_admin_items/update_catalog_item_using_patch_parameters.go b/pkg/client/catalog_admin_items/update_catalog_item_using_patch_parameters.go index ce486c30..bf63b302 100644 --- a/pkg/client/catalog_admin_items/update_catalog_item_using_patch_parameters.go +++ b/pkg/client/catalog_admin_items/update_catalog_item_using_patch_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateCatalogItemUsingPATCHParams creates a new UpdateCatalogItemUsingPATCHParams object -// with the default values initialized. +// NewUpdateCatalogItemUsingPATCHParams creates a new UpdateCatalogItemUsingPATCHParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateCatalogItemUsingPATCHParams() *UpdateCatalogItemUsingPATCHParams { - var () return &UpdateCatalogItemUsingPATCHParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateCatalogItemUsingPATCHParamsWithTimeout creates a new UpdateCatalogItemUsingPATCHParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateCatalogItemUsingPATCHParamsWithTimeout(timeout time.Duration) *UpdateCatalogItemUsingPATCHParams { - var () return &UpdateCatalogItemUsingPATCHParams{ - timeout: timeout, } } // NewUpdateCatalogItemUsingPATCHParamsWithContext creates a new UpdateCatalogItemUsingPATCHParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateCatalogItemUsingPATCHParamsWithContext(ctx context.Context) *UpdateCatalogItemUsingPATCHParams { - var () return &UpdateCatalogItemUsingPATCHParams{ - Context: ctx, } } // NewUpdateCatalogItemUsingPATCHParamsWithHTTPClient creates a new UpdateCatalogItemUsingPATCHParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateCatalogItemUsingPATCHParamsWithHTTPClient(client *http.Client) *UpdateCatalogItemUsingPATCHParams { - var () return &UpdateCatalogItemUsingPATCHParams{ HTTPClient: client, } } -/*UpdateCatalogItemUsingPATCHParams contains all the parameters to send to the API endpoint -for the update catalog item using p a t c h operation typically these are written to a http.Request +/* UpdateCatalogItemUsingPATCHParams contains all the parameters to send to the API endpoint + for the update catalog item using p a t c h operation. + + Typically these are written to a http.Request. */ type UpdateCatalogItemUsingPATCHParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - The unique id of item to update. + /* ID. + + The unique id of item to update. + + Format: uuid */ ID strfmt.UUID - /*Patch - The patch that apply to the item + /* Patch. + + The patch that apply to the item */ Patch *models.AdminCatalogItemPatch @@ -83,6 +86,21 @@ type UpdateCatalogItemUsingPATCHParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update catalog item using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCatalogItemUsingPATCHParams) WithDefaults() *UpdateCatalogItemUsingPATCHParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update catalog item using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCatalogItemUsingPATCHParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update catalog item using p a t c h params func (o *UpdateCatalogItemUsingPATCHParams) WithTimeout(timeout time.Duration) *UpdateCatalogItemUsingPATCHParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *UpdateCatalogItemUsingPATCHParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id if err := r.SetPathParam("id", o.ID.String()); err != nil { return err } - if o.Patch != nil { if err := r.SetBodyParam(o.Patch); err != nil { return err diff --git a/pkg/client/catalog_admin_items/update_catalog_item_using_patch_responses.go b/pkg/client/catalog_admin_items/update_catalog_item_using_patch_responses.go index 41ed55fa..1539143a 100644 --- a/pkg/client/catalog_admin_items/update_catalog_item_using_patch_responses.go +++ b/pkg/client/catalog_admin_items/update_catalog_item_using_patch_responses.go @@ -32,7 +32,6 @@ func (o *UpdateCatalogItemUsingPATCHReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +42,7 @@ func NewUpdateCatalogItemUsingPATCHOK() *UpdateCatalogItemUsingPATCHOK { return &UpdateCatalogItemUsingPATCHOK{} } -/*UpdateCatalogItemUsingPATCHOK handles this case with default header values. +/* UpdateCatalogItemUsingPATCHOK describes a response with status code 200, with default header values. OK */ @@ -64,7 +63,7 @@ func NewUpdateCatalogItemUsingPATCHUnauthorized() *UpdateCatalogItemUsingPATCHUn return &UpdateCatalogItemUsingPATCHUnauthorized{} } -/*UpdateCatalogItemUsingPATCHUnauthorized handles this case with default header values. +/* UpdateCatalogItemUsingPATCHUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_entitlements/catalog_entitlements_client.go b/pkg/client/catalog_entitlements/catalog_entitlements_client.go index 33414cfc..6d327e5d 100644 --- a/pkg/client/catalog_entitlements/catalog_entitlements_client.go +++ b/pkg/client/catalog_entitlements/catalog_entitlements_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTParams) (*CreateEntitlementUsingPOSTOK, *CreateEntitlementUsingPOSTCreated, error) + CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTParams, opts ...ClientOption) (*CreateEntitlementUsingPOSTOK, *CreateEntitlementUsingPOSTCreated, error) - DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELETEParams) (*DeleteEntitlementUsingDELETENoContent, error) + DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELETEParams, opts ...ClientOption) (*DeleteEntitlementUsingDELETENoContent, error) - GetEntitlementsUsingGET(params *GetEntitlementsUsingGETParams) (*GetEntitlementsUsingGETOK, error) + GetEntitlementsUsingGET(params *GetEntitlementsUsingGETParams, opts ...ClientOption) (*GetEntitlementsUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Creates an entitlement for a given project. */ -func (a *Client) CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTParams) (*CreateEntitlementUsingPOSTOK, *CreateEntitlementUsingPOSTCreated, error) { +func (a *Client) CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTParams, opts ...ClientOption) (*CreateEntitlementUsingPOSTOK, *CreateEntitlementUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateEntitlementUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createEntitlementUsingPOST", Method: "POST", PathPattern: "/catalog/api/admin/entitlements", @@ -58,7 +60,12 @@ func (a *Client) CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTPa Reader: &CreateEntitlementUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -78,13 +85,12 @@ func (a *Client) CreateEntitlementUsingPOST(params *CreateEntitlementUsingPOSTPa Deletes the entitlement with the specified id. */ -func (a *Client) DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELETEParams) (*DeleteEntitlementUsingDELETENoContent, error) { +func (a *Client) DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELETEParams, opts ...ClientOption) (*DeleteEntitlementUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteEntitlementUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteEntitlementUsingDELETE", Method: "DELETE", PathPattern: "/catalog/api/admin/entitlements/{id}", @@ -95,7 +101,12 @@ func (a *Client) DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELE Reader: &DeleteEntitlementUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -114,13 +125,12 @@ func (a *Client) DeleteEntitlementUsingDELETE(params *DeleteEntitlementUsingDELE Returns all entitlements (filtered by projectId). */ -func (a *Client) GetEntitlementsUsingGET(params *GetEntitlementsUsingGETParams) (*GetEntitlementsUsingGETOK, error) { +func (a *Client) GetEntitlementsUsingGET(params *GetEntitlementsUsingGETParams, opts ...ClientOption) (*GetEntitlementsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetEntitlementsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getEntitlementsUsingGET", Method: "GET", PathPattern: "/catalog/api/admin/entitlements", @@ -131,7 +141,12 @@ func (a *Client) GetEntitlementsUsingGET(params *GetEntitlementsUsingGETParams) Reader: &GetEntitlementsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/catalog_entitlements/create_entitlement_using_post_parameters.go b/pkg/client/catalog_entitlements/create_entitlement_using_post_parameters.go index ec5bb103..61b32feb 100644 --- a/pkg/client/catalog_entitlements/create_entitlement_using_post_parameters.go +++ b/pkg/client/catalog_entitlements/create_entitlement_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateEntitlementUsingPOSTParams creates a new CreateEntitlementUsingPOSTParams object -// with the default values initialized. +// NewCreateEntitlementUsingPOSTParams creates a new CreateEntitlementUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateEntitlementUsingPOSTParams() *CreateEntitlementUsingPOSTParams { - var () return &CreateEntitlementUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreateEntitlementUsingPOSTParamsWithTimeout creates a new CreateEntitlementUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateEntitlementUsingPOSTParamsWithTimeout(timeout time.Duration) *CreateEntitlementUsingPOSTParams { - var () return &CreateEntitlementUsingPOSTParams{ - timeout: timeout, } } // NewCreateEntitlementUsingPOSTParamsWithContext creates a new CreateEntitlementUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateEntitlementUsingPOSTParamsWithContext(ctx context.Context) *CreateEntitlementUsingPOSTParams { - var () return &CreateEntitlementUsingPOSTParams{ - Context: ctx, } } // NewCreateEntitlementUsingPOSTParamsWithHTTPClient creates a new CreateEntitlementUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateEntitlementUsingPOSTParamsWithHTTPClient(client *http.Client) *CreateEntitlementUsingPOSTParams { - var () return &CreateEntitlementUsingPOSTParams{ HTTPClient: client, } } -/*CreateEntitlementUsingPOSTParams contains all the parameters to send to the API endpoint -for the create entitlement using p o s t operation typically these are written to a http.Request +/* CreateEntitlementUsingPOSTParams contains all the parameters to send to the API endpoint + for the create entitlement using p o s t operation. + + Typically these are written to a http.Request. */ type CreateEntitlementUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Entitlement - The entitlement to be created + /* Entitlement. + + The entitlement to be created */ Entitlement *models.Entitlement @@ -78,6 +78,21 @@ type CreateEntitlementUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create entitlement using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEntitlementUsingPOSTParams) WithDefaults() *CreateEntitlementUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create entitlement using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEntitlementUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create entitlement using p o s t params func (o *CreateEntitlementUsingPOSTParams) WithTimeout(timeout time.Duration) *CreateEntitlementUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateEntitlementUsingPOSTParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Entitlement != nil { if err := r.SetBodyParam(o.Entitlement); err != nil { return err diff --git a/pkg/client/catalog_entitlements/create_entitlement_using_post_responses.go b/pkg/client/catalog_entitlements/create_entitlement_using_post_responses.go index 7b9e2031..a9ab8443 100644 --- a/pkg/client/catalog_entitlements/create_entitlement_using_post_responses.go +++ b/pkg/client/catalog_entitlements/create_entitlement_using_post_responses.go @@ -53,7 +53,6 @@ func (o *CreateEntitlementUsingPOSTReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewCreateEntitlementUsingPOSTOK() *CreateEntitlementUsingPOSTOK { return &CreateEntitlementUsingPOSTOK{} } -/*CreateEntitlementUsingPOSTOK handles this case with default header values. +/* CreateEntitlementUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -75,7 +74,6 @@ type CreateEntitlementUsingPOSTOK struct { func (o *CreateEntitlementUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/entitlements][%d] createEntitlementUsingPOSTOK %+v", 200, o.Payload) } - func (o *CreateEntitlementUsingPOSTOK) GetPayload() *models.Entitlement { return o.Payload } @@ -97,7 +95,7 @@ func NewCreateEntitlementUsingPOSTCreated() *CreateEntitlementUsingPOSTCreated { return &CreateEntitlementUsingPOSTCreated{} } -/*CreateEntitlementUsingPOSTCreated handles this case with default header values. +/* CreateEntitlementUsingPOSTCreated describes a response with status code 201, with default header values. Created */ @@ -108,7 +106,6 @@ type CreateEntitlementUsingPOSTCreated struct { func (o *CreateEntitlementUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/entitlements][%d] createEntitlementUsingPOSTCreated %+v", 201, o.Payload) } - func (o *CreateEntitlementUsingPOSTCreated) GetPayload() *models.Entitlement { return o.Payload } @@ -130,7 +127,7 @@ func NewCreateEntitlementUsingPOSTBadRequest() *CreateEntitlementUsingPOSTBadReq return &CreateEntitlementUsingPOSTBadRequest{} } -/*CreateEntitlementUsingPOSTBadRequest handles this case with default header values. +/* CreateEntitlementUsingPOSTBadRequest describes a response with status code 400, with default header values. Catalog item or source cannot be entitled to the project */ @@ -141,7 +138,6 @@ type CreateEntitlementUsingPOSTBadRequest struct { func (o *CreateEntitlementUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/entitlements][%d] createEntitlementUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *CreateEntitlementUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -163,7 +159,7 @@ func NewCreateEntitlementUsingPOSTUnauthorized() *CreateEntitlementUsingPOSTUnau return &CreateEntitlementUsingPOSTUnauthorized{} } -/*CreateEntitlementUsingPOSTUnauthorized handles this case with default header values. +/* CreateEntitlementUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -184,7 +180,7 @@ func NewCreateEntitlementUsingPOSTNotFound() *CreateEntitlementUsingPOSTNotFound return &CreateEntitlementUsingPOSTNotFound{} } -/*CreateEntitlementUsingPOSTNotFound handles this case with default header values. +/* CreateEntitlementUsingPOSTNotFound describes a response with status code 404, with default header values. Catalog item or catalog source not found */ @@ -195,7 +191,6 @@ type CreateEntitlementUsingPOSTNotFound struct { func (o *CreateEntitlementUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/entitlements][%d] createEntitlementUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *CreateEntitlementUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_entitlements/delete_entitlement_using_delete_parameters.go b/pkg/client/catalog_entitlements/delete_entitlement_using_delete_parameters.go index d1a2a48f..28e4c9ab 100644 --- a/pkg/client/catalog_entitlements/delete_entitlement_using_delete_parameters.go +++ b/pkg/client/catalog_entitlements/delete_entitlement_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteEntitlementUsingDELETEParams creates a new DeleteEntitlementUsingDELETEParams object -// with the default values initialized. +// NewDeleteEntitlementUsingDELETEParams creates a new DeleteEntitlementUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteEntitlementUsingDELETEParams() *DeleteEntitlementUsingDELETEParams { - var () return &DeleteEntitlementUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteEntitlementUsingDELETEParamsWithTimeout creates a new DeleteEntitlementUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteEntitlementUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteEntitlementUsingDELETEParams { - var () return &DeleteEntitlementUsingDELETEParams{ - timeout: timeout, } } // NewDeleteEntitlementUsingDELETEParamsWithContext creates a new DeleteEntitlementUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteEntitlementUsingDELETEParamsWithContext(ctx context.Context) *DeleteEntitlementUsingDELETEParams { - var () return &DeleteEntitlementUsingDELETEParams{ - Context: ctx, } } // NewDeleteEntitlementUsingDELETEParamsWithHTTPClient creates a new DeleteEntitlementUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteEntitlementUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteEntitlementUsingDELETEParams { - var () return &DeleteEntitlementUsingDELETEParams{ HTTPClient: client, } } -/*DeleteEntitlementUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete entitlement using d e l e t e operation typically these are written to a http.Request +/* DeleteEntitlementUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete entitlement using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteEntitlementUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Entitlement id + /* ID. + + Entitlement id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteEntitlementUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete entitlement using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEntitlementUsingDELETEParams) WithDefaults() *DeleteEntitlementUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete entitlement using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEntitlementUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete entitlement using d e l e t e params func (o *DeleteEntitlementUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteEntitlementUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteEntitlementUsingDELETEParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_entitlements/delete_entitlement_using_delete_responses.go b/pkg/client/catalog_entitlements/delete_entitlement_using_delete_responses.go index 12b7064a..b41eace2 100644 --- a/pkg/client/catalog_entitlements/delete_entitlement_using_delete_responses.go +++ b/pkg/client/catalog_entitlements/delete_entitlement_using_delete_responses.go @@ -32,7 +32,6 @@ func (o *DeleteEntitlementUsingDELETEReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +42,7 @@ func NewDeleteEntitlementUsingDELETENoContent() *DeleteEntitlementUsingDELETENoC return &DeleteEntitlementUsingDELETENoContent{} } -/*DeleteEntitlementUsingDELETENoContent handles this case with default header values. +/* DeleteEntitlementUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ @@ -64,7 +63,7 @@ func NewDeleteEntitlementUsingDELETEUnauthorized() *DeleteEntitlementUsingDELETE return &DeleteEntitlementUsingDELETEUnauthorized{} } -/*DeleteEntitlementUsingDELETEUnauthorized handles this case with default header values. +/* DeleteEntitlementUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_entitlements/get_entitlements_using_get_parameters.go b/pkg/client/catalog_entitlements/get_entitlements_using_get_parameters.go index 678aedae..24f03278 100644 --- a/pkg/client/catalog_entitlements/get_entitlements_using_get_parameters.go +++ b/pkg/client/catalog_entitlements/get_entitlements_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetEntitlementsUsingGETParams creates a new GetEntitlementsUsingGETParams object -// with the default values initialized. +// NewGetEntitlementsUsingGETParams creates a new GetEntitlementsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetEntitlementsUsingGETParams() *GetEntitlementsUsingGETParams { - var () return &GetEntitlementsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetEntitlementsUsingGETParamsWithTimeout creates a new GetEntitlementsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetEntitlementsUsingGETParamsWithTimeout(timeout time.Duration) *GetEntitlementsUsingGETParams { - var () return &GetEntitlementsUsingGETParams{ - timeout: timeout, } } // NewGetEntitlementsUsingGETParamsWithContext creates a new GetEntitlementsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetEntitlementsUsingGETParamsWithContext(ctx context.Context) *GetEntitlementsUsingGETParams { - var () return &GetEntitlementsUsingGETParams{ - Context: ctx, } } // NewGetEntitlementsUsingGETParamsWithHTTPClient creates a new GetEntitlementsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetEntitlementsUsingGETParamsWithHTTPClient(client *http.Client) *GetEntitlementsUsingGETParams { - var () return &GetEntitlementsUsingGETParams{ HTTPClient: client, } } -/*GetEntitlementsUsingGETParams contains all the parameters to send to the API endpoint -for the get entitlements using g e t operation typically these are written to a http.Request +/* GetEntitlementsUsingGETParams contains all the parameters to send to the API endpoint + for the get entitlements using g e t operation. + + Typically these are written to a http.Request. */ type GetEntitlementsUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ProjectID - The project id for which to return . + /* ProjectID. + + The project id for which to return . */ ProjectID *string @@ -76,6 +76,21 @@ type GetEntitlementsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get entitlements using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEntitlementsUsingGETParams) WithDefaults() *GetEntitlementsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get entitlements using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEntitlementsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get entitlements using get params func (o *GetEntitlementsUsingGETParams) WithTimeout(timeout time.Duration) *GetEntitlementsUsingGETParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetEntitlementsUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ProjectID != nil { // query param projectId var qrProjectID string + if o.ProjectID != nil { qrProjectID = *o.ProjectID } qProjectID := qrProjectID if qProjectID != "" { + if err := r.SetQueryParam("projectId", qProjectID); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/catalog_entitlements/get_entitlements_using_get_responses.go b/pkg/client/catalog_entitlements/get_entitlements_using_get_responses.go index 1e47b029..dfcdf86d 100644 --- a/pkg/client/catalog_entitlements/get_entitlements_using_get_responses.go +++ b/pkg/client/catalog_entitlements/get_entitlements_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetEntitlementsUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetEntitlementsUsingGETOK() *GetEntitlementsUsingGETOK { return &GetEntitlementsUsingGETOK{} } -/*GetEntitlementsUsingGETOK handles this case with default header values. +/* GetEntitlementsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetEntitlementsUsingGETOK struct { func (o *GetEntitlementsUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/entitlements][%d] getEntitlementsUsingGETOK %+v", 200, o.Payload) } - func (o *GetEntitlementsUsingGETOK) GetPayload() []*models.Entitlement { return o.Payload } @@ -77,7 +75,7 @@ func NewGetEntitlementsUsingGETUnauthorized() *GetEntitlementsUsingGETUnauthoriz return &GetEntitlementsUsingGETUnauthorized{} } -/*GetEntitlementsUsingGETUnauthorized handles this case with default header values. +/* GetEntitlementsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_item_types/catalog_item_types_client.go b/pkg/client/catalog_item_types/catalog_item_types_client.go index 7003e122..cea56496 100644 --- a/pkg/client/catalog_item_types/catalog_item_types_client.go +++ b/pkg/client/catalog_item_types/catalog_item_types_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams) (*GetTypeByIDUsingGETOK, error) + GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams, opts ...ClientOption) (*GetTypeByIDUsingGETOK, error) - GetTypesUsingGET(params *GetTypesUsingGETParams) (*GetTypesUsingGETOK, error) + GetTypesUsingGET(params *GetTypesUsingGETParams, opts ...ClientOption) (*GetTypesUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Returns the Catalog Item Type with the specified ID. */ -func (a *Client) GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams) (*GetTypeByIDUsingGETOK, error) { +func (a *Client) GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams, opts ...ClientOption) (*GetTypeByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTypeByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTypeByIdUsingGET", Method: "GET", PathPattern: "/catalog/api/types/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams) (*GetTyp Reader: &GetTypeByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetTypeByIDUsingGET(params *GetTypeByIDUsingGETParams) (*GetTyp Returns a paginated list of all available Catalog Item Types. */ -func (a *Client) GetTypesUsingGET(params *GetTypesUsingGETParams) (*GetTypesUsingGETOK, error) { +func (a *Client) GetTypesUsingGET(params *GetTypesUsingGETParams, opts ...ClientOption) (*GetTypesUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTypesUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTypesUsingGET", Method: "GET", PathPattern: "/catalog/api/types", @@ -92,7 +98,12 @@ func (a *Client) GetTypesUsingGET(params *GetTypesUsingGETParams) (*GetTypesUsin Reader: &GetTypesUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/catalog_item_types/get_type_by_id_using_get_parameters.go b/pkg/client/catalog_item_types/get_type_by_id_using_get_parameters.go index 243bee7f..1a12063a 100644 --- a/pkg/client/catalog_item_types/get_type_by_id_using_get_parameters.go +++ b/pkg/client/catalog_item_types/get_type_by_id_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetTypeByIDUsingGETParams creates a new GetTypeByIDUsingGETParams object -// with the default values initialized. +// NewGetTypeByIDUsingGETParams creates a new GetTypeByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTypeByIDUsingGETParams() *GetTypeByIDUsingGETParams { - var () return &GetTypeByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetTypeByIDUsingGETParamsWithTimeout creates a new GetTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTypeByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetTypeByIDUsingGETParams { - var () return &GetTypeByIDUsingGETParams{ - timeout: timeout, } } // NewGetTypeByIDUsingGETParamsWithContext creates a new GetTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTypeByIDUsingGETParamsWithContext(ctx context.Context) *GetTypeByIDUsingGETParams { - var () return &GetTypeByIDUsingGETParams{ - Context: ctx, } } // NewGetTypeByIDUsingGETParamsWithHTTPClient creates a new GetTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTypeByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetTypeByIDUsingGETParams { - var () return &GetTypeByIDUsingGETParams{ HTTPClient: client, } } -/*GetTypeByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get type by Id using g e t operation typically these are written to a http.Request +/* GetTypeByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get type by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetTypeByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog Type ID + /* ID. + + Catalog Type ID */ ID string @@ -76,6 +76,21 @@ type GetTypeByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get type by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypeByIDUsingGETParams) WithDefaults() *GetTypeByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get type by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypeByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get type by Id using get params func (o *GetTypeByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetTypeByIDUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetTypeByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_item_types/get_type_by_id_using_get_responses.go b/pkg/client/catalog_item_types/get_type_by_id_using_get_responses.go index de53b186..a91125f2 100644 --- a/pkg/client/catalog_item_types/get_type_by_id_using_get_responses.go +++ b/pkg/client/catalog_item_types/get_type_by_id_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetTypeByIDUsingGETReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetTypeByIDUsingGETOK() *GetTypeByIDUsingGETOK { return &GetTypeByIDUsingGETOK{} } -/*GetTypeByIDUsingGETOK handles this case with default header values. +/* GetTypeByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetTypeByIDUsingGETOK struct { func (o *GetTypeByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/types/{id}][%d] getTypeByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetTypeByIDUsingGETOK) GetPayload() *models.CatalogItemType { return o.Payload } @@ -85,7 +83,7 @@ func NewGetTypeByIDUsingGETUnauthorized() *GetTypeByIDUsingGETUnauthorized { return &GetTypeByIDUsingGETUnauthorized{} } -/*GetTypeByIDUsingGETUnauthorized handles this case with default header values. +/* GetTypeByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetTypeByIDUsingGETNotFound() *GetTypeByIDUsingGETNotFound { return &GetTypeByIDUsingGETNotFound{} } -/*GetTypeByIDUsingGETNotFound handles this case with default header values. +/* GetTypeByIDUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetTypeByIDUsingGETNotFound struct { func (o *GetTypeByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/types/{id}][%d] getTypeByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetTypeByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_item_types/get_types_using_get_parameters.go b/pkg/client/catalog_item_types/get_types_using_get_parameters.go index 31308af5..640af935 100644 --- a/pkg/client/catalog_item_types/get_types_using_get_parameters.go +++ b/pkg/client/catalog_item_types/get_types_using_get_parameters.go @@ -17,68 +17,74 @@ import ( "github.com/go-openapi/swag" ) -// NewGetTypesUsingGETParams creates a new GetTypesUsingGETParams object -// with the default values initialized. +// NewGetTypesUsingGETParams creates a new GetTypesUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTypesUsingGETParams() *GetTypesUsingGETParams { - var () return &GetTypesUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetTypesUsingGETParamsWithTimeout creates a new GetTypesUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTypesUsingGETParamsWithTimeout(timeout time.Duration) *GetTypesUsingGETParams { - var () return &GetTypesUsingGETParams{ - timeout: timeout, } } // NewGetTypesUsingGETParamsWithContext creates a new GetTypesUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTypesUsingGETParamsWithContext(ctx context.Context) *GetTypesUsingGETParams { - var () return &GetTypesUsingGETParams{ - Context: ctx, } } // NewGetTypesUsingGETParamsWithHTTPClient creates a new GetTypesUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTypesUsingGETParamsWithHTTPClient(client *http.Client) *GetTypesUsingGETParams { - var () return &GetTypesUsingGETParams{ HTTPClient: client, } } -/*GetTypesUsingGETParams contains all the parameters to send to the API endpoint -for the get types using g e t operation typically these are written to a http.Request +/* GetTypesUsingGETParams contains all the parameters to send to the API endpoint + for the get types using g e t operation. + + Typically these are written to a http.Request. */ type GetTypesUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string @@ -87,6 +93,21 @@ type GetTypesUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get types using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypesUsingGETParams) WithDefaults() *GetTypesUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get types using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypesUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get types using get params func (o *GetTypesUsingGETParams) WithTimeout(timeout time.Duration) *GetTypesUsingGETParams { o.SetTimeout(timeout) @@ -172,60 +193,66 @@ func (o *GetTypesUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg str } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { @@ -233,3 +260,20 @@ func (o *GetTypesUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg str } return nil } + +// bindParamGetTypesUsingGET binds the parameter $orderby +func (o *GetTypesUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/catalog_item_types/get_types_using_get_responses.go b/pkg/client/catalog_item_types/get_types_using_get_responses.go index 9064b19d..acc2e3ca 100644 --- a/pkg/client/catalog_item_types/get_types_using_get_responses.go +++ b/pkg/client/catalog_item_types/get_types_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetTypesUsingGETReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetTypesUsingGETOK() *GetTypesUsingGETOK { return &GetTypesUsingGETOK{} } -/*GetTypesUsingGETOK handles this case with default header values. +/* GetTypesUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetTypesUsingGETOK struct { func (o *GetTypesUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/types][%d] getTypesUsingGETOK %+v", 200, o.Payload) } - func (o *GetTypesUsingGETOK) GetPayload() *models.PageOfCatalogItemType { return o.Payload } @@ -79,7 +77,7 @@ func NewGetTypesUsingGETUnauthorized() *GetTypesUsingGETUnauthorized { return &GetTypesUsingGETUnauthorized{} } -/*GetTypesUsingGETUnauthorized handles this case with default header values. +/* GetTypesUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_items/catalog_items_client.go b/pkg/client/catalog_items/catalog_items_client.go index b2bdb9de..86eb2070 100644 --- a/pkg/client/catalog_items/catalog_items_client.go +++ b/pkg/client/catalog_items/catalog_items_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params) (*GetCatalogItemUsingGET1OK, error) + GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params, opts ...ClientOption) (*GetCatalogItemUsingGET1OK, error) - GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params) (*GetCatalogItemsUsingGET1OK, error) + GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params, opts ...ClientOption) (*GetCatalogItemsUsingGET1OK, error) - GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfrontPriceResponseForCatalogItemUsingGETParams) (*GetUpfrontPriceResponseForCatalogItemUsingGETOK, error) + GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfrontPriceResponseForCatalogItemUsingGETParams, opts ...ClientOption) (*GetUpfrontPriceResponseForCatalogItemUsingGETOK, error) - GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams) (*GetVersionByIDUsingGETOK, error) + GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams, opts ...ClientOption) (*GetVersionByIDUsingGETOK, error) - GetVersionsUsingGET(params *GetVersionsUsingGETParams) (*GetVersionsUsingGETOK, error) + GetVersionsUsingGET(params *GetVersionsUsingGETParams, opts ...ClientOption) (*GetVersionsUsingGETOK, error) - RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOSTParams) (*RequestCatalogItemUsingPOSTOK, error) + RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOSTParams, opts ...ClientOption) (*RequestCatalogItemUsingPOSTOK, error) - SubmitUpfrontPriceRequestForCatalogItemUsingPOST(params *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) (*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK, error) + SubmitUpfrontPriceRequestForCatalogItemUsingPOST(params *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams, opts ...ClientOption) (*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Returns the catalog item with the specified ID. */ -func (a *Client) GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params) (*GetCatalogItemUsingGET1OK, error) { +func (a *Client) GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params, opts ...ClientOption) (*GetCatalogItemUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCatalogItemUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCatalogItemUsingGET_1", Method: "GET", PathPattern: "/catalog/api/items/{id}", @@ -66,7 +68,12 @@ func (a *Client) GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params) Reader: &GetCatalogItemUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) GetCatalogItemUsingGET1(params *GetCatalogItemUsingGET1Params) Returns a paginated list of catalog items. */ -func (a *Client) GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params) (*GetCatalogItemsUsingGET1OK, error) { +func (a *Client) GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params, opts ...ClientOption) (*GetCatalogItemsUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCatalogItemsUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCatalogItemsUsingGET_1", Method: "GET", PathPattern: "/catalog/api/items", @@ -102,7 +108,12 @@ func (a *Client) GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params Reader: &GetCatalogItemsUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) GetCatalogItemsUsingGET1(params *GetCatalogItemsUsingGET1Params Returns upfront prices of a given catalog item. */ -func (a *Client) GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfrontPriceResponseForCatalogItemUsingGETParams) (*GetUpfrontPriceResponseForCatalogItemUsingGETOK, error) { +func (a *Client) GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfrontPriceResponseForCatalogItemUsingGETParams, opts ...ClientOption) (*GetUpfrontPriceResponseForCatalogItemUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetUpfrontPriceResponseForCatalogItemUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getUpfrontPriceResponseForCatalogItemUsingGET", Method: "GET", PathPattern: "/catalog/api/items/{id}/upfront-prices/{upfrontPriceId}", @@ -138,7 +148,12 @@ func (a *Client) GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfron Reader: &GetUpfrontPriceResponseForCatalogItemUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -157,13 +172,12 @@ func (a *Client) GetUpfrontPriceResponseForCatalogItemUsingGET(params *GetUpfron Returns a detailed catalog item version. */ -func (a *Client) GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams) (*GetVersionByIDUsingGETOK, error) { +func (a *Client) GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams, opts ...ClientOption) (*GetVersionByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVersionByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVersionByIdUsingGET", Method: "GET", PathPattern: "/catalog/api/items/{id}/versions/{versionId}", @@ -174,7 +188,12 @@ func (a *Client) GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams) (* Reader: &GetVersionByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -193,13 +212,12 @@ func (a *Client) GetVersionByIDUsingGET(params *GetVersionByIDUsingGETParams) (* Returns a paginated list of catalog item versions. */ -func (a *Client) GetVersionsUsingGET(params *GetVersionsUsingGETParams) (*GetVersionsUsingGETOK, error) { +func (a *Client) GetVersionsUsingGET(params *GetVersionsUsingGETParams, opts ...ClientOption) (*GetVersionsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVersionsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVersionsUsingGET", Method: "GET", PathPattern: "/catalog/api/items/{id}/versions", @@ -210,7 +228,12 @@ func (a *Client) GetVersionsUsingGET(params *GetVersionsUsingGETParams) (*GetVer Reader: &GetVersionsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetVersionsUsingGET(params *GetVersionsUsingGETParams) (*GetVer Creates a deployment from a catalog item. */ -func (a *Client) RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOSTParams) (*RequestCatalogItemUsingPOSTOK, error) { +func (a *Client) RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOSTParams, opts ...ClientOption) (*RequestCatalogItemUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRequestCatalogItemUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "requestCatalogItemUsingPOST", Method: "POST", PathPattern: "/catalog/api/items/{id}/request", @@ -246,7 +268,12 @@ func (a *Client) RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOST Reader: &RequestCatalogItemUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -265,13 +292,12 @@ func (a *Client) RequestCatalogItemUsingPOST(params *RequestCatalogItemUsingPOST Returns upfront price response for a given catalog item. */ -func (a *Client) SubmitUpfrontPriceRequestForCatalogItemUsingPOST(params *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) (*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK, error) { +func (a *Client) SubmitUpfrontPriceRequestForCatalogItemUsingPOST(params *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams, opts ...ClientOption) (*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "submitUpfrontPriceRequestForCatalogItemUsingPOST", Method: "POST", PathPattern: "/catalog/api/items/{id}/upfront-prices", @@ -282,7 +308,12 @@ func (a *Client) SubmitUpfrontPriceRequestForCatalogItemUsingPOST(params *Submit Reader: &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/catalog_items/get_catalog_item_using_get1_parameters.go b/pkg/client/catalog_items/get_catalog_item_using_get1_parameters.go index 28af7df9..85ad20e5 100644 --- a/pkg/client/catalog_items/get_catalog_item_using_get1_parameters.go +++ b/pkg/client/catalog_items/get_catalog_item_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetCatalogItemUsingGET1Params creates a new GetCatalogItemUsingGET1Params object -// with the default values initialized. +// NewGetCatalogItemUsingGET1Params creates a new GetCatalogItemUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCatalogItemUsingGET1Params() *GetCatalogItemUsingGET1Params { - var () return &GetCatalogItemUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetCatalogItemUsingGET1ParamsWithTimeout creates a new GetCatalogItemUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCatalogItemUsingGET1ParamsWithTimeout(timeout time.Duration) *GetCatalogItemUsingGET1Params { - var () return &GetCatalogItemUsingGET1Params{ - timeout: timeout, } } // NewGetCatalogItemUsingGET1ParamsWithContext creates a new GetCatalogItemUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCatalogItemUsingGET1ParamsWithContext(ctx context.Context) *GetCatalogItemUsingGET1Params { - var () return &GetCatalogItemUsingGET1Params{ - Context: ctx, } } // NewGetCatalogItemUsingGET1ParamsWithHTTPClient creates a new GetCatalogItemUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCatalogItemUsingGET1ParamsWithHTTPClient(client *http.Client) *GetCatalogItemUsingGET1Params { - var () return &GetCatalogItemUsingGET1Params{ HTTPClient: client, } } -/*GetCatalogItemUsingGET1Params contains all the parameters to send to the API endpoint -for the get catalog item using get1 operation typically these are written to a http.Request +/* GetCatalogItemUsingGET1Params contains all the parameters to send to the API endpoint + for the get catalog item using get1 operation. + + Typically these are written to a http.Request. */ type GetCatalogItemUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ExpandProjects - Retrieves the 'projects' field of the catalog item + /* ExpandProjects. + + Retrieves the 'projects' field of the catalog item */ ExpandProjects *bool - /*ID - Catalog item ID + /* ID. + + Catalog item ID + + Format: uuid */ ID strfmt.UUID @@ -82,6 +85,21 @@ type GetCatalogItemUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get catalog item using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemUsingGET1Params) WithDefaults() *GetCatalogItemUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get catalog item using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get catalog item using get1 params func (o *GetCatalogItemUsingGET1Params) WithTimeout(timeout time.Duration) *GetCatalogItemUsingGET1Params { o.SetTimeout(timeout) @@ -160,32 +178,34 @@ func (o *GetCatalogItemUsingGET1Params) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ExpandProjects != nil { // query param expandProjects var qrExpandProjects bool + if o.ExpandProjects != nil { qrExpandProjects = *o.ExpandProjects } qExpandProjects := swag.FormatBool(qrExpandProjects) if qExpandProjects != "" { + if err := r.SetQueryParam("expandProjects", qExpandProjects); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_items/get_catalog_item_using_get1_responses.go b/pkg/client/catalog_items/get_catalog_item_using_get1_responses.go index fba6d424..eb6853bc 100644 --- a/pkg/client/catalog_items/get_catalog_item_using_get1_responses.go +++ b/pkg/client/catalog_items/get_catalog_item_using_get1_responses.go @@ -41,7 +41,6 @@ func (o *GetCatalogItemUsingGET1Reader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetCatalogItemUsingGET1OK() *GetCatalogItemUsingGET1OK { return &GetCatalogItemUsingGET1OK{} } -/*GetCatalogItemUsingGET1OK handles this case with default header values. +/* GetCatalogItemUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetCatalogItemUsingGET1OK struct { func (o *GetCatalogItemUsingGET1OK) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}][%d] getCatalogItemUsingGET1OK %+v", 200, o.Payload) } - func (o *GetCatalogItemUsingGET1OK) GetPayload() *models.CatalogItem { return o.Payload } @@ -85,7 +83,7 @@ func NewGetCatalogItemUsingGET1Unauthorized() *GetCatalogItemUsingGET1Unauthoriz return &GetCatalogItemUsingGET1Unauthorized{} } -/*GetCatalogItemUsingGET1Unauthorized handles this case with default header values. +/* GetCatalogItemUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetCatalogItemUsingGET1NotFound() *GetCatalogItemUsingGET1NotFound { return &GetCatalogItemUsingGET1NotFound{} } -/*GetCatalogItemUsingGET1NotFound handles this case with default header values. +/* GetCatalogItemUsingGET1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetCatalogItemUsingGET1NotFound struct { func (o *GetCatalogItemUsingGET1NotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}][%d] getCatalogItemUsingGET1NotFound %+v", 404, o.Payload) } - func (o *GetCatalogItemUsingGET1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_items/get_catalog_items_using_get1_parameters.go b/pkg/client/catalog_items/get_catalog_items_using_get1_parameters.go index 63a4c6ba..3d2e6dc5 100644 --- a/pkg/client/catalog_items/get_catalog_items_using_get1_parameters.go +++ b/pkg/client/catalog_items/get_catalog_items_using_get1_parameters.go @@ -17,88 +17,98 @@ import ( "github.com/go-openapi/swag" ) -// NewGetCatalogItemsUsingGET1Params creates a new GetCatalogItemsUsingGET1Params object -// with the default values initialized. +// NewGetCatalogItemsUsingGET1Params creates a new GetCatalogItemsUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCatalogItemsUsingGET1Params() *GetCatalogItemsUsingGET1Params { - var () return &GetCatalogItemsUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetCatalogItemsUsingGET1ParamsWithTimeout creates a new GetCatalogItemsUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCatalogItemsUsingGET1ParamsWithTimeout(timeout time.Duration) *GetCatalogItemsUsingGET1Params { - var () return &GetCatalogItemsUsingGET1Params{ - timeout: timeout, } } // NewGetCatalogItemsUsingGET1ParamsWithContext creates a new GetCatalogItemsUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCatalogItemsUsingGET1ParamsWithContext(ctx context.Context) *GetCatalogItemsUsingGET1Params { - var () return &GetCatalogItemsUsingGET1Params{ - Context: ctx, } } // NewGetCatalogItemsUsingGET1ParamsWithHTTPClient creates a new GetCatalogItemsUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCatalogItemsUsingGET1ParamsWithHTTPClient(client *http.Client) *GetCatalogItemsUsingGET1Params { - var () return &GetCatalogItemsUsingGET1Params{ HTTPClient: client, } } -/*GetCatalogItemsUsingGET1Params contains all the parameters to send to the API endpoint -for the get catalog items using get1 operation typically these are written to a http.Request +/* GetCatalogItemsUsingGET1Params contains all the parameters to send to the API endpoint + for the get catalog items using get1 operation. + + Typically these are written to a http.Request. */ type GetCatalogItemsUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ExpandProjects - Whether or not to return detailed project data for each result. + /* ExpandProjects. + + Whether or not to return detailed project data for each result. */ ExpandProjects *bool - /*Projects - A list of project IDs. Results will belong to one of these projects. + /* Projects. + + A list of project IDs. Results will belong to one of these projects. */ Projects []string - /*Search - Matches will have this string somewhere in their name or description. + /* Search. + + Matches will have this string somewhere in their name or description. */ Search *string - /*Types - A list of Catalog Item Type IDs. Results will be one of these types. + /* Types. + + A list of Catalog Item Type IDs. Results will be one of these types. */ Types []string @@ -107,6 +117,21 @@ type GetCatalogItemsUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get catalog items using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemsUsingGET1Params) WithDefaults() *GetCatalogItemsUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get catalog items using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCatalogItemsUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get catalog items using get1 params func (o *GetCatalogItemsUsingGET1Params) WithTimeout(timeout time.Duration) *GetCatalogItemsUsingGET1Params { o.SetTimeout(timeout) @@ -236,108 +261,122 @@ func (o *GetCatalogItemsUsingGET1Params) WriteToRequest(r runtime.ClientRequest, } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ExpandProjects != nil { // query param expandProjects var qrExpandProjects bool + if o.ExpandProjects != nil { qrExpandProjects = *o.ExpandProjects } qExpandProjects := swag.FormatBool(qrExpandProjects) if qExpandProjects != "" { + if err := r.SetQueryParam("expandProjects", qExpandProjects); err != nil { return err } } - } - valuesProjects := o.Projects + if o.Projects != nil { - joinedProjects := swag.JoinByFormat(valuesProjects, "multi") - // query array param projects - if err := r.SetQueryParam("projects", joinedProjects...); err != nil { - return err + // binding items for projects + joinedProjects := o.bindParamProjects(reg) + + // query array param projects + if err := r.SetQueryParam("projects", joinedProjects...); err != nil { + return err + } } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } - valuesTypes := o.Types + if o.Types != nil { - joinedTypes := swag.JoinByFormat(valuesTypes, "multi") - // query array param types - if err := r.SetQueryParam("types", joinedTypes...); err != nil { - return err + // binding items for types + joinedTypes := o.bindParamTypes(reg) + + // query array param types + if err := r.SetQueryParam("types", joinedTypes...); err != nil { + return err + } } if len(res) > 0 { @@ -345,3 +384,54 @@ func (o *GetCatalogItemsUsingGET1Params) WriteToRequest(r runtime.ClientRequest, } return nil } + +// bindParamGetCatalogItemsUsingGET1 binds the parameter $orderby +func (o *GetCatalogItemsUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamGetCatalogItemsUsingGET1 binds the parameter projects +func (o *GetCatalogItemsUsingGET1Params) bindParamProjects(formats strfmt.Registry) []string { + projectsIR := o.Projects + + var projectsIC []string + for _, projectsIIR := range projectsIR { // explode []string + + projectsIIV := projectsIIR // string as string + projectsIC = append(projectsIC, projectsIIV) + } + + // items.CollectionFormat: "multi" + projectsIS := swag.JoinByFormat(projectsIC, "multi") + + return projectsIS +} + +// bindParamGetCatalogItemsUsingGET1 binds the parameter types +func (o *GetCatalogItemsUsingGET1Params) bindParamTypes(formats strfmt.Registry) []string { + typesIR := o.Types + + var typesIC []string + for _, typesIIR := range typesIR { // explode []string + + typesIIV := typesIIR // string as string + typesIC = append(typesIC, typesIIV) + } + + // items.CollectionFormat: "multi" + typesIS := swag.JoinByFormat(typesIC, "multi") + + return typesIS +} diff --git a/pkg/client/catalog_items/get_catalog_items_using_get1_responses.go b/pkg/client/catalog_items/get_catalog_items_using_get1_responses.go index 886ed9b4..9dc0c63c 100644 --- a/pkg/client/catalog_items/get_catalog_items_using_get1_responses.go +++ b/pkg/client/catalog_items/get_catalog_items_using_get1_responses.go @@ -35,7 +35,6 @@ func (o *GetCatalogItemsUsingGET1Reader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetCatalogItemsUsingGET1OK() *GetCatalogItemsUsingGET1OK { return &GetCatalogItemsUsingGET1OK{} } -/*GetCatalogItemsUsingGET1OK handles this case with default header values. +/* GetCatalogItemsUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetCatalogItemsUsingGET1OK struct { func (o *GetCatalogItemsUsingGET1OK) Error() string { return fmt.Sprintf("[GET /catalog/api/items][%d] getCatalogItemsUsingGET1OK %+v", 200, o.Payload) } - func (o *GetCatalogItemsUsingGET1OK) GetPayload() *models.PageOfCatalogItem { return o.Payload } @@ -79,7 +77,7 @@ func NewGetCatalogItemsUsingGET1Unauthorized() *GetCatalogItemsUsingGET1Unauthor return &GetCatalogItemsUsingGET1Unauthorized{} } -/*GetCatalogItemsUsingGET1Unauthorized handles this case with default header values. +/* GetCatalogItemsUsingGET1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_parameters.go b/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_parameters.go index 71b06db5..f036ed84 100644 --- a/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_parameters.go +++ b/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_parameters.go @@ -16,63 +16,68 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetUpfrontPriceResponseForCatalogItemUsingGETParams creates a new GetUpfrontPriceResponseForCatalogItemUsingGETParams object -// with the default values initialized. +// NewGetUpfrontPriceResponseForCatalogItemUsingGETParams creates a new GetUpfrontPriceResponseForCatalogItemUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetUpfrontPriceResponseForCatalogItemUsingGETParams() *GetUpfrontPriceResponseForCatalogItemUsingGETParams { - var () return &GetUpfrontPriceResponseForCatalogItemUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithTimeout creates a new GetUpfrontPriceResponseForCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithTimeout(timeout time.Duration) *GetUpfrontPriceResponseForCatalogItemUsingGETParams { - var () return &GetUpfrontPriceResponseForCatalogItemUsingGETParams{ - timeout: timeout, } } // NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithContext creates a new GetUpfrontPriceResponseForCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithContext(ctx context.Context) *GetUpfrontPriceResponseForCatalogItemUsingGETParams { - var () return &GetUpfrontPriceResponseForCatalogItemUsingGETParams{ - Context: ctx, } } // NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithHTTPClient creates a new GetUpfrontPriceResponseForCatalogItemUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetUpfrontPriceResponseForCatalogItemUsingGETParamsWithHTTPClient(client *http.Client) *GetUpfrontPriceResponseForCatalogItemUsingGETParams { - var () return &GetUpfrontPriceResponseForCatalogItemUsingGETParams{ HTTPClient: client, } } -/*GetUpfrontPriceResponseForCatalogItemUsingGETParams contains all the parameters to send to the API endpoint -for the get upfront price response for catalog item using g e t operation typically these are written to a http.Request +/* GetUpfrontPriceResponseForCatalogItemUsingGETParams contains all the parameters to send to the API endpoint + for the get upfront price response for catalog item using g e t operation. + + Typically these are written to a http.Request. */ type GetUpfrontPriceResponseForCatalogItemUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog Item ID + /* ID. + + Catalog Item ID + + Format: uuid */ ID strfmt.UUID - /*UpfrontPriceID - Upfront Price Request ID + /* UpfrontPriceID. + + Upfront Price Request ID + + Format: uuid */ UpfrontPriceID strfmt.UUID @@ -81,6 +86,21 @@ type GetUpfrontPriceResponseForCatalogItemUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get upfront price response for catalog item using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUpfrontPriceResponseForCatalogItemUsingGETParams) WithDefaults() *GetUpfrontPriceResponseForCatalogItemUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get upfront price response for catalog item using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUpfrontPriceResponseForCatalogItemUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get upfront price response for catalog item using get params func (o *GetUpfrontPriceResponseForCatalogItemUsingGETParams) WithTimeout(timeout time.Duration) *GetUpfrontPriceResponseForCatalogItemUsingGETParams { o.SetTimeout(timeout) @@ -159,16 +179,17 @@ func (o *GetUpfrontPriceResponseForCatalogItemUsingGETParams) WriteToRequest(r r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_responses.go b/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_responses.go index 9323b851..e9ccf9af 100644 --- a/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_responses.go +++ b/pkg/client/catalog_items/get_upfront_price_response_for_catalog_item_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetUpfrontPriceResponseForCatalogItemUsingGETReader) ReadResponse(respo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetUpfrontPriceResponseForCatalogItemUsingGETOK() *GetUpfrontPriceRespon return &GetUpfrontPriceResponseForCatalogItemUsingGETOK{} } -/*GetUpfrontPriceResponseForCatalogItemUsingGETOK handles this case with default header values. +/* GetUpfrontPriceResponseForCatalogItemUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetUpfrontPriceResponseForCatalogItemUsingGETOK struct { func (o *GetUpfrontPriceResponseForCatalogItemUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/upfront-prices/{upfrontPriceId}][%d] getUpfrontPriceResponseForCatalogItemUsingGETOK %+v", 200, o.Payload) } - func (o *GetUpfrontPriceResponseForCatalogItemUsingGETOK) GetPayload() *models.CatalogItemUpfrontPriceResponse { return o.Payload } @@ -85,7 +83,7 @@ func NewGetUpfrontPriceResponseForCatalogItemUsingGETUnauthorized() *GetUpfrontP return &GetUpfrontPriceResponseForCatalogItemUsingGETUnauthorized{} } -/*GetUpfrontPriceResponseForCatalogItemUsingGETUnauthorized handles this case with default header values. +/* GetUpfrontPriceResponseForCatalogItemUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetUpfrontPriceResponseForCatalogItemUsingGETNotFound() *GetUpfrontPrice return &GetUpfrontPriceResponseForCatalogItemUsingGETNotFound{} } -/*GetUpfrontPriceResponseForCatalogItemUsingGETNotFound handles this case with default header values. +/* GetUpfrontPriceResponseForCatalogItemUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetUpfrontPriceResponseForCatalogItemUsingGETNotFound struct { func (o *GetUpfrontPriceResponseForCatalogItemUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/upfront-prices/{upfrontPriceId}][%d] getUpfrontPriceResponseForCatalogItemUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetUpfrontPriceResponseForCatalogItemUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_items/get_version_by_id_using_get_parameters.go b/pkg/client/catalog_items/get_version_by_id_using_get_parameters.go index 0dd64eaf..a849fc61 100644 --- a/pkg/client/catalog_items/get_version_by_id_using_get_parameters.go +++ b/pkg/client/catalog_items/get_version_by_id_using_get_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVersionByIDUsingGETParams creates a new GetVersionByIDUsingGETParams object -// with the default values initialized. +// NewGetVersionByIDUsingGETParams creates a new GetVersionByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVersionByIDUsingGETParams() *GetVersionByIDUsingGETParams { - var () return &GetVersionByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetVersionByIDUsingGETParamsWithTimeout creates a new GetVersionByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVersionByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetVersionByIDUsingGETParams { - var () return &GetVersionByIDUsingGETParams{ - timeout: timeout, } } // NewGetVersionByIDUsingGETParamsWithContext creates a new GetVersionByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVersionByIDUsingGETParamsWithContext(ctx context.Context) *GetVersionByIDUsingGETParams { - var () return &GetVersionByIDUsingGETParams{ - Context: ctx, } } // NewGetVersionByIDUsingGETParamsWithHTTPClient creates a new GetVersionByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVersionByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetVersionByIDUsingGETParams { - var () return &GetVersionByIDUsingGETParams{ HTTPClient: client, } } -/*GetVersionByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get version by Id using g e t operation typically these are written to a http.Request +/* GetVersionByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get version by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetVersionByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog Item ID + /* ID. + + Catalog Item ID + + Format: uuid */ ID strfmt.UUID - /*VersionID - Catalog Item Version ID + /* VersionID. + + Catalog Item Version ID */ VersionID string @@ -81,6 +84,21 @@ type GetVersionByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get version by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionByIDUsingGETParams) WithDefaults() *GetVersionByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get version by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get version by Id using get params func (o *GetVersionByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetVersionByIDUsingGETParams { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *GetVersionByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/catalog_items/get_version_by_id_using_get_responses.go b/pkg/client/catalog_items/get_version_by_id_using_get_responses.go index ca645e05..1e7e015c 100644 --- a/pkg/client/catalog_items/get_version_by_id_using_get_responses.go +++ b/pkg/client/catalog_items/get_version_by_id_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetVersionByIDUsingGETReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVersionByIDUsingGETOK() *GetVersionByIDUsingGETOK { return &GetVersionByIDUsingGETOK{} } -/*GetVersionByIDUsingGETOK handles this case with default header values. +/* GetVersionByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetVersionByIDUsingGETOK struct { func (o *GetVersionByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/versions/{versionId}][%d] getVersionByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetVersionByIDUsingGETOK) GetPayload() *models.CatalogItemVersion { return o.Payload } @@ -85,7 +83,7 @@ func NewGetVersionByIDUsingGETUnauthorized() *GetVersionByIDUsingGETUnauthorized return &GetVersionByIDUsingGETUnauthorized{} } -/*GetVersionByIDUsingGETUnauthorized handles this case with default header values. +/* GetVersionByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetVersionByIDUsingGETNotFound() *GetVersionByIDUsingGETNotFound { return &GetVersionByIDUsingGETNotFound{} } -/*GetVersionByIDUsingGETNotFound handles this case with default header values. +/* GetVersionByIDUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetVersionByIDUsingGETNotFound struct { func (o *GetVersionByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/versions/{versionId}][%d] getVersionByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetVersionByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_items/get_versions_using_get_parameters.go b/pkg/client/catalog_items/get_versions_using_get_parameters.go index a47619c4..331fe887 100644 --- a/pkg/client/catalog_items/get_versions_using_get_parameters.go +++ b/pkg/client/catalog_items/get_versions_using_get_parameters.go @@ -17,68 +17,76 @@ import ( "github.com/go-openapi/swag" ) -// NewGetVersionsUsingGETParams creates a new GetVersionsUsingGETParams object -// with the default values initialized. +// NewGetVersionsUsingGETParams creates a new GetVersionsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVersionsUsingGETParams() *GetVersionsUsingGETParams { - var () return &GetVersionsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetVersionsUsingGETParamsWithTimeout creates a new GetVersionsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVersionsUsingGETParamsWithTimeout(timeout time.Duration) *GetVersionsUsingGETParams { - var () return &GetVersionsUsingGETParams{ - timeout: timeout, } } // NewGetVersionsUsingGETParamsWithContext creates a new GetVersionsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVersionsUsingGETParamsWithContext(ctx context.Context) *GetVersionsUsingGETParams { - var () return &GetVersionsUsingGETParams{ - Context: ctx, } } // NewGetVersionsUsingGETParamsWithHTTPClient creates a new GetVersionsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVersionsUsingGETParamsWithHTTPClient(client *http.Client) *GetVersionsUsingGETParams { - var () return &GetVersionsUsingGETParams{ HTTPClient: client, } } -/*GetVersionsUsingGETParams contains all the parameters to send to the API endpoint -for the get versions using g e t operation typically these are written to a http.Request +/* GetVersionsUsingGETParams contains all the parameters to send to the API endpoint + for the get versions using g e t operation. + + Typically these are written to a http.Request. */ type GetVersionsUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog Item ID + /* ID. + + Catalog Item ID + + Format: uuid */ ID strfmt.UUID - /*Page - Results page you want to retrieve (0..N) + /* Page. + + Results page you want to retrieve (0..N) + + Format: int32 */ Page *int32 - /*Size - Number of records per page. + /* Size. + + Number of records per page. + + Format: int32 */ Size *int32 @@ -87,6 +95,21 @@ type GetVersionsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get versions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionsUsingGETParams) WithDefaults() *GetVersionsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get versions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get versions using get params func (o *GetVersionsUsingGETParams) WithTimeout(timeout time.Duration) *GetVersionsUsingGETParams { o.SetTimeout(timeout) @@ -176,16 +199,17 @@ func (o *GetVersionsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id @@ -197,32 +221,34 @@ func (o *GetVersionsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param page var qrPage int32 + if o.Page != nil { qrPage = *o.Page } qPage := swag.FormatInt32(qrPage) if qPage != "" { + if err := r.SetQueryParam("page", qPage); err != nil { return err } } - } if o.Size != nil { // query param size var qrSize int32 + if o.Size != nil { qrSize = *o.Size } qSize := swag.FormatInt32(qrSize) if qSize != "" { + if err := r.SetQueryParam("size", qSize); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/catalog_items/get_versions_using_get_responses.go b/pkg/client/catalog_items/get_versions_using_get_responses.go index bbfcb779..7424e206 100644 --- a/pkg/client/catalog_items/get_versions_using_get_responses.go +++ b/pkg/client/catalog_items/get_versions_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetVersionsUsingGETReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVersionsUsingGETOK() *GetVersionsUsingGETOK { return &GetVersionsUsingGETOK{} } -/*GetVersionsUsingGETOK handles this case with default header values. +/* GetVersionsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetVersionsUsingGETOK struct { func (o *GetVersionsUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/versions][%d] getVersionsUsingGETOK %+v", 200, o.Payload) } - func (o *GetVersionsUsingGETOK) GetPayload() *models.PageOfCatalogItemVersion { return o.Payload } @@ -85,7 +83,7 @@ func NewGetVersionsUsingGETUnauthorized() *GetVersionsUsingGETUnauthorized { return &GetVersionsUsingGETUnauthorized{} } -/*GetVersionsUsingGETUnauthorized handles this case with default header values. +/* GetVersionsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetVersionsUsingGETNotFound() *GetVersionsUsingGETNotFound { return &GetVersionsUsingGETNotFound{} } -/*GetVersionsUsingGETNotFound handles this case with default header values. +/* GetVersionsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetVersionsUsingGETNotFound struct { func (o *GetVersionsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/items/{id}/versions][%d] getVersionsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetVersionsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_items/request_catalog_item_using_post_parameters.go b/pkg/client/catalog_items/request_catalog_item_using_post_parameters.go index 5d63b292..022ee674 100644 --- a/pkg/client/catalog_items/request_catalog_item_using_post_parameters.go +++ b/pkg/client/catalog_items/request_catalog_item_using_post_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewRequestCatalogItemUsingPOSTParams creates a new RequestCatalogItemUsingPOSTParams object -// with the default values initialized. +// NewRequestCatalogItemUsingPOSTParams creates a new RequestCatalogItemUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRequestCatalogItemUsingPOSTParams() *RequestCatalogItemUsingPOSTParams { - var () return &RequestCatalogItemUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewRequestCatalogItemUsingPOSTParamsWithTimeout creates a new RequestCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRequestCatalogItemUsingPOSTParamsWithTimeout(timeout time.Duration) *RequestCatalogItemUsingPOSTParams { - var () return &RequestCatalogItemUsingPOSTParams{ - timeout: timeout, } } // NewRequestCatalogItemUsingPOSTParamsWithContext creates a new RequestCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRequestCatalogItemUsingPOSTParamsWithContext(ctx context.Context) *RequestCatalogItemUsingPOSTParams { - var () return &RequestCatalogItemUsingPOSTParams{ - Context: ctx, } } // NewRequestCatalogItemUsingPOSTParamsWithHTTPClient creates a new RequestCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRequestCatalogItemUsingPOSTParamsWithHTTPClient(client *http.Client) *RequestCatalogItemUsingPOSTParams { - var () return &RequestCatalogItemUsingPOSTParams{ HTTPClient: client, } } -/*RequestCatalogItemUsingPOSTParams contains all the parameters to send to the API endpoint -for the request catalog item using p o s t operation typically these are written to a http.Request +/* RequestCatalogItemUsingPOSTParams contains all the parameters to send to the API endpoint + for the request catalog item using p o s t operation. + + Typically these are written to a http.Request. */ type RequestCatalogItemUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog item ID + /* ID. + + Catalog item ID + + Format: uuid */ ID strfmt.UUID - /*Request - request + /* Request. + + request */ Request *models.CatalogItemRequest @@ -83,6 +86,21 @@ type RequestCatalogItemUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the request catalog item using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RequestCatalogItemUsingPOSTParams) WithDefaults() *RequestCatalogItemUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the request catalog item using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RequestCatalogItemUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the request catalog item using p o s t params func (o *RequestCatalogItemUsingPOSTParams) WithTimeout(timeout time.Duration) *RequestCatalogItemUsingPOSTParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *RequestCatalogItemUsingPOSTParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id if err := r.SetPathParam("id", o.ID.String()); err != nil { return err } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/catalog_items/request_catalog_item_using_post_responses.go b/pkg/client/catalog_items/request_catalog_item_using_post_responses.go index b52af899..e2756be8 100644 --- a/pkg/client/catalog_items/request_catalog_item_using_post_responses.go +++ b/pkg/client/catalog_items/request_catalog_item_using_post_responses.go @@ -53,7 +53,6 @@ func (o *RequestCatalogItemUsingPOSTReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -64,7 +63,7 @@ func NewRequestCatalogItemUsingPOSTOK() *RequestCatalogItemUsingPOSTOK { return &RequestCatalogItemUsingPOSTOK{} } -/*RequestCatalogItemUsingPOSTOK handles this case with default header values. +/* RequestCatalogItemUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -75,7 +74,6 @@ type RequestCatalogItemUsingPOSTOK struct { func (o *RequestCatalogItemUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /catalog/api/items/{id}/request][%d] requestCatalogItemUsingPOSTOK %+v", 200, o.Payload) } - func (o *RequestCatalogItemUsingPOSTOK) GetPayload() *models.CatalogItemRequestResponse { return o.Payload } @@ -97,7 +95,7 @@ func NewRequestCatalogItemUsingPOSTBadRequest() *RequestCatalogItemUsingPOSTBadR return &RequestCatalogItemUsingPOSTBadRequest{} } -/*RequestCatalogItemUsingPOSTBadRequest handles this case with default header values. +/* RequestCatalogItemUsingPOSTBadRequest describes a response with status code 400, with default header values. Invalid request - bad data. */ @@ -108,7 +106,6 @@ type RequestCatalogItemUsingPOSTBadRequest struct { func (o *RequestCatalogItemUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /catalog/api/items/{id}/request][%d] requestCatalogItemUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *RequestCatalogItemUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -130,7 +127,7 @@ func NewRequestCatalogItemUsingPOSTUnauthorized() *RequestCatalogItemUsingPOSTUn return &RequestCatalogItemUsingPOSTUnauthorized{} } -/*RequestCatalogItemUsingPOSTUnauthorized handles this case with default header values. +/* RequestCatalogItemUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,7 +148,7 @@ func NewRequestCatalogItemUsingPOSTForbidden() *RequestCatalogItemUsingPOSTForbi return &RequestCatalogItemUsingPOSTForbidden{} } -/*RequestCatalogItemUsingPOSTForbidden handles this case with default header values. +/* RequestCatalogItemUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden. */ @@ -172,7 +169,7 @@ func NewRequestCatalogItemUsingPOSTNotFound() *RequestCatalogItemUsingPOSTNotFou return &RequestCatalogItemUsingPOSTNotFound{} } -/*RequestCatalogItemUsingPOSTNotFound handles this case with default header values. +/* RequestCatalogItemUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -183,7 +180,6 @@ type RequestCatalogItemUsingPOSTNotFound struct { func (o *RequestCatalogItemUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /catalog/api/items/{id}/request][%d] requestCatalogItemUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *RequestCatalogItemUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_parameters.go b/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_parameters.go index fb4df004..37289667 100644 --- a/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_parameters.go +++ b/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams creates a new SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams object -// with the default values initialized. +// NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams creates a new SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams() *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { - var () return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithTimeout creates a new SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithTimeout(timeout time.Duration) *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { - var () return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams{ - timeout: timeout, } } // NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithContext creates a new SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithContext(ctx context.Context) *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { - var () return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams{ - Context: ctx, } } // NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithHTTPClient creates a new SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTParamsWithHTTPClient(client *http.Client) *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { - var () return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams{ HTTPClient: client, } } -/*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams contains all the parameters to send to the API endpoint -for the submit upfront price request for catalog item using p o s t operation typically these are written to a http.Request +/* SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams contains all the parameters to send to the API endpoint + for the submit upfront price request for catalog item using p o s t operation. + + Typically these are written to a http.Request. */ type SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Catalog Item ID + /* ID. + + Catalog Item ID + + Format: uuid */ ID strfmt.UUID - /*Request - request + /* Request. + + request */ Request *models.CatalogItemRequest @@ -83,6 +86,21 @@ type SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the submit upfront price request for catalog item using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) WithDefaults() *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the submit upfront price request for catalog item using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the submit upfront price request for catalog item using p o s t params func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) WithTimeout(timeout time.Duration) *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTParams) WriteToRequest( // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id if err := r.SetPathParam("id", o.ID.String()); err != nil { return err } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_responses.go b/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_responses.go index eae887dd..c8a52d98 100644 --- a/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_responses.go +++ b/pkg/client/catalog_items/submit_upfront_price_request_for_catalog_item_using_post_responses.go @@ -41,7 +41,6 @@ func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTReader) ReadResponse(re return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK() *SubmitUpfrontPrice return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK{} } -/*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK handles this case with default header values. +/* SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK struct { func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /catalog/api/items/{id}/upfront-prices][%d] submitUpfrontPriceRequestForCatalogItemUsingPOSTOK %+v", 200, o.Payload) } - func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTOK) GetPayload() *models.CatalogItemUpfrontPriceResponse { return o.Payload } @@ -85,7 +83,7 @@ func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTUnauthorized() *SubmitUp return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTUnauthorized{} } -/*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTUnauthorized handles this case with default header values. +/* SubmitUpfrontPriceRequestForCatalogItemUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewSubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound() *SubmitUpfron return &SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound{} } -/*SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound handles this case with default header values. +/* SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound struct { func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /catalog/api/items/{id}/upfront-prices][%d] submitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *SubmitUpfrontPriceRequestForCatalogItemUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_sources/catalog_sources_client.go b/pkg/client/catalog_sources/catalog_sources_client.go index 3a068514..b8db8680 100644 --- a/pkg/client/catalog_sources/catalog_sources_client.go +++ b/pkg/client/catalog_sources/catalog_sources_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DeleteUsingDELETE(params *DeleteUsingDELETEParams) (*DeleteUsingDELETENoContent, error) + DeleteUsingDELETE(params *DeleteUsingDELETEParams, opts ...ClientOption) (*DeleteUsingDELETENoContent, error) - GetPageUsingGET(params *GetPageUsingGETParams) (*GetPageUsingGETOK, error) + GetPageUsingGET(params *GetPageUsingGETParams, opts ...ClientOption) (*GetPageUsingGETOK, error) - GetUsingGET(params *GetUsingGETParams) (*GetUsingGETOK, error) + GetUsingGET(params *GetUsingGETParams, opts ...ClientOption) (*GetUsingGETOK, error) - PostUsingPOST(params *PostUsingPOSTParams) (*PostUsingPOSTOK, *PostUsingPOSTCreated, error) + PostUsingPOST(params *PostUsingPOSTParams, opts ...ClientOption) (*PostUsingPOSTOK, *PostUsingPOSTCreated, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { Deletes the catalog source with the supplied ID. */ -func (a *Client) DeleteUsingDELETE(params *DeleteUsingDELETEParams) (*DeleteUsingDELETENoContent, error) { +func (a *Client) DeleteUsingDELETE(params *DeleteUsingDELETEParams, opts ...ClientOption) (*DeleteUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteUsingDELETE", Method: "DELETE", PathPattern: "/catalog/api/admin/sources/{sourceId}", @@ -60,7 +62,12 @@ func (a *Client) DeleteUsingDELETE(params *DeleteUsingDELETEParams) (*DeleteUsin Reader: &DeleteUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +86,12 @@ func (a *Client) DeleteUsingDELETE(params *DeleteUsingDELETEParams) (*DeleteUsin Returns a paginated list of catalog sources. */ -func (a *Client) GetPageUsingGET(params *GetPageUsingGETParams) (*GetPageUsingGETOK, error) { +func (a *Client) GetPageUsingGET(params *GetPageUsingGETParams, opts ...ClientOption) (*GetPageUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPageUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPageUsingGET", Method: "GET", PathPattern: "/catalog/api/admin/sources", @@ -96,7 +102,12 @@ func (a *Client) GetPageUsingGET(params *GetPageUsingGETParams) (*GetPageUsingGE Reader: &GetPageUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +126,12 @@ func (a *Client) GetPageUsingGET(params *GetPageUsingGETParams) (*GetPageUsingGE Returns the catalog source with the supplied ID. */ -func (a *Client) GetUsingGET(params *GetUsingGETParams) (*GetUsingGETOK, error) { +func (a *Client) GetUsingGET(params *GetUsingGETParams, opts ...ClientOption) (*GetUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getUsingGET", Method: "GET", PathPattern: "/catalog/api/admin/sources/{sourceId}", @@ -132,7 +142,12 @@ func (a *Client) GetUsingGET(params *GetUsingGETParams) (*GetUsingGETOK, error) Reader: &GetUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -151,13 +166,12 @@ func (a *Client) GetUsingGET(params *GetUsingGETParams) (*GetUsingGETOK, error) Creates a catalog source and imports catalog items from it. */ -func (a *Client) PostUsingPOST(params *PostUsingPOSTParams) (*PostUsingPOSTOK, *PostUsingPOSTCreated, error) { +func (a *Client) PostUsingPOST(params *PostUsingPOSTParams, opts ...ClientOption) (*PostUsingPOSTOK, *PostUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPostUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "postUsingPOST", Method: "POST", PathPattern: "/catalog/api/admin/sources", @@ -168,7 +182,12 @@ func (a *Client) PostUsingPOST(params *PostUsingPOSTParams) (*PostUsingPOSTOK, * Reader: &PostUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } diff --git a/pkg/client/catalog_sources/delete_using_delete_parameters.go b/pkg/client/catalog_sources/delete_using_delete_parameters.go index 1ec7f9fa..c92a3b16 100644 --- a/pkg/client/catalog_sources/delete_using_delete_parameters.go +++ b/pkg/client/catalog_sources/delete_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteUsingDELETEParams creates a new DeleteUsingDELETEParams object -// with the default values initialized. +// NewDeleteUsingDELETEParams creates a new DeleteUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteUsingDELETEParams() *DeleteUsingDELETEParams { - var () return &DeleteUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteUsingDELETEParamsWithTimeout creates a new DeleteUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteUsingDELETEParams { - var () return &DeleteUsingDELETEParams{ - timeout: timeout, } } // NewDeleteUsingDELETEParamsWithContext creates a new DeleteUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteUsingDELETEParamsWithContext(ctx context.Context) *DeleteUsingDELETEParams { - var () return &DeleteUsingDELETEParams{ - Context: ctx, } } // NewDeleteUsingDELETEParamsWithHTTPClient creates a new DeleteUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteUsingDELETEParams { - var () return &DeleteUsingDELETEParams{ HTTPClient: client, } } -/*DeleteUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete using d e l e t e operation typically these are written to a http.Request +/* DeleteUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*SourceID - Catalog source ID + /* SourceID. + + Catalog source ID + + Format: uuid */ SourceID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteUsingDELETEParams) WithDefaults() *DeleteUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete using d e l e t e params func (o *DeleteUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteUsingDELETEParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param sourceId diff --git a/pkg/client/catalog_sources/delete_using_delete_responses.go b/pkg/client/catalog_sources/delete_using_delete_responses.go index edfac50f..2b58ff0d 100644 --- a/pkg/client/catalog_sources/delete_using_delete_responses.go +++ b/pkg/client/catalog_sources/delete_using_delete_responses.go @@ -32,7 +32,6 @@ func (o *DeleteUsingDELETEReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +42,7 @@ func NewDeleteUsingDELETENoContent() *DeleteUsingDELETENoContent { return &DeleteUsingDELETENoContent{} } -/*DeleteUsingDELETENoContent handles this case with default header values. +/* DeleteUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ @@ -64,7 +63,7 @@ func NewDeleteUsingDELETEUnauthorized() *DeleteUsingDELETEUnauthorized { return &DeleteUsingDELETEUnauthorized{} } -/*DeleteUsingDELETEUnauthorized handles this case with default header values. +/* DeleteUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_sources/get_page_using_get_parameters.go b/pkg/client/catalog_sources/get_page_using_get_parameters.go index 2327af38..aa4036ec 100644 --- a/pkg/client/catalog_sources/get_page_using_get_parameters.go +++ b/pkg/client/catalog_sources/get_page_using_get_parameters.go @@ -17,78 +17,86 @@ import ( "github.com/go-openapi/swag" ) -// NewGetPageUsingGETParams creates a new GetPageUsingGETParams object -// with the default values initialized. +// NewGetPageUsingGETParams creates a new GetPageUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPageUsingGETParams() *GetPageUsingGETParams { - var () return &GetPageUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetPageUsingGETParamsWithTimeout creates a new GetPageUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPageUsingGETParamsWithTimeout(timeout time.Duration) *GetPageUsingGETParams { - var () return &GetPageUsingGETParams{ - timeout: timeout, } } // NewGetPageUsingGETParamsWithContext creates a new GetPageUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPageUsingGETParamsWithContext(ctx context.Context) *GetPageUsingGETParams { - var () return &GetPageUsingGETParams{ - Context: ctx, } } // NewGetPageUsingGETParamsWithHTTPClient creates a new GetPageUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPageUsingGETParamsWithHTTPClient(client *http.Client) *GetPageUsingGETParams { - var () return &GetPageUsingGETParams{ HTTPClient: client, } } -/*GetPageUsingGETParams contains all the parameters to send to the API endpoint -for the get page using g e t operation typically these are written to a http.Request +/* GetPageUsingGETParams contains all the parameters to send to the API endpoint + for the get page using g e t operation. + + Typically these are written to a http.Request. */ type GetPageUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ProjectID - Find sources which contains items that can be requested in the given projectId + /* ProjectID. + + Find sources which contains items that can be requested in the given projectId */ ProjectID *string - /*Search - Matches will have this string in their name or description. + /* Search. + + Matches will have this string in their name or description. */ Search *string @@ -97,6 +105,21 @@ type GetPageUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get page using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPageUsingGETParams) WithDefaults() *GetPageUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get page using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPageUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get page using get params func (o *GetPageUsingGETParams) WithTimeout(timeout time.Duration) *GetPageUsingGETParams { o.SetTimeout(timeout) @@ -204,92 +227,100 @@ func (o *GetPageUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ProjectID != nil { // query param projectId var qrProjectID string + if o.ProjectID != nil { qrProjectID = *o.ProjectID } qProjectID := qrProjectID if qProjectID != "" { + if err := r.SetQueryParam("projectId", qProjectID); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -297,3 +328,20 @@ func (o *GetPageUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strf } return nil } + +// bindParamGetPageUsingGET binds the parameter $orderby +func (o *GetPageUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/catalog_sources/get_page_using_get_responses.go b/pkg/client/catalog_sources/get_page_using_get_responses.go index 9151d010..c4519e1f 100644 --- a/pkg/client/catalog_sources/get_page_using_get_responses.go +++ b/pkg/client/catalog_sources/get_page_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetPageUsingGETReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetPageUsingGETOK() *GetPageUsingGETOK { return &GetPageUsingGETOK{} } -/*GetPageUsingGETOK handles this case with default header values. +/* GetPageUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetPageUsingGETOK struct { func (o *GetPageUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/sources][%d] getPageUsingGETOK %+v", 200, o.Payload) } - func (o *GetPageUsingGETOK) GetPayload() *models.PageOfCatalogSource { return o.Payload } @@ -79,7 +77,7 @@ func NewGetPageUsingGETUnauthorized() *GetPageUsingGETUnauthorized { return &GetPageUsingGETUnauthorized{} } -/*GetPageUsingGETUnauthorized handles this case with default header values. +/* GetPageUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/catalog_sources/get_using_get_parameters.go b/pkg/client/catalog_sources/get_using_get_parameters.go index 6eaf5551..d688bb7d 100644 --- a/pkg/client/catalog_sources/get_using_get_parameters.go +++ b/pkg/client/catalog_sources/get_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetUsingGETParams creates a new GetUsingGETParams object -// with the default values initialized. +// NewGetUsingGETParams creates a new GetUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetUsingGETParams() *GetUsingGETParams { - var () return &GetUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetUsingGETParamsWithTimeout creates a new GetUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetUsingGETParamsWithTimeout(timeout time.Duration) *GetUsingGETParams { - var () return &GetUsingGETParams{ - timeout: timeout, } } // NewGetUsingGETParamsWithContext creates a new GetUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetUsingGETParamsWithContext(ctx context.Context) *GetUsingGETParams { - var () return &GetUsingGETParams{ - Context: ctx, } } // NewGetUsingGETParamsWithHTTPClient creates a new GetUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetUsingGETParamsWithHTTPClient(client *http.Client) *GetUsingGETParams { - var () return &GetUsingGETParams{ HTTPClient: client, } } -/*GetUsingGETParams contains all the parameters to send to the API endpoint -for the get using g e t operation typically these are written to a http.Request +/* GetUsingGETParams contains all the parameters to send to the API endpoint + for the get using g e t operation. + + Typically these are written to a http.Request. */ type GetUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*SourceID - Catalog source ID + /* SourceID. + + Catalog source ID + + Format: uuid */ SourceID strfmt.UUID @@ -76,6 +78,21 @@ type GetUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsingGETParams) WithDefaults() *GetUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get using get params func (o *GetUsingGETParams) WithTimeout(timeout time.Duration) *GetUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param sourceId diff --git a/pkg/client/catalog_sources/get_using_get_responses.go b/pkg/client/catalog_sources/get_using_get_responses.go index 5995662c..e2d70eeb 100644 --- a/pkg/client/catalog_sources/get_using_get_responses.go +++ b/pkg/client/catalog_sources/get_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetUsingGETReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetUsingGETOK() *GetUsingGETOK { return &GetUsingGETOK{} } -/*GetUsingGETOK handles this case with default header values. +/* GetUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetUsingGETOK struct { func (o *GetUsingGETOK) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/sources/{sourceId}][%d] getUsingGETOK %+v", 200, o.Payload) } - func (o *GetUsingGETOK) GetPayload() *models.CatalogSource { return o.Payload } @@ -85,7 +83,7 @@ func NewGetUsingGETUnauthorized() *GetUsingGETUnauthorized { return &GetUsingGETUnauthorized{} } -/*GetUsingGETUnauthorized handles this case with default header values. +/* GetUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetUsingGETNotFound() *GetUsingGETNotFound { return &GetUsingGETNotFound{} } -/*GetUsingGETNotFound handles this case with default header values. +/* GetUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetUsingGETNotFound struct { func (o *GetUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /catalog/api/admin/sources/{sourceId}][%d] getUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/catalog_sources/post_using_post_parameters.go b/pkg/client/catalog_sources/post_using_post_parameters.go index a970c1b9..a8f400b2 100644 --- a/pkg/client/catalog_sources/post_using_post_parameters.go +++ b/pkg/client/catalog_sources/post_using_post_parameters.go @@ -19,63 +19,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewPostUsingPOSTParams creates a new PostUsingPOSTParams object -// with the default values initialized. +// NewPostUsingPOSTParams creates a new PostUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPostUsingPOSTParams() *PostUsingPOSTParams { - var () return &PostUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewPostUsingPOSTParamsWithTimeout creates a new PostUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPostUsingPOSTParamsWithTimeout(timeout time.Duration) *PostUsingPOSTParams { - var () return &PostUsingPOSTParams{ - timeout: timeout, } } // NewPostUsingPOSTParamsWithContext creates a new PostUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPostUsingPOSTParamsWithContext(ctx context.Context) *PostUsingPOSTParams { - var () return &PostUsingPOSTParams{ - Context: ctx, } } // NewPostUsingPOSTParamsWithHTTPClient creates a new PostUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPostUsingPOSTParamsWithHTTPClient(client *http.Client) *PostUsingPOSTParams { - var () return &PostUsingPOSTParams{ HTTPClient: client, } } -/*PostUsingPOSTParams contains all the parameters to send to the API endpoint -for the post using p o s t operation typically these are written to a http.Request +/* PostUsingPOSTParams contains all the parameters to send to the API endpoint + for the post using p o s t operation. + + Typically these are written to a http.Request. */ type PostUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Source - The catalog source to be created + /* Source. + + The catalog source to be created */ Source *models.CatalogSource - /*ValidationOnly - If true, the source will not be created. It returns the number of items belonging to the source. The request will still return an error code if the source is invalid. + /* ValidationOnly. + + If true, the source will not be created. It returns the number of items belonging to the source. The request will still return an error code if the source is invalid. */ ValidationOnly *bool @@ -84,6 +85,21 @@ type PostUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the post using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsingPOSTParams) WithDefaults() *PostUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the post using p o s t params func (o *PostUsingPOSTParams) WithTimeout(timeout time.Duration) *PostUsingPOSTParams { o.SetTimeout(timeout) @@ -162,18 +178,18 @@ func (o *PostUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Source != nil { if err := r.SetBodyParam(o.Source); err != nil { return err @@ -184,16 +200,17 @@ func (o *PostUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param validationOnly var qrValidationOnly bool + if o.ValidationOnly != nil { qrValidationOnly = *o.ValidationOnly } qValidationOnly := swag.FormatBool(qrValidationOnly) if qValidationOnly != "" { + if err := r.SetQueryParam("validationOnly", qValidationOnly); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/catalog_sources/post_using_post_responses.go b/pkg/client/catalog_sources/post_using_post_responses.go index 2c92f302..42cf797a 100644 --- a/pkg/client/catalog_sources/post_using_post_responses.go +++ b/pkg/client/catalog_sources/post_using_post_responses.go @@ -59,7 +59,6 @@ func (o *PostUsingPOSTReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -70,7 +69,7 @@ func NewPostUsingPOSTOK() *PostUsingPOSTOK { return &PostUsingPOSTOK{} } -/*PostUsingPOSTOK handles this case with default header values. +/* PostUsingPOSTOK describes a response with status code 200, with default header values. Validation is ok */ @@ -81,7 +80,6 @@ type PostUsingPOSTOK struct { func (o *PostUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/sources][%d] postUsingPOSTOK %+v", 200, o.Payload) } - func (o *PostUsingPOSTOK) GetPayload() *models.CatalogSource { return o.Payload } @@ -103,7 +101,7 @@ func NewPostUsingPOSTCreated() *PostUsingPOSTCreated { return &PostUsingPOSTCreated{} } -/*PostUsingPOSTCreated handles this case with default header values. +/* PostUsingPOSTCreated describes a response with status code 201, with default header values. Created */ @@ -114,7 +112,6 @@ type PostUsingPOSTCreated struct { func (o *PostUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/sources][%d] postUsingPOSTCreated %+v", 201, o.Payload) } - func (o *PostUsingPOSTCreated) GetPayload() *models.CatalogSource { return o.Payload } @@ -136,7 +133,7 @@ func NewPostUsingPOSTBadRequest() *PostUsingPOSTBadRequest { return &PostUsingPOSTBadRequest{} } -/*PostUsingPOSTBadRequest handles this case with default header values. +/* PostUsingPOSTBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -147,7 +144,6 @@ type PostUsingPOSTBadRequest struct { func (o *PostUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/sources][%d] postUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *PostUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -169,7 +165,7 @@ func NewPostUsingPOSTUnauthorized() *PostUsingPOSTUnauthorized { return &PostUsingPOSTUnauthorized{} } -/*PostUsingPOSTUnauthorized handles this case with default header values. +/* PostUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -190,7 +186,7 @@ func NewPostUsingPOSTForbidden() *PostUsingPOSTForbidden { return &PostUsingPOSTForbidden{} } -/*PostUsingPOSTForbidden handles this case with default header values. +/* PostUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -211,7 +207,7 @@ func NewPostUsingPOSTNotFound() *PostUsingPOSTNotFound { return &PostUsingPOSTNotFound{} } -/*PostUsingPOSTNotFound handles this case with default header values. +/* PostUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -222,7 +218,6 @@ type PostUsingPOSTNotFound struct { func (o *PostUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /catalog/api/admin/sources][%d] postUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *PostUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/cloud_account_client.go b/pkg/client/cloud_account/cloud_account_client.go index a00407be..299ce006 100644 --- a/pkg/client/cloud_account/cloud_account_client.go +++ b/pkg/client/cloud_account/cloud_account_client.go @@ -25,125 +25,128 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateAwsCloudAccount(params *CreateAwsCloudAccountParams) (*CreateAwsCloudAccountCreated, error) + CreateAwsCloudAccount(params *CreateAwsCloudAccountParams, opts ...ClientOption) (*CreateAwsCloudAccountCreated, error) - CreateAzureCloudAccount(params *CreateAzureCloudAccountParams) (*CreateAzureCloudAccountCreated, error) + CreateAzureCloudAccount(params *CreateAzureCloudAccountParams, opts ...ClientOption) (*CreateAzureCloudAccountCreated, error) - CreateCloudAccount(params *CreateCloudAccountParams) (*CreateCloudAccountCreated, error) + CreateCloudAccount(params *CreateCloudAccountParams, opts ...ClientOption) (*CreateCloudAccountCreated, error) - CreateGcpCloudAccount(params *CreateGcpCloudAccountParams) (*CreateGcpCloudAccountCreated, error) + CreateGcpCloudAccount(params *CreateGcpCloudAccountParams, opts ...ClientOption) (*CreateGcpCloudAccountCreated, error) - CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams) (*CreateNsxTCloudAccountCreated, error) + CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams, opts ...ClientOption) (*CreateNsxTCloudAccountCreated, error) - CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams) (*CreateNsxVCloudAccountCreated, error) + CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams, opts ...ClientOption) (*CreateNsxVCloudAccountCreated, error) - CreateVSphereCloudAccount(params *CreateVSphereCloudAccountParams) (*CreateVSphereCloudAccountCreated, error) + CreateVSphereCloudAccount(params *CreateVSphereCloudAccountParams, opts ...ClientOption) (*CreateVSphereCloudAccountCreated, error) - CreateVcfCloudAccount(params *CreateVcfCloudAccountParams) (*CreateVcfCloudAccountCreated, error) + CreateVcfCloudAccount(params *CreateVcfCloudAccountParams, opts ...ClientOption) (*CreateVcfCloudAccountCreated, error) - CreateVmcCloudAccount(params *CreateVmcCloudAccountParams) (*CreateVmcCloudAccountCreated, error) + CreateVmcCloudAccount(params *CreateVmcCloudAccountParams, opts ...ClientOption) (*CreateVmcCloudAccountCreated, error) - DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams) (*DeleteAwsCloudAccountNoContent, error) + DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams, opts ...ClientOption) (*DeleteAwsCloudAccountNoContent, error) - DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams) (*DeleteAzureCloudAccountNoContent, error) + DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams, opts ...ClientOption) (*DeleteAzureCloudAccountNoContent, error) - DeleteCloudAccount(params *DeleteCloudAccountParams) (*DeleteCloudAccountNoContent, error) + DeleteCloudAccount(params *DeleteCloudAccountParams, opts ...ClientOption) (*DeleteCloudAccountNoContent, error) - DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams) (*DeleteCloudAccountNsxTNoContent, error) + DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams, opts ...ClientOption) (*DeleteCloudAccountNsxTNoContent, error) - DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams) (*DeleteCloudAccountNsxVNoContent, error) + DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams, opts ...ClientOption) (*DeleteCloudAccountNsxVNoContent, error) - DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams) (*DeleteGcpCloudAccountNoContent, error) + DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams, opts ...ClientOption) (*DeleteGcpCloudAccountNoContent, error) - DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountParams) (*DeleteVSphereCloudAccountNoContent, error) + DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountParams, opts ...ClientOption) (*DeleteVSphereCloudAccountNoContent, error) - DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams) (*DeleteVcfCloudAccountNoContent, error) + DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams, opts ...ClientOption) (*DeleteVcfCloudAccountNoContent, error) - DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams) (*DeleteVmcCloudAccountNoContent, error) + DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams, opts ...ClientOption) (*DeleteVmcCloudAccountNoContent, error) - EnumerateAwsRegions(params *EnumerateAwsRegionsParams) (*EnumerateAwsRegionsOK, error) + EnumerateAwsRegions(params *EnumerateAwsRegionsParams, opts ...ClientOption) (*EnumerateAwsRegionsOK, error) - EnumerateAzureRegions(params *EnumerateAzureRegionsParams) (*EnumerateAzureRegionsOK, error) + EnumerateAzureRegions(params *EnumerateAzureRegionsParams, opts ...ClientOption) (*EnumerateAzureRegionsOK, error) - EnumerateGcpRegions(params *EnumerateGcpRegionsParams) (*EnumerateGcpRegionsOK, error) + EnumerateGcpRegions(params *EnumerateGcpRegionsParams, opts ...ClientOption) (*EnumerateGcpRegionsOK, error) - EnumeratePrivateImages(params *EnumeratePrivateImagesParams) error + EnumeratePrivateImages(params *EnumeratePrivateImagesParams, opts ...ClientOption) error - EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSParams) error + EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSParams, opts ...ClientOption) error - EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzureParams) error + EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzureParams, opts ...ClientOption) error - EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpParams) error + EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpParams, opts ...ClientOption) error - EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFParams) error + EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFParams, opts ...ClientOption) error - EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCParams) error + EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCParams, opts ...ClientOption) error - EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSphereParams) error + EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSphereParams, opts ...ClientOption) error - EnumerateRegions(params *EnumerateRegionsParams) (*EnumerateRegionsOK, error) + EnumerateRegions(params *EnumerateRegionsParams, opts ...ClientOption) (*EnumerateRegionsOK, error) - EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams) (*EnumerateVSphereRegionsOK, error) + EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams, opts ...ClientOption) (*EnumerateVSphereRegionsOK, error) - EnumerateVcfRegions(params *EnumerateVcfRegionsParams) (*EnumerateVcfRegionsOK, error) + EnumerateVcfRegions(params *EnumerateVcfRegionsParams, opts ...ClientOption) (*EnumerateVcfRegionsOK, error) - EnumerateVmcRegions(params *EnumerateVmcRegionsParams) (*EnumerateVmcRegionsOK, error) + EnumerateVmcRegions(params *EnumerateVmcRegionsParams, opts ...ClientOption) (*EnumerateVmcRegionsOK, error) - GetAwsCloudAccount(params *GetAwsCloudAccountParams) (*GetAwsCloudAccountOK, error) + GetAwsCloudAccount(params *GetAwsCloudAccountParams, opts ...ClientOption) (*GetAwsCloudAccountOK, error) - GetAwsCloudAccounts(params *GetAwsCloudAccountsParams) (*GetAwsCloudAccountsOK, error) + GetAwsCloudAccounts(params *GetAwsCloudAccountsParams, opts ...ClientOption) (*GetAwsCloudAccountsOK, error) - GetAzureCloudAccount(params *GetAzureCloudAccountParams) (*GetAzureCloudAccountOK, error) + GetAzureCloudAccount(params *GetAzureCloudAccountParams, opts ...ClientOption) (*GetAzureCloudAccountOK, error) - GetAzureCloudAccounts(params *GetAzureCloudAccountsParams) (*GetAzureCloudAccountsOK, error) + GetAzureCloudAccounts(params *GetAzureCloudAccountsParams, opts ...ClientOption) (*GetAzureCloudAccountsOK, error) - GetCloudAccount(params *GetCloudAccountParams) (*GetCloudAccountOK, error) + GetCloudAccount(params *GetCloudAccountParams, opts ...ClientOption) (*GetCloudAccountOK, error) - GetCloudAccounts(params *GetCloudAccountsParams) (*GetCloudAccountsOK, error) + GetCloudAccounts(params *GetCloudAccountsParams, opts ...ClientOption) (*GetCloudAccountsOK, error) - GetGcpCloudAccount(params *GetGcpCloudAccountParams) (*GetGcpCloudAccountOK, error) + GetGcpCloudAccount(params *GetGcpCloudAccountParams, opts ...ClientOption) (*GetGcpCloudAccountOK, error) - GetGcpCloudAccounts(params *GetGcpCloudAccountsParams) (*GetGcpCloudAccountsOK, error) + GetGcpCloudAccounts(params *GetGcpCloudAccountsParams, opts ...ClientOption) (*GetGcpCloudAccountsOK, error) - GetNsxTCloudAccount(params *GetNsxTCloudAccountParams) (*GetNsxTCloudAccountOK, error) + GetNsxTCloudAccount(params *GetNsxTCloudAccountParams, opts ...ClientOption) (*GetNsxTCloudAccountOK, error) - GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams) (*GetNsxTCloudAccountsOK, error) + GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams, opts ...ClientOption) (*GetNsxTCloudAccountsOK, error) - GetNsxVCloudAccount(params *GetNsxVCloudAccountParams) (*GetNsxVCloudAccountOK, error) + GetNsxVCloudAccount(params *GetNsxVCloudAccountParams, opts ...ClientOption) (*GetNsxVCloudAccountOK, error) - GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams) (*GetNsxVCloudAccountsOK, error) + GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams, opts ...ClientOption) (*GetNsxVCloudAccountsOK, error) - GetVSphereCloudAccount(params *GetVSphereCloudAccountParams) (*GetVSphereCloudAccountOK, error) + GetVSphereCloudAccount(params *GetVSphereCloudAccountParams, opts ...ClientOption) (*GetVSphereCloudAccountOK, error) - GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams) (*GetVSphereCloudAccountsOK, error) + GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams, opts ...ClientOption) (*GetVSphereCloudAccountsOK, error) - GetVcfCloudAccount(params *GetVcfCloudAccountParams) (*GetVcfCloudAccountOK, error) + GetVcfCloudAccount(params *GetVcfCloudAccountParams, opts ...ClientOption) (*GetVcfCloudAccountOK, error) - GetVcfCloudAccounts(params *GetVcfCloudAccountsParams) (*GetVcfCloudAccountsOK, error) + GetVcfCloudAccounts(params *GetVcfCloudAccountsParams, opts ...ClientOption) (*GetVcfCloudAccountsOK, error) - GetVmcCloudAccount(params *GetVmcCloudAccountParams) (*GetVmcCloudAccountOK, error) + GetVmcCloudAccount(params *GetVmcCloudAccountParams, opts ...ClientOption) (*GetVmcCloudAccountOK, error) - GetVmcCloudAccounts(params *GetVmcCloudAccountsParams) (*GetVmcCloudAccountsOK, error) + GetVmcCloudAccounts(params *GetVmcCloudAccountsParams, opts ...ClientOption) (*GetVmcCloudAccountsOK, error) - UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams) (*UpdateAwsCloudAccountOK, error) + UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams, opts ...ClientOption) (*UpdateAwsCloudAccountOK, error) - UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams) (*UpdateAzureCloudAccountOK, error) + UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams, opts ...ClientOption) (*UpdateAzureCloudAccountOK, error) - UpdateCloudAccount(params *UpdateCloudAccountParams) (*UpdateCloudAccountOK, error) + UpdateCloudAccount(params *UpdateCloudAccountParams, opts ...ClientOption) (*UpdateCloudAccountOK, error) - UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams) (*UpdateGcpCloudAccountOK, error) + UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams, opts ...ClientOption) (*UpdateGcpCloudAccountOK, error) - UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams) (*UpdateNsxTCloudAccountOK, error) + UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams, opts ...ClientOption) (*UpdateNsxTCloudAccountOK, error) - UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams) (*UpdateNsxVCloudAccountOK, error) + UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams, opts ...ClientOption) (*UpdateNsxVCloudAccountOK, error) - UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountParams) (*UpdateVSphereCloudAccountOK, error) + UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountParams, opts ...ClientOption) (*UpdateVSphereCloudAccountOK, error) - UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams) (*UpdateVcfCloudAccountOK, error) + UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams, opts ...ClientOption) (*UpdateVcfCloudAccountOK, error) - UpdateVmcCloudAccount(params *UpdateVmcCloudAccountParams) (*UpdateVmcCloudAccountOK, error) + UpdateVmcCloudAccount(params *UpdateVmcCloudAccountParams, opts ...ClientOption) (*UpdateVmcCloudAccountOK, error) SetTransport(transport runtime.ClientTransport) } @@ -153,13 +156,12 @@ type ClientService interface { Create an AWS cloud account in the current organization */ -func (a *Client) CreateAwsCloudAccount(params *CreateAwsCloudAccountParams) (*CreateAwsCloudAccountCreated, error) { +func (a *Client) CreateAwsCloudAccount(params *CreateAwsCloudAccountParams, opts ...ClientOption) (*CreateAwsCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAwsCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createAwsCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-aws", @@ -170,7 +172,12 @@ func (a *Client) CreateAwsCloudAccount(params *CreateAwsCloudAccountParams) (*Cr Reader: &CreateAwsCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -189,13 +196,12 @@ func (a *Client) CreateAwsCloudAccount(params *CreateAwsCloudAccountParams) (*Cr Create an Azure cloud account in the current organization */ -func (a *Client) CreateAzureCloudAccount(params *CreateAzureCloudAccountParams) (*CreateAzureCloudAccountCreated, error) { +func (a *Client) CreateAzureCloudAccount(params *CreateAzureCloudAccountParams, opts ...ClientOption) (*CreateAzureCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAzureCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createAzureCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-azure", @@ -206,7 +212,12 @@ func (a *Client) CreateAzureCloudAccount(params *CreateAzureCloudAccountParams) Reader: &CreateAzureCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -225,13 +236,12 @@ func (a *Client) CreateAzureCloudAccount(params *CreateAzureCloudAccountParams) Create a cloud account in the current organization */ -func (a *Client) CreateCloudAccount(params *CreateCloudAccountParams) (*CreateCloudAccountCreated, error) { +func (a *Client) CreateCloudAccount(params *CreateCloudAccountParams, opts ...ClientOption) (*CreateCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts", @@ -242,7 +252,12 @@ func (a *Client) CreateCloudAccount(params *CreateCloudAccountParams) (*CreateCl Reader: &CreateCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -261,13 +276,12 @@ func (a *Client) CreateCloudAccount(params *CreateCloudAccountParams) (*CreateCl Create an GCP cloud account in the current organization */ -func (a *Client) CreateGcpCloudAccount(params *CreateGcpCloudAccountParams) (*CreateGcpCloudAccountCreated, error) { +func (a *Client) CreateGcpCloudAccount(params *CreateGcpCloudAccountParams, opts ...ClientOption) (*CreateGcpCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateGcpCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createGcpCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-gcp", @@ -278,7 +292,12 @@ func (a *Client) CreateGcpCloudAccount(params *CreateGcpCloudAccountParams) (*Cr Reader: &CreateGcpCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -297,13 +316,12 @@ func (a *Client) CreateGcpCloudAccount(params *CreateGcpCloudAccountParams) (*Cr Create a NSX-T cloud account in the current organization */ -func (a *Client) CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams) (*CreateNsxTCloudAccountCreated, error) { +func (a *Client) CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams, opts ...ClientOption) (*CreateNsxTCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateNsxTCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createNsxTCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-nsx-t", @@ -314,7 +332,12 @@ func (a *Client) CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams) (* Reader: &CreateNsxTCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -333,13 +356,12 @@ func (a *Client) CreateNsxTCloudAccount(params *CreateNsxTCloudAccountParams) (* Create a NSX-V cloud account within the current organization */ -func (a *Client) CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams) (*CreateNsxVCloudAccountCreated, error) { +func (a *Client) CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams, opts ...ClientOption) (*CreateNsxVCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateNsxVCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createNsxVCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-nsx-v", @@ -350,7 +372,12 @@ func (a *Client) CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams) (* Reader: &CreateNsxVCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -369,13 +396,12 @@ func (a *Client) CreateNsxVCloudAccount(params *CreateNsxVCloudAccountParams) (* Create a vSphere cloud account within the current organization */ -func (a *Client) CreateVSphereCloudAccount(params *CreateVSphereCloudAccountParams) (*CreateVSphereCloudAccountCreated, error) { +func (a *Client) CreateVSphereCloudAccount(params *CreateVSphereCloudAccountParams, opts ...ClientOption) (*CreateVSphereCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateVSphereCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createVSphereCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vsphere", @@ -386,7 +412,12 @@ func (a *Client) CreateVSphereCloudAccount(params *CreateVSphereCloudAccountPara Reader: &CreateVSphereCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -405,13 +436,12 @@ func (a *Client) CreateVSphereCloudAccount(params *CreateVSphereCloudAccountPara Create an VCF cloud account in the current organization */ -func (a *Client) CreateVcfCloudAccount(params *CreateVcfCloudAccountParams) (*CreateVcfCloudAccountCreated, error) { +func (a *Client) CreateVcfCloudAccount(params *CreateVcfCloudAccountParams, opts ...ClientOption) (*CreateVcfCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateVcfCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createVcfCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vcf", @@ -422,7 +452,12 @@ func (a *Client) CreateVcfCloudAccount(params *CreateVcfCloudAccountParams) (*Cr Reader: &CreateVcfCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -441,13 +476,12 @@ func (a *Client) CreateVcfCloudAccount(params *CreateVcfCloudAccountParams) (*Cr Create an VMC cloud account in the current organization */ -func (a *Client) CreateVmcCloudAccount(params *CreateVmcCloudAccountParams) (*CreateVmcCloudAccountCreated, error) { +func (a *Client) CreateVmcCloudAccount(params *CreateVmcCloudAccountParams, opts ...ClientOption) (*CreateVmcCloudAccountCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateVmcCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createVmcCloudAccount", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vmc", @@ -458,7 +492,12 @@ func (a *Client) CreateVmcCloudAccount(params *CreateVmcCloudAccountParams) (*Cr Reader: &CreateVmcCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -477,13 +516,12 @@ func (a *Client) CreateVmcCloudAccount(params *CreateVmcCloudAccountParams) (*Cr Delete an AWS cloud account with a given id */ -func (a *Client) DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams) (*DeleteAwsCloudAccountNoContent, error) { +func (a *Client) DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams, opts ...ClientOption) (*DeleteAwsCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAwsCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAwsCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-aws/{id}", @@ -494,7 +532,12 @@ func (a *Client) DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams) (*De Reader: &DeleteAwsCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -513,13 +556,12 @@ func (a *Client) DeleteAwsCloudAccount(params *DeleteAwsCloudAccountParams) (*De Delete an Azure Cloud Account with a given id */ -func (a *Client) DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams) (*DeleteAzureCloudAccountNoContent, error) { +func (a *Client) DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams, opts ...ClientOption) (*DeleteAzureCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAzureCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAzureCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-azure/{id}", @@ -530,7 +572,12 @@ func (a *Client) DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams) Reader: &DeleteAzureCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -549,13 +596,12 @@ func (a *Client) DeleteAzureCloudAccount(params *DeleteAzureCloudAccountParams) Delete a cloud account with a given id */ -func (a *Client) DeleteCloudAccount(params *DeleteCloudAccountParams) (*DeleteCloudAccountNoContent, error) { +func (a *Client) DeleteCloudAccount(params *DeleteCloudAccountParams, opts ...ClientOption) (*DeleteCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts/{id}", @@ -566,7 +612,12 @@ func (a *Client) DeleteCloudAccount(params *DeleteCloudAccountParams) (*DeleteCl Reader: &DeleteCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -585,13 +636,12 @@ func (a *Client) DeleteCloudAccount(params *DeleteCloudAccountParams) (*DeleteCl Delete a NSX-T cloud account with a given id */ -func (a *Client) DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams) (*DeleteCloudAccountNsxTNoContent, error) { +func (a *Client) DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams, opts ...ClientOption) (*DeleteCloudAccountNsxTNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCloudAccountNsxTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteCloudAccountNsx-T", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-nsx-t/{id}", @@ -602,7 +652,12 @@ func (a *Client) DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams) (* Reader: &DeleteCloudAccountNsxTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -621,13 +676,12 @@ func (a *Client) DeleteCloudAccountNsxT(params *DeleteCloudAccountNsxTParams) (* Delete a NSV-V cloud account with a given id */ -func (a *Client) DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams) (*DeleteCloudAccountNsxVNoContent, error) { +func (a *Client) DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams, opts ...ClientOption) (*DeleteCloudAccountNsxVNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCloudAccountNsxVParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteCloudAccountNsx-V", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-nsx-v/{id}", @@ -638,7 +692,12 @@ func (a *Client) DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams) (* Reader: &DeleteCloudAccountNsxVReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -657,13 +716,12 @@ func (a *Client) DeleteCloudAccountNsxV(params *DeleteCloudAccountNsxVParams) (* Delete an GCP cloud account with a given id */ -func (a *Client) DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams) (*DeleteGcpCloudAccountNoContent, error) { +func (a *Client) DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams, opts ...ClientOption) (*DeleteGcpCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteGcpCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteGcpCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-gcp/{id}", @@ -674,7 +732,12 @@ func (a *Client) DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams) (*De Reader: &DeleteGcpCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -693,13 +756,12 @@ func (a *Client) DeleteGcpCloudAccount(params *DeleteGcpCloudAccountParams) (*De Delete a vSphere Cloud Account with a given id */ -func (a *Client) DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountParams) (*DeleteVSphereCloudAccountNoContent, error) { +func (a *Client) DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountParams, opts ...ClientOption) (*DeleteVSphereCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteVSphereCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteVSphereCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-vsphere/{id}", @@ -710,7 +772,12 @@ func (a *Client) DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountPara Reader: &DeleteVSphereCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -729,13 +796,12 @@ func (a *Client) DeleteVSphereCloudAccount(params *DeleteVSphereCloudAccountPara Delete an VCF cloud account with a given id */ -func (a *Client) DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams) (*DeleteVcfCloudAccountNoContent, error) { +func (a *Client) DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams, opts ...ClientOption) (*DeleteVcfCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteVcfCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteVcfCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-vcf/{id}", @@ -746,7 +812,12 @@ func (a *Client) DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams) (*De Reader: &DeleteVcfCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -765,13 +836,12 @@ func (a *Client) DeleteVcfCloudAccount(params *DeleteVcfCloudAccountParams) (*De Delete an VMC cloud account with a given id */ -func (a *Client) DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams) (*DeleteVmcCloudAccountNoContent, error) { +func (a *Client) DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams, opts ...ClientOption) (*DeleteVmcCloudAccountNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteVmcCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteVmcCloudAccount", Method: "DELETE", PathPattern: "/iaas/api/cloud-accounts-vmc/{id}", @@ -782,7 +852,12 @@ func (a *Client) DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams) (*De Reader: &DeleteVmcCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -801,13 +876,12 @@ func (a *Client) DeleteVmcCloudAccount(params *DeleteVmcCloudAccountParams) (*De Get the available regions for specified AWS cloud account */ -func (a *Client) EnumerateAwsRegions(params *EnumerateAwsRegionsParams) (*EnumerateAwsRegionsOK, error) { +func (a *Client) EnumerateAwsRegions(params *EnumerateAwsRegionsParams, opts ...ClientOption) (*EnumerateAwsRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateAwsRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateAwsRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-aws/region-enumeration", @@ -818,7 +892,12 @@ func (a *Client) EnumerateAwsRegions(params *EnumerateAwsRegionsParams) (*Enumer Reader: &EnumerateAwsRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -837,13 +916,12 @@ func (a *Client) EnumerateAwsRegions(params *EnumerateAwsRegionsParams) (*Enumer Get the available regions for specified Azure cloud account */ -func (a *Client) EnumerateAzureRegions(params *EnumerateAzureRegionsParams) (*EnumerateAzureRegionsOK, error) { +func (a *Client) EnumerateAzureRegions(params *EnumerateAzureRegionsParams, opts ...ClientOption) (*EnumerateAzureRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateAzureRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateAzureRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-azure/region-enumeration", @@ -854,7 +932,12 @@ func (a *Client) EnumerateAzureRegions(params *EnumerateAzureRegionsParams) (*En Reader: &EnumerateAzureRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -873,13 +956,12 @@ func (a *Client) EnumerateAzureRegions(params *EnumerateAzureRegionsParams) (*En Get the available regions for specified GCP cloud account */ -func (a *Client) EnumerateGcpRegions(params *EnumerateGcpRegionsParams) (*EnumerateGcpRegionsOK, error) { +func (a *Client) EnumerateGcpRegions(params *EnumerateGcpRegionsParams, opts ...ClientOption) (*EnumerateGcpRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateGcpRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateGcpRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-gcp/region-enumeration", @@ -890,7 +972,12 @@ func (a *Client) EnumerateGcpRegions(params *EnumerateGcpRegionsParams) (*Enumer Reader: &EnumerateGcpRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -907,13 +994,12 @@ func (a *Client) EnumerateGcpRegions(params *EnumerateGcpRegionsParams) (*Enumer /* EnumeratePrivateImages enumerates all private images for enabled regions of the specified cloud account */ -func (a *Client) EnumeratePrivateImages(params *EnumeratePrivateImagesParams) error { +func (a *Client) EnumeratePrivateImages(params *EnumeratePrivateImagesParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImages", Method: "POST", PathPattern: "/iaas/api/cloud-accounts/{id}/private-image-enumeration", @@ -924,7 +1010,12 @@ func (a *Client) EnumeratePrivateImages(params *EnumeratePrivateImagesParams) er Reader: &EnumeratePrivateImagesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -934,13 +1025,12 @@ func (a *Client) EnumeratePrivateImages(params *EnumeratePrivateImagesParams) er /* EnumeratePrivateImagesAWS enumerates all private images for enabled regions of the specified a w s account */ -func (a *Client) EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSParams) error { +func (a *Client) EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesAWSParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesAWS", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-aws/{id}/private-image-enumeration", @@ -951,7 +1041,12 @@ func (a *Client) EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSPara Reader: &EnumeratePrivateImagesAWSReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -961,13 +1056,12 @@ func (a *Client) EnumeratePrivateImagesAWS(params *EnumeratePrivateImagesAWSPara /* EnumeratePrivateImagesAzure enumerates all private images for enabled regions of the specified azure account */ -func (a *Client) EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzureParams) error { +func (a *Client) EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzureParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesAzureParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesAzure", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-azure/{id}/private-image-enumeration", @@ -978,7 +1072,12 @@ func (a *Client) EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzure Reader: &EnumeratePrivateImagesAzureReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -988,13 +1087,12 @@ func (a *Client) EnumeratePrivateImagesAzure(params *EnumeratePrivateImagesAzure /* EnumeratePrivateImagesGcp enumerates all private images for enabled regions of the specified g c p account */ -func (a *Client) EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpParams) error { +func (a *Client) EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesGcpParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesGcp", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-gcp/{id}/private-image-enumeration", @@ -1005,7 +1103,12 @@ func (a *Client) EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpPara Reader: &EnumeratePrivateImagesGcpReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -1015,13 +1118,12 @@ func (a *Client) EnumeratePrivateImagesGcp(params *EnumeratePrivateImagesGcpPara /* EnumeratePrivateImagesVCF enumerates all private images for enabled regions of the specified v c f account */ -func (a *Client) EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFParams) error { +func (a *Client) EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesVCFParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesVCF", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vcf/{id}/private-image-enumeration", @@ -1032,7 +1134,12 @@ func (a *Client) EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFPara Reader: &EnumeratePrivateImagesVCFReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -1042,13 +1149,12 @@ func (a *Client) EnumeratePrivateImagesVCF(params *EnumeratePrivateImagesVCFPara /* EnumeratePrivateImagesVMC enumerates all private images for enabled regions of the specified VM c account */ -func (a *Client) EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCParams) error { +func (a *Client) EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesVMCParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesVMC", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vmc/{id}/private-image-enumeration", @@ -1059,7 +1165,12 @@ func (a *Client) EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCPara Reader: &EnumeratePrivateImagesVMCReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -1069,13 +1180,12 @@ func (a *Client) EnumeratePrivateImagesVMC(params *EnumeratePrivateImagesVMCPara /* EnumeratePrivateImagesVSphere enumerates all private images for enabled regions of the specified v sphere account */ -func (a *Client) EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSphereParams) error { +func (a *Client) EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSphereParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewEnumeratePrivateImagesVSphereParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumeratePrivateImagesVSphere", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vsphere/{id}/private-image-enumeration", @@ -1086,7 +1196,12 @@ func (a *Client) EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSp Reader: &EnumeratePrivateImagesVSphereReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -1098,13 +1213,12 @@ func (a *Client) EnumeratePrivateImagesVSphere(params *EnumeratePrivateImagesVSp Get the available regions for specified cloud account */ -func (a *Client) EnumerateRegions(params *EnumerateRegionsParams) (*EnumerateRegionsOK, error) { +func (a *Client) EnumerateRegions(params *EnumerateRegionsParams, opts ...ClientOption) (*EnumerateRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts/region-enumeration", @@ -1115,7 +1229,12 @@ func (a *Client) EnumerateRegions(params *EnumerateRegionsParams) (*EnumerateReg Reader: &EnumerateRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1134,13 +1253,12 @@ func (a *Client) EnumerateRegions(params *EnumerateRegionsParams) (*EnumerateReg Get the available regions for specified vSphere cloud account */ -func (a *Client) EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams) (*EnumerateVSphereRegionsOK, error) { +func (a *Client) EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams, opts ...ClientOption) (*EnumerateVSphereRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateVSphereRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateVSphereRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vsphere/region-enumeration", @@ -1151,7 +1269,12 @@ func (a *Client) EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams) Reader: &EnumerateVSphereRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1170,13 +1293,12 @@ func (a *Client) EnumerateVSphereRegions(params *EnumerateVSphereRegionsParams) Get the available regions for specified VCF cloud account */ -func (a *Client) EnumerateVcfRegions(params *EnumerateVcfRegionsParams) (*EnumerateVcfRegionsOK, error) { +func (a *Client) EnumerateVcfRegions(params *EnumerateVcfRegionsParams, opts ...ClientOption) (*EnumerateVcfRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateVcfRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateVcfRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vcf/region-enumeration", @@ -1187,7 +1309,12 @@ func (a *Client) EnumerateVcfRegions(params *EnumerateVcfRegionsParams) (*Enumer Reader: &EnumerateVcfRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1206,13 +1333,12 @@ func (a *Client) EnumerateVcfRegions(params *EnumerateVcfRegionsParams) (*Enumer Get the available regions for specified VMC cloud account */ -func (a *Client) EnumerateVmcRegions(params *EnumerateVmcRegionsParams) (*EnumerateVmcRegionsOK, error) { +func (a *Client) EnumerateVmcRegions(params *EnumerateVmcRegionsParams, opts ...ClientOption) (*EnumerateVmcRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateVmcRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateVmcRegions", Method: "POST", PathPattern: "/iaas/api/cloud-accounts-vmc/region-enumeration", @@ -1223,7 +1349,12 @@ func (a *Client) EnumerateVmcRegions(params *EnumerateVmcRegionsParams) (*Enumer Reader: &EnumerateVmcRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1242,13 +1373,12 @@ func (a *Client) EnumerateVmcRegions(params *EnumerateVmcRegionsParams) (*Enumer Get an AWS cloud account with a given id */ -func (a *Client) GetAwsCloudAccount(params *GetAwsCloudAccountParams) (*GetAwsCloudAccountOK, error) { +func (a *Client) GetAwsCloudAccount(params *GetAwsCloudAccountParams, opts ...ClientOption) (*GetAwsCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAwsCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAwsCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-aws/{id}", @@ -1259,7 +1389,12 @@ func (a *Client) GetAwsCloudAccount(params *GetAwsCloudAccountParams) (*GetAwsCl Reader: &GetAwsCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1278,13 +1413,12 @@ func (a *Client) GetAwsCloudAccount(params *GetAwsCloudAccountParams) (*GetAwsCl Get all AWS cloud accounts within the current organization */ -func (a *Client) GetAwsCloudAccounts(params *GetAwsCloudAccountsParams) (*GetAwsCloudAccountsOK, error) { +func (a *Client) GetAwsCloudAccounts(params *GetAwsCloudAccountsParams, opts ...ClientOption) (*GetAwsCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAwsCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAwsCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-aws", @@ -1295,7 +1429,12 @@ func (a *Client) GetAwsCloudAccounts(params *GetAwsCloudAccountsParams) (*GetAws Reader: &GetAwsCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1314,13 +1453,12 @@ func (a *Client) GetAwsCloudAccounts(params *GetAwsCloudAccountsParams) (*GetAws Get an Azure Cloud Account with a given id */ -func (a *Client) GetAzureCloudAccount(params *GetAzureCloudAccountParams) (*GetAzureCloudAccountOK, error) { +func (a *Client) GetAzureCloudAccount(params *GetAzureCloudAccountParams, opts ...ClientOption) (*GetAzureCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAzureCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAzureCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-azure/{id}", @@ -1331,7 +1469,12 @@ func (a *Client) GetAzureCloudAccount(params *GetAzureCloudAccountParams) (*GetA Reader: &GetAzureCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1350,13 +1493,12 @@ func (a *Client) GetAzureCloudAccount(params *GetAzureCloudAccountParams) (*GetA Get all Azure cloud accounts within the current organization */ -func (a *Client) GetAzureCloudAccounts(params *GetAzureCloudAccountsParams) (*GetAzureCloudAccountsOK, error) { +func (a *Client) GetAzureCloudAccounts(params *GetAzureCloudAccountsParams, opts ...ClientOption) (*GetAzureCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAzureCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAzureCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-azure", @@ -1367,7 +1509,12 @@ func (a *Client) GetAzureCloudAccounts(params *GetAzureCloudAccountsParams) (*Ge Reader: &GetAzureCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1386,13 +1533,12 @@ func (a *Client) GetAzureCloudAccounts(params *GetAzureCloudAccountsParams) (*Ge Get cloud account with a given id */ -func (a *Client) GetCloudAccount(params *GetCloudAccountParams) (*GetCloudAccountOK, error) { +func (a *Client) GetCloudAccount(params *GetCloudAccountParams, opts ...ClientOption) (*GetCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts/{id}", @@ -1403,7 +1549,12 @@ func (a *Client) GetCloudAccount(params *GetCloudAccountParams) (*GetCloudAccoun Reader: &GetCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1422,13 +1573,12 @@ func (a *Client) GetCloudAccount(params *GetCloudAccountParams) (*GetCloudAccoun Get all cloud accounts within the current organization */ -func (a *Client) GetCloudAccounts(params *GetCloudAccountsParams) (*GetCloudAccountsOK, error) { +func (a *Client) GetCloudAccounts(params *GetCloudAccountsParams, opts ...ClientOption) (*GetCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts", @@ -1439,7 +1589,12 @@ func (a *Client) GetCloudAccounts(params *GetCloudAccountsParams) (*GetCloudAcco Reader: &GetCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1458,13 +1613,12 @@ func (a *Client) GetCloudAccounts(params *GetCloudAccountsParams) (*GetCloudAcco Get an GCP cloud account with a given id */ -func (a *Client) GetGcpCloudAccount(params *GetGcpCloudAccountParams) (*GetGcpCloudAccountOK, error) { +func (a *Client) GetGcpCloudAccount(params *GetGcpCloudAccountParams, opts ...ClientOption) (*GetGcpCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetGcpCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getGcpCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-gcp/{id}", @@ -1475,7 +1629,12 @@ func (a *Client) GetGcpCloudAccount(params *GetGcpCloudAccountParams) (*GetGcpCl Reader: &GetGcpCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1494,13 +1653,12 @@ func (a *Client) GetGcpCloudAccount(params *GetGcpCloudAccountParams) (*GetGcpCl Get all GCP cloud accounts within the current organization */ -func (a *Client) GetGcpCloudAccounts(params *GetGcpCloudAccountsParams) (*GetGcpCloudAccountsOK, error) { +func (a *Client) GetGcpCloudAccounts(params *GetGcpCloudAccountsParams, opts ...ClientOption) (*GetGcpCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetGcpCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getGcpCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-gcp", @@ -1511,7 +1669,12 @@ func (a *Client) GetGcpCloudAccounts(params *GetGcpCloudAccountsParams) (*GetGcp Reader: &GetGcpCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1530,13 +1693,12 @@ func (a *Client) GetGcpCloudAccounts(params *GetGcpCloudAccountsParams) (*GetGcp Get an NSX-T cloud account with a given id */ -func (a *Client) GetNsxTCloudAccount(params *GetNsxTCloudAccountParams) (*GetNsxTCloudAccountOK, error) { +func (a *Client) GetNsxTCloudAccount(params *GetNsxTCloudAccountParams, opts ...ClientOption) (*GetNsxTCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNsxTCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNsxTCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-nsx-t/{id}", @@ -1547,7 +1709,12 @@ func (a *Client) GetNsxTCloudAccount(params *GetNsxTCloudAccountParams) (*GetNsx Reader: &GetNsxTCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1566,13 +1733,12 @@ func (a *Client) GetNsxTCloudAccount(params *GetNsxTCloudAccountParams) (*GetNsx Get all NSX-T cloud accounts within the current organization */ -func (a *Client) GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams) (*GetNsxTCloudAccountsOK, error) { +func (a *Client) GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams, opts ...ClientOption) (*GetNsxTCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNsxTCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNsxTCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-nsx-t", @@ -1583,7 +1749,12 @@ func (a *Client) GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams) (*GetN Reader: &GetNsxTCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1602,13 +1773,12 @@ func (a *Client) GetNsxTCloudAccounts(params *GetNsxTCloudAccountsParams) (*GetN Get an NSX-V cloud account with a given id */ -func (a *Client) GetNsxVCloudAccount(params *GetNsxVCloudAccountParams) (*GetNsxVCloudAccountOK, error) { +func (a *Client) GetNsxVCloudAccount(params *GetNsxVCloudAccountParams, opts ...ClientOption) (*GetNsxVCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNsxVCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNsxVCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-nsx-v/{id}", @@ -1619,7 +1789,12 @@ func (a *Client) GetNsxVCloudAccount(params *GetNsxVCloudAccountParams) (*GetNsx Reader: &GetNsxVCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1638,13 +1813,12 @@ func (a *Client) GetNsxVCloudAccount(params *GetNsxVCloudAccountParams) (*GetNsx Get all NSX-V cloud accounts within the current organization */ -func (a *Client) GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams) (*GetNsxVCloudAccountsOK, error) { +func (a *Client) GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams, opts ...ClientOption) (*GetNsxVCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNsxVCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNsxVCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-nsx-v", @@ -1655,7 +1829,12 @@ func (a *Client) GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams) (*GetN Reader: &GetNsxVCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1674,13 +1853,12 @@ func (a *Client) GetNsxVCloudAccounts(params *GetNsxVCloudAccountsParams) (*GetN Get an vSphere cloud account with a given id */ -func (a *Client) GetVSphereCloudAccount(params *GetVSphereCloudAccountParams) (*GetVSphereCloudAccountOK, error) { +func (a *Client) GetVSphereCloudAccount(params *GetVSphereCloudAccountParams, opts ...ClientOption) (*GetVSphereCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVSphereCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVSphereCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vsphere/{id}", @@ -1691,7 +1869,12 @@ func (a *Client) GetVSphereCloudAccount(params *GetVSphereCloudAccountParams) (* Reader: &GetVSphereCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1710,13 +1893,12 @@ func (a *Client) GetVSphereCloudAccount(params *GetVSphereCloudAccountParams) (* Get all vSphere cloud accounts within the current organization */ -func (a *Client) GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams) (*GetVSphereCloudAccountsOK, error) { +func (a *Client) GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams, opts ...ClientOption) (*GetVSphereCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVSphereCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVSphereCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vsphere", @@ -1727,7 +1909,12 @@ func (a *Client) GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams) Reader: &GetVSphereCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1746,13 +1933,12 @@ func (a *Client) GetVSphereCloudAccounts(params *GetVSphereCloudAccountsParams) Get an VCF cloud account with a given id */ -func (a *Client) GetVcfCloudAccount(params *GetVcfCloudAccountParams) (*GetVcfCloudAccountOK, error) { +func (a *Client) GetVcfCloudAccount(params *GetVcfCloudAccountParams, opts ...ClientOption) (*GetVcfCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVcfCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVcfCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vcf/{id}", @@ -1763,7 +1949,12 @@ func (a *Client) GetVcfCloudAccount(params *GetVcfCloudAccountParams) (*GetVcfCl Reader: &GetVcfCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1782,13 +1973,12 @@ func (a *Client) GetVcfCloudAccount(params *GetVcfCloudAccountParams) (*GetVcfCl Get all VCF cloud accounts within the current organization */ -func (a *Client) GetVcfCloudAccounts(params *GetVcfCloudAccountsParams) (*GetVcfCloudAccountsOK, error) { +func (a *Client) GetVcfCloudAccounts(params *GetVcfCloudAccountsParams, opts ...ClientOption) (*GetVcfCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVcfCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVcfCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vcf", @@ -1799,7 +1989,12 @@ func (a *Client) GetVcfCloudAccounts(params *GetVcfCloudAccountsParams) (*GetVcf Reader: &GetVcfCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1818,13 +2013,12 @@ func (a *Client) GetVcfCloudAccounts(params *GetVcfCloudAccountsParams) (*GetVcf Get an VMC cloud account with a given id */ -func (a *Client) GetVmcCloudAccount(params *GetVmcCloudAccountParams) (*GetVmcCloudAccountOK, error) { +func (a *Client) GetVmcCloudAccount(params *GetVmcCloudAccountParams, opts ...ClientOption) (*GetVmcCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVmcCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVmcCloudAccount", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vmc/{id}", @@ -1835,7 +2029,12 @@ func (a *Client) GetVmcCloudAccount(params *GetVmcCloudAccountParams) (*GetVmcCl Reader: &GetVmcCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1854,13 +2053,12 @@ func (a *Client) GetVmcCloudAccount(params *GetVmcCloudAccountParams) (*GetVmcCl Get all VMC cloud accounts within the current organization */ -func (a *Client) GetVmcCloudAccounts(params *GetVmcCloudAccountsParams) (*GetVmcCloudAccountsOK, error) { +func (a *Client) GetVmcCloudAccounts(params *GetVmcCloudAccountsParams, opts ...ClientOption) (*GetVmcCloudAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVmcCloudAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVmcCloudAccounts", Method: "GET", PathPattern: "/iaas/api/cloud-accounts-vmc", @@ -1871,7 +2069,12 @@ func (a *Client) GetVmcCloudAccounts(params *GetVmcCloudAccountsParams) (*GetVmc Reader: &GetVmcCloudAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1890,13 +2093,12 @@ func (a *Client) GetVmcCloudAccounts(params *GetVmcCloudAccountsParams) (*GetVmc Update AWS cloud account */ -func (a *Client) UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams) (*UpdateAwsCloudAccountOK, error) { +func (a *Client) UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams, opts ...ClientOption) (*UpdateAwsCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAwsCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateAwsCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-aws/{id}", @@ -1907,7 +2109,12 @@ func (a *Client) UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams) (*Up Reader: &UpdateAwsCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1926,13 +2133,12 @@ func (a *Client) UpdateAwsCloudAccount(params *UpdateAwsCloudAccountParams) (*Up Update Azure cloud account */ -func (a *Client) UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams) (*UpdateAzureCloudAccountOK, error) { +func (a *Client) UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams, opts ...ClientOption) (*UpdateAzureCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAzureCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateAzureCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-azure/{id}", @@ -1943,7 +2149,12 @@ func (a *Client) UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams) Reader: &UpdateAzureCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1962,13 +2173,12 @@ func (a *Client) UpdateAzureCloudAccount(params *UpdateAzureCloudAccountParams) Update a single CloudAccount */ -func (a *Client) UpdateCloudAccount(params *UpdateCloudAccountParams) (*UpdateCloudAccountOK, error) { +func (a *Client) UpdateCloudAccount(params *UpdateCloudAccountParams, opts ...ClientOption) (*UpdateCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts/{id}", @@ -1979,7 +2189,12 @@ func (a *Client) UpdateCloudAccount(params *UpdateCloudAccountParams) (*UpdateCl Reader: &UpdateCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1998,13 +2213,12 @@ func (a *Client) UpdateCloudAccount(params *UpdateCloudAccountParams) (*UpdateCl Update GCP cloud account */ -func (a *Client) UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams) (*UpdateGcpCloudAccountOK, error) { +func (a *Client) UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams, opts ...ClientOption) (*UpdateGcpCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateGcpCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateGcpCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-gcp/{id}", @@ -2015,7 +2229,12 @@ func (a *Client) UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams) (*Up Reader: &UpdateGcpCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -2034,13 +2253,12 @@ func (a *Client) UpdateGcpCloudAccount(params *UpdateGcpCloudAccountParams) (*Up Update NSX-T cloud account */ -func (a *Client) UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams) (*UpdateNsxTCloudAccountOK, error) { +func (a *Client) UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams, opts ...ClientOption) (*UpdateNsxTCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateNsxTCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateNsxTCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-nsx-t/{id}", @@ -2051,7 +2269,12 @@ func (a *Client) UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams) (* Reader: &UpdateNsxTCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -2070,13 +2293,12 @@ func (a *Client) UpdateNsxTCloudAccount(params *UpdateNsxTCloudAccountParams) (* Update NSX-V cloud account */ -func (a *Client) UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams) (*UpdateNsxVCloudAccountOK, error) { +func (a *Client) UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams, opts ...ClientOption) (*UpdateNsxVCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateNsxVCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateNsxVCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-nsx-v/{id}", @@ -2087,7 +2309,12 @@ func (a *Client) UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams) (* Reader: &UpdateNsxVCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -2106,13 +2333,12 @@ func (a *Client) UpdateNsxVCloudAccount(params *UpdateNsxVCloudAccountParams) (* Update vSphere cloud account */ -func (a *Client) UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountParams) (*UpdateVSphereCloudAccountOK, error) { +func (a *Client) UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountParams, opts ...ClientOption) (*UpdateVSphereCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateVSphereCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateVSphereCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-vsphere/{id}", @@ -2123,7 +2349,12 @@ func (a *Client) UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountPara Reader: &UpdateVSphereCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -2142,13 +2373,12 @@ func (a *Client) UpdateVSphereCloudAccount(params *UpdateVSphereCloudAccountPara Update VCF cloud account */ -func (a *Client) UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams) (*UpdateVcfCloudAccountOK, error) { +func (a *Client) UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams, opts ...ClientOption) (*UpdateVcfCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateVcfCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateVcfCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-vcf/{id}", @@ -2159,7 +2389,12 @@ func (a *Client) UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams) (*Up Reader: &UpdateVcfCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -2178,13 +2413,12 @@ func (a *Client) UpdateVcfCloudAccount(params *UpdateVcfCloudAccountParams) (*Up Update VMC cloud account */ -func (a *Client) UpdateVmcCloudAccount(params *UpdateVmcCloudAccountParams) (*UpdateVmcCloudAccountOK, error) { +func (a *Client) UpdateVmcCloudAccount(params *UpdateVmcCloudAccountParams, opts ...ClientOption) (*UpdateVmcCloudAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateVmcCloudAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateVmcCloudAccount", Method: "PATCH", PathPattern: "/iaas/api/cloud-accounts-vmc/{id}", @@ -2195,7 +2429,12 @@ func (a *Client) UpdateVmcCloudAccount(params *UpdateVmcCloudAccountParams) (*Up Reader: &UpdateVmcCloudAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/cloud_account/create_aws_cloud_account_parameters.go b/pkg/client/cloud_account/create_aws_cloud_account_parameters.go index dcce27a4..1bce8a4d 100644 --- a/pkg/client/cloud_account/create_aws_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_aws_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateAwsCloudAccountParams creates a new CreateAwsCloudAccountParams object -// with the default values initialized. +// NewCreateAwsCloudAccountParams creates a new CreateAwsCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateAwsCloudAccountParams() *CreateAwsCloudAccountParams { - var () return &CreateAwsCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAwsCloudAccountParamsWithTimeout creates a new CreateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAwsCloudAccountParamsWithTimeout(timeout time.Duration) *CreateAwsCloudAccountParams { - var () return &CreateAwsCloudAccountParams{ - timeout: timeout, } } // NewCreateAwsCloudAccountParamsWithContext creates a new CreateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAwsCloudAccountParamsWithContext(ctx context.Context) *CreateAwsCloudAccountParams { - var () return &CreateAwsCloudAccountParams{ - Context: ctx, } } // NewCreateAwsCloudAccountParamsWithHTTPClient creates a new CreateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAwsCloudAccountParamsWithHTTPClient(client *http.Client) *CreateAwsCloudAccountParams { - var () return &CreateAwsCloudAccountParams{ HTTPClient: client, } } -/*CreateAwsCloudAccountParams contains all the parameters to send to the API endpoint -for the create aws cloud account operation typically these are written to a http.Request +/* CreateAwsCloudAccountParams contains all the parameters to send to the API endpoint + for the create aws cloud account operation. + + Typically these are written to a http.Request. */ type CreateAwsCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountAws specification + /* Body. + + CloudAccountAws specification */ Body *models.CloudAccountAwsSpecification @@ -78,6 +78,21 @@ type CreateAwsCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsCloudAccountParams) WithDefaults() *CreateAwsCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create aws cloud account params func (o *CreateAwsCloudAccountParams) WithTimeout(timeout time.Duration) *CreateAwsCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateAwsCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_aws_cloud_account_responses.go b/pkg/client/cloud_account/create_aws_cloud_account_responses.go index 441711b4..80ef9d8f 100644 --- a/pkg/client/cloud_account/create_aws_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_aws_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateAwsCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateAwsCloudAccountCreated() *CreateAwsCloudAccountCreated { return &CreateAwsCloudAccountCreated{} } -/*CreateAwsCloudAccountCreated handles this case with default header values. +/* CreateAwsCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateAwsCloudAccountCreated struct { func (o *CreateAwsCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws][%d] createAwsCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateAwsCloudAccountCreated) GetPayload() *models.CloudAccountAws { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateAwsCloudAccountBadRequest() *CreateAwsCloudAccountBadRequest { return &CreateAwsCloudAccountBadRequest{} } -/*CreateAwsCloudAccountBadRequest handles this case with default header values. +/* CreateAwsCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateAwsCloudAccountBadRequest struct { func (o *CreateAwsCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws][%d] createAwsCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateAwsCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateAwsCloudAccountForbidden() *CreateAwsCloudAccountForbidden { return &CreateAwsCloudAccountForbidden{} } -/*CreateAwsCloudAccountForbidden handles this case with default header values. +/* CreateAwsCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateAwsCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateAwsCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws][%d] createAwsCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws][%d] createAwsCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateAwsCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateAwsCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_azure_cloud_account_parameters.go b/pkg/client/cloud_account/create_azure_cloud_account_parameters.go index 5894a5de..1021617b 100644 --- a/pkg/client/cloud_account/create_azure_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_azure_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateAzureCloudAccountParams creates a new CreateAzureCloudAccountParams object -// with the default values initialized. +// NewCreateAzureCloudAccountParams creates a new CreateAzureCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateAzureCloudAccountParams() *CreateAzureCloudAccountParams { - var () return &CreateAzureCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAzureCloudAccountParamsWithTimeout creates a new CreateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAzureCloudAccountParamsWithTimeout(timeout time.Duration) *CreateAzureCloudAccountParams { - var () return &CreateAzureCloudAccountParams{ - timeout: timeout, } } // NewCreateAzureCloudAccountParamsWithContext creates a new CreateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAzureCloudAccountParamsWithContext(ctx context.Context) *CreateAzureCloudAccountParams { - var () return &CreateAzureCloudAccountParams{ - Context: ctx, } } // NewCreateAzureCloudAccountParamsWithHTTPClient creates a new CreateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAzureCloudAccountParamsWithHTTPClient(client *http.Client) *CreateAzureCloudAccountParams { - var () return &CreateAzureCloudAccountParams{ HTTPClient: client, } } -/*CreateAzureCloudAccountParams contains all the parameters to send to the API endpoint -for the create azure cloud account operation typically these are written to a http.Request +/* CreateAzureCloudAccountParams contains all the parameters to send to the API endpoint + for the create azure cloud account operation. + + Typically these are written to a http.Request. */ type CreateAzureCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountAzure specification + /* Body. + + CloudAccountAzure specification */ Body *models.CloudAccountAzureSpecification @@ -78,6 +78,21 @@ type CreateAzureCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureCloudAccountParams) WithDefaults() *CreateAzureCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create azure cloud account params func (o *CreateAzureCloudAccountParams) WithTimeout(timeout time.Duration) *CreateAzureCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateAzureCloudAccountParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_azure_cloud_account_responses.go b/pkg/client/cloud_account/create_azure_cloud_account_responses.go index 83de1d1c..cfe62e32 100644 --- a/pkg/client/cloud_account/create_azure_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_azure_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateAzureCloudAccountReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateAzureCloudAccountCreated() *CreateAzureCloudAccountCreated { return &CreateAzureCloudAccountCreated{} } -/*CreateAzureCloudAccountCreated handles this case with default header values. +/* CreateAzureCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateAzureCloudAccountCreated struct { func (o *CreateAzureCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure][%d] createAzureCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateAzureCloudAccountCreated) GetPayload() *models.CloudAccountAzure { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateAzureCloudAccountBadRequest() *CreateAzureCloudAccountBadRequest { return &CreateAzureCloudAccountBadRequest{} } -/*CreateAzureCloudAccountBadRequest handles this case with default header values. +/* CreateAzureCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateAzureCloudAccountBadRequest struct { func (o *CreateAzureCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure][%d] createAzureCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateAzureCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateAzureCloudAccountForbidden() *CreateAzureCloudAccountForbidden { return &CreateAzureCloudAccountForbidden{} } -/*CreateAzureCloudAccountForbidden handles this case with default header values. +/* CreateAzureCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateAzureCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateAzureCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure][%d] createAzureCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure][%d] createAzureCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateAzureCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateAzureCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_cloud_account_parameters.go b/pkg/client/cloud_account/create_cloud_account_parameters.go index eb3fa822..0b4e4993 100644 --- a/pkg/client/cloud_account/create_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateCloudAccountParams creates a new CreateCloudAccountParams object -// with the default values initialized. +// NewCreateCloudAccountParams creates a new CreateCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateCloudAccountParams() *CreateCloudAccountParams { - var () return &CreateCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateCloudAccountParamsWithTimeout creates a new CreateCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateCloudAccountParamsWithTimeout(timeout time.Duration) *CreateCloudAccountParams { - var () return &CreateCloudAccountParams{ - timeout: timeout, } } // NewCreateCloudAccountParamsWithContext creates a new CreateCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateCloudAccountParamsWithContext(ctx context.Context) *CreateCloudAccountParams { - var () return &CreateCloudAccountParams{ - Context: ctx, } } // NewCreateCloudAccountParamsWithHTTPClient creates a new CreateCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateCloudAccountParamsWithHTTPClient(client *http.Client) *CreateCloudAccountParams { - var () return &CreateCloudAccountParams{ HTTPClient: client, } } -/*CreateCloudAccountParams contains all the parameters to send to the API endpoint -for the create cloud account operation typically these are written to a http.Request +/* CreateCloudAccountParams contains all the parameters to send to the API endpoint + for the create cloud account operation. + + Typically these are written to a http.Request. */ type CreateCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount instance + /* Body. + + CloudAccount instance */ Body *models.CloudAccountSpecification @@ -78,6 +78,21 @@ type CreateCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCloudAccountParams) WithDefaults() *CreateCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create cloud account params func (o *CreateCloudAccountParams) WithTimeout(timeout time.Duration) *CreateCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_cloud_account_responses.go b/pkg/client/cloud_account/create_cloud_account_responses.go index b6b0b577..47e2483a 100644 --- a/pkg/client/cloud_account/create_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateCloudAccountCreated() *CreateCloudAccountCreated { return &CreateCloudAccountCreated{} } -/*CreateCloudAccountCreated handles this case with default header values. +/* CreateCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateCloudAccountCreated struct { func (o *CreateCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts][%d] createCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateCloudAccountCreated) GetPayload() *models.CloudAccount { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateCloudAccountBadRequest() *CreateCloudAccountBadRequest { return &CreateCloudAccountBadRequest{} } -/*CreateCloudAccountBadRequest handles this case with default header values. +/* CreateCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateCloudAccountBadRequest struct { func (o *CreateCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts][%d] createCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateCloudAccountForbidden() *CreateCloudAccountForbidden { return &CreateCloudAccountForbidden{} } -/*CreateCloudAccountForbidden handles this case with default header values. +/* CreateCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts][%d] createCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts][%d] createCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_gcp_cloud_account_parameters.go b/pkg/client/cloud_account/create_gcp_cloud_account_parameters.go index 39c65aef..90a281f3 100644 --- a/pkg/client/cloud_account/create_gcp_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_gcp_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateGcpCloudAccountParams creates a new CreateGcpCloudAccountParams object -// with the default values initialized. +// NewCreateGcpCloudAccountParams creates a new CreateGcpCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateGcpCloudAccountParams() *CreateGcpCloudAccountParams { - var () return &CreateGcpCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateGcpCloudAccountParamsWithTimeout creates a new CreateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateGcpCloudAccountParamsWithTimeout(timeout time.Duration) *CreateGcpCloudAccountParams { - var () return &CreateGcpCloudAccountParams{ - timeout: timeout, } } // NewCreateGcpCloudAccountParamsWithContext creates a new CreateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateGcpCloudAccountParamsWithContext(ctx context.Context) *CreateGcpCloudAccountParams { - var () return &CreateGcpCloudAccountParams{ - Context: ctx, } } // NewCreateGcpCloudAccountParamsWithHTTPClient creates a new CreateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateGcpCloudAccountParamsWithHTTPClient(client *http.Client) *CreateGcpCloudAccountParams { - var () return &CreateGcpCloudAccountParams{ HTTPClient: client, } } -/*CreateGcpCloudAccountParams contains all the parameters to send to the API endpoint -for the create gcp cloud account operation typically these are written to a http.Request +/* CreateGcpCloudAccountParams contains all the parameters to send to the API endpoint + for the create gcp cloud account operation. + + Typically these are written to a http.Request. */ type CreateGcpCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountGcp specification + /* Body. + + CloudAccountGcp specification */ Body *models.CloudAccountGcpSpecification @@ -78,6 +78,21 @@ type CreateGcpCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateGcpCloudAccountParams) WithDefaults() *CreateGcpCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateGcpCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create gcp cloud account params func (o *CreateGcpCloudAccountParams) WithTimeout(timeout time.Duration) *CreateGcpCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateGcpCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_gcp_cloud_account_responses.go b/pkg/client/cloud_account/create_gcp_cloud_account_responses.go index c98f35fc..6cd28021 100644 --- a/pkg/client/cloud_account/create_gcp_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_gcp_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateGcpCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateGcpCloudAccountCreated() *CreateGcpCloudAccountCreated { return &CreateGcpCloudAccountCreated{} } -/*CreateGcpCloudAccountCreated handles this case with default header values. +/* CreateGcpCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateGcpCloudAccountCreated struct { func (o *CreateGcpCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp][%d] createGcpCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateGcpCloudAccountCreated) GetPayload() *models.CloudAccountGcp { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateGcpCloudAccountBadRequest() *CreateGcpCloudAccountBadRequest { return &CreateGcpCloudAccountBadRequest{} } -/*CreateGcpCloudAccountBadRequest handles this case with default header values. +/* CreateGcpCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateGcpCloudAccountBadRequest struct { func (o *CreateGcpCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp][%d] createGcpCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateGcpCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateGcpCloudAccountForbidden() *CreateGcpCloudAccountForbidden { return &CreateGcpCloudAccountForbidden{} } -/*CreateGcpCloudAccountForbidden handles this case with default header values. +/* CreateGcpCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateGcpCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateGcpCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp][%d] createGcpCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp][%d] createGcpCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateGcpCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateGcpCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_nsx_t_cloud_account_parameters.go b/pkg/client/cloud_account/create_nsx_t_cloud_account_parameters.go index 41dab2b2..50a789a0 100644 --- a/pkg/client/cloud_account/create_nsx_t_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_nsx_t_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateNsxTCloudAccountParams creates a new CreateNsxTCloudAccountParams object -// with the default values initialized. +// NewCreateNsxTCloudAccountParams creates a new CreateNsxTCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateNsxTCloudAccountParams() *CreateNsxTCloudAccountParams { - var () return &CreateNsxTCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateNsxTCloudAccountParamsWithTimeout creates a new CreateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateNsxTCloudAccountParamsWithTimeout(timeout time.Duration) *CreateNsxTCloudAccountParams { - var () return &CreateNsxTCloudAccountParams{ - timeout: timeout, } } // NewCreateNsxTCloudAccountParamsWithContext creates a new CreateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateNsxTCloudAccountParamsWithContext(ctx context.Context) *CreateNsxTCloudAccountParams { - var () return &CreateNsxTCloudAccountParams{ - Context: ctx, } } // NewCreateNsxTCloudAccountParamsWithHTTPClient creates a new CreateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateNsxTCloudAccountParamsWithHTTPClient(client *http.Client) *CreateNsxTCloudAccountParams { - var () return &CreateNsxTCloudAccountParams{ HTTPClient: client, } } -/*CreateNsxTCloudAccountParams contains all the parameters to send to the API endpoint -for the create nsx t cloud account operation typically these are written to a http.Request +/* CreateNsxTCloudAccountParams contains all the parameters to send to the API endpoint + for the create nsx t cloud account operation. + + Typically these are written to a http.Request. */ type CreateNsxTCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountNsxT specification + /* Body. + + CloudAccountNsxT specification */ Body *models.CloudAccountNsxTSpecification @@ -78,6 +78,21 @@ type CreateNsxTCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNsxTCloudAccountParams) WithDefaults() *CreateNsxTCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNsxTCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create nsx t cloud account params func (o *CreateNsxTCloudAccountParams) WithTimeout(timeout time.Duration) *CreateNsxTCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateNsxTCloudAccountParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_nsx_t_cloud_account_responses.go b/pkg/client/cloud_account/create_nsx_t_cloud_account_responses.go index c1846136..6d5653e4 100644 --- a/pkg/client/cloud_account/create_nsx_t_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_nsx_t_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateNsxTCloudAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateNsxTCloudAccountCreated() *CreateNsxTCloudAccountCreated { return &CreateNsxTCloudAccountCreated{} } -/*CreateNsxTCloudAccountCreated handles this case with default header values. +/* CreateNsxTCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateNsxTCloudAccountCreated struct { func (o *CreateNsxTCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-t][%d] createNsxTCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateNsxTCloudAccountCreated) GetPayload() *models.CloudAccountNsxT { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateNsxTCloudAccountBadRequest() *CreateNsxTCloudAccountBadRequest { return &CreateNsxTCloudAccountBadRequest{} } -/*CreateNsxTCloudAccountBadRequest handles this case with default header values. +/* CreateNsxTCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateNsxTCloudAccountBadRequest struct { func (o *CreateNsxTCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-t][%d] createNsxTCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateNsxTCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateNsxTCloudAccountForbidden() *CreateNsxTCloudAccountForbidden { return &CreateNsxTCloudAccountForbidden{} } -/*CreateNsxTCloudAccountForbidden handles this case with default header values. +/* CreateNsxTCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateNsxTCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateNsxTCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-t][%d] createNsxTCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-t][%d] createNsxTCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateNsxTCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateNsxTCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_nsx_v_cloud_account_parameters.go b/pkg/client/cloud_account/create_nsx_v_cloud_account_parameters.go index 844574d0..51981962 100644 --- a/pkg/client/cloud_account/create_nsx_v_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_nsx_v_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateNsxVCloudAccountParams creates a new CreateNsxVCloudAccountParams object -// with the default values initialized. +// NewCreateNsxVCloudAccountParams creates a new CreateNsxVCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateNsxVCloudAccountParams() *CreateNsxVCloudAccountParams { - var () return &CreateNsxVCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateNsxVCloudAccountParamsWithTimeout creates a new CreateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateNsxVCloudAccountParamsWithTimeout(timeout time.Duration) *CreateNsxVCloudAccountParams { - var () return &CreateNsxVCloudAccountParams{ - timeout: timeout, } } // NewCreateNsxVCloudAccountParamsWithContext creates a new CreateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateNsxVCloudAccountParamsWithContext(ctx context.Context) *CreateNsxVCloudAccountParams { - var () return &CreateNsxVCloudAccountParams{ - Context: ctx, } } // NewCreateNsxVCloudAccountParamsWithHTTPClient creates a new CreateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateNsxVCloudAccountParamsWithHTTPClient(client *http.Client) *CreateNsxVCloudAccountParams { - var () return &CreateNsxVCloudAccountParams{ HTTPClient: client, } } -/*CreateNsxVCloudAccountParams contains all the parameters to send to the API endpoint -for the create nsx v cloud account operation typically these are written to a http.Request +/* CreateNsxVCloudAccountParams contains all the parameters to send to the API endpoint + for the create nsx v cloud account operation. + + Typically these are written to a http.Request. */ type CreateNsxVCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountNsxV specification + /* Body. + + CloudAccountNsxV specification */ Body *models.CloudAccountNsxVSpecification @@ -78,6 +78,21 @@ type CreateNsxVCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNsxVCloudAccountParams) WithDefaults() *CreateNsxVCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNsxVCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create nsx v cloud account params func (o *CreateNsxVCloudAccountParams) WithTimeout(timeout time.Duration) *CreateNsxVCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateNsxVCloudAccountParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_nsx_v_cloud_account_responses.go b/pkg/client/cloud_account/create_nsx_v_cloud_account_responses.go index 38e44092..f1d70cbe 100644 --- a/pkg/client/cloud_account/create_nsx_v_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_nsx_v_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateNsxVCloudAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateNsxVCloudAccountCreated() *CreateNsxVCloudAccountCreated { return &CreateNsxVCloudAccountCreated{} } -/*CreateNsxVCloudAccountCreated handles this case with default header values. +/* CreateNsxVCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateNsxVCloudAccountCreated struct { func (o *CreateNsxVCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-v][%d] createNsxVCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateNsxVCloudAccountCreated) GetPayload() *models.CloudAccountNsxV { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateNsxVCloudAccountBadRequest() *CreateNsxVCloudAccountBadRequest { return &CreateNsxVCloudAccountBadRequest{} } -/*CreateNsxVCloudAccountBadRequest handles this case with default header values. +/* CreateNsxVCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateNsxVCloudAccountBadRequest struct { func (o *CreateNsxVCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-v][%d] createNsxVCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateNsxVCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateNsxVCloudAccountForbidden() *CreateNsxVCloudAccountForbidden { return &CreateNsxVCloudAccountForbidden{} } -/*CreateNsxVCloudAccountForbidden handles this case with default header values. +/* CreateNsxVCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateNsxVCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateNsxVCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-v][%d] createNsxVCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-nsx-v][%d] createNsxVCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateNsxVCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateNsxVCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_vcf_cloud_account_parameters.go b/pkg/client/cloud_account/create_vcf_cloud_account_parameters.go index fadcdf01..3fa6eedf 100644 --- a/pkg/client/cloud_account/create_vcf_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_vcf_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateVcfCloudAccountParams creates a new CreateVcfCloudAccountParams object -// with the default values initialized. +// NewCreateVcfCloudAccountParams creates a new CreateVcfCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateVcfCloudAccountParams() *CreateVcfCloudAccountParams { - var () return &CreateVcfCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateVcfCloudAccountParamsWithTimeout creates a new CreateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateVcfCloudAccountParamsWithTimeout(timeout time.Duration) *CreateVcfCloudAccountParams { - var () return &CreateVcfCloudAccountParams{ - timeout: timeout, } } // NewCreateVcfCloudAccountParamsWithContext creates a new CreateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateVcfCloudAccountParamsWithContext(ctx context.Context) *CreateVcfCloudAccountParams { - var () return &CreateVcfCloudAccountParams{ - Context: ctx, } } // NewCreateVcfCloudAccountParamsWithHTTPClient creates a new CreateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateVcfCloudAccountParamsWithHTTPClient(client *http.Client) *CreateVcfCloudAccountParams { - var () return &CreateVcfCloudAccountParams{ HTTPClient: client, } } -/*CreateVcfCloudAccountParams contains all the parameters to send to the API endpoint -for the create vcf cloud account operation typically these are written to a http.Request +/* CreateVcfCloudAccountParams contains all the parameters to send to the API endpoint + for the create vcf cloud account operation. + + Typically these are written to a http.Request. */ type CreateVcfCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountVcf specification + /* Body. + + CloudAccountVcf specification */ Body *models.CloudAccountVcfSpecification @@ -78,6 +78,21 @@ type CreateVcfCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVcfCloudAccountParams) WithDefaults() *CreateVcfCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVcfCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create vcf cloud account params func (o *CreateVcfCloudAccountParams) WithTimeout(timeout time.Duration) *CreateVcfCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateVcfCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_vcf_cloud_account_responses.go b/pkg/client/cloud_account/create_vcf_cloud_account_responses.go index 7937420d..e2dead53 100644 --- a/pkg/client/cloud_account/create_vcf_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_vcf_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateVcfCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateVcfCloudAccountCreated() *CreateVcfCloudAccountCreated { return &CreateVcfCloudAccountCreated{} } -/*CreateVcfCloudAccountCreated handles this case with default header values. +/* CreateVcfCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateVcfCloudAccountCreated struct { func (o *CreateVcfCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf][%d] createVcfCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateVcfCloudAccountCreated) GetPayload() *models.CloudAccountVcf { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateVcfCloudAccountBadRequest() *CreateVcfCloudAccountBadRequest { return &CreateVcfCloudAccountBadRequest{} } -/*CreateVcfCloudAccountBadRequest handles this case with default header values. +/* CreateVcfCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateVcfCloudAccountBadRequest struct { func (o *CreateVcfCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf][%d] createVcfCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateVcfCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateVcfCloudAccountForbidden() *CreateVcfCloudAccountForbidden { return &CreateVcfCloudAccountForbidden{} } -/*CreateVcfCloudAccountForbidden handles this case with default header values. +/* CreateVcfCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateVcfCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateVcfCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf][%d] createVcfCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf][%d] createVcfCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateVcfCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateVcfCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_vmc_cloud_account_parameters.go b/pkg/client/cloud_account/create_vmc_cloud_account_parameters.go index 4480eeca..97df546d 100644 --- a/pkg/client/cloud_account/create_vmc_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_vmc_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateVmcCloudAccountParams creates a new CreateVmcCloudAccountParams object -// with the default values initialized. +// NewCreateVmcCloudAccountParams creates a new CreateVmcCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateVmcCloudAccountParams() *CreateVmcCloudAccountParams { - var () return &CreateVmcCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateVmcCloudAccountParamsWithTimeout creates a new CreateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateVmcCloudAccountParamsWithTimeout(timeout time.Duration) *CreateVmcCloudAccountParams { - var () return &CreateVmcCloudAccountParams{ - timeout: timeout, } } // NewCreateVmcCloudAccountParamsWithContext creates a new CreateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateVmcCloudAccountParamsWithContext(ctx context.Context) *CreateVmcCloudAccountParams { - var () return &CreateVmcCloudAccountParams{ - Context: ctx, } } // NewCreateVmcCloudAccountParamsWithHTTPClient creates a new CreateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateVmcCloudAccountParamsWithHTTPClient(client *http.Client) *CreateVmcCloudAccountParams { - var () return &CreateVmcCloudAccountParams{ HTTPClient: client, } } -/*CreateVmcCloudAccountParams contains all the parameters to send to the API endpoint -for the create vmc cloud account operation typically these are written to a http.Request +/* CreateVmcCloudAccountParams contains all the parameters to send to the API endpoint + for the create vmc cloud account operation. + + Typically these are written to a http.Request. */ type CreateVmcCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountVmc specification + /* Body. + + CloudAccountVmc specification */ Body *models.CloudAccountVmcSpecification @@ -78,6 +78,21 @@ type CreateVmcCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVmcCloudAccountParams) WithDefaults() *CreateVmcCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVmcCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create vmc cloud account params func (o *CreateVmcCloudAccountParams) WithTimeout(timeout time.Duration) *CreateVmcCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateVmcCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_vmc_cloud_account_responses.go b/pkg/client/cloud_account/create_vmc_cloud_account_responses.go index 6e8e5e5c..7d6fa78b 100644 --- a/pkg/client/cloud_account/create_vmc_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_vmc_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateVmcCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateVmcCloudAccountCreated() *CreateVmcCloudAccountCreated { return &CreateVmcCloudAccountCreated{} } -/*CreateVmcCloudAccountCreated handles this case with default header values. +/* CreateVmcCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateVmcCloudAccountCreated struct { func (o *CreateVmcCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc][%d] createVmcCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateVmcCloudAccountCreated) GetPayload() *models.CloudAccountVmc { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateVmcCloudAccountBadRequest() *CreateVmcCloudAccountBadRequest { return &CreateVmcCloudAccountBadRequest{} } -/*CreateVmcCloudAccountBadRequest handles this case with default header values. +/* CreateVmcCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateVmcCloudAccountBadRequest struct { func (o *CreateVmcCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc][%d] createVmcCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateVmcCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateVmcCloudAccountForbidden() *CreateVmcCloudAccountForbidden { return &CreateVmcCloudAccountForbidden{} } -/*CreateVmcCloudAccountForbidden handles this case with default header values. +/* CreateVmcCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateVmcCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateVmcCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc][%d] createVmcCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc][%d] createVmcCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateVmcCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateVmcCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/create_vsphere_cloud_account_parameters.go b/pkg/client/cloud_account/create_vsphere_cloud_account_parameters.go index 932dad43..98586ce1 100644 --- a/pkg/client/cloud_account/create_vsphere_cloud_account_parameters.go +++ b/pkg/client/cloud_account/create_vsphere_cloud_account_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateVSphereCloudAccountParams creates a new CreateVSphereCloudAccountParams object -// with the default values initialized. +// NewCreateVSphereCloudAccountParams creates a new CreateVSphereCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateVSphereCloudAccountParams() *CreateVSphereCloudAccountParams { - var () return &CreateVSphereCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewCreateVSphereCloudAccountParamsWithTimeout creates a new CreateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateVSphereCloudAccountParamsWithTimeout(timeout time.Duration) *CreateVSphereCloudAccountParams { - var () return &CreateVSphereCloudAccountParams{ - timeout: timeout, } } // NewCreateVSphereCloudAccountParamsWithContext creates a new CreateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateVSphereCloudAccountParamsWithContext(ctx context.Context) *CreateVSphereCloudAccountParams { - var () return &CreateVSphereCloudAccountParams{ - Context: ctx, } } // NewCreateVSphereCloudAccountParamsWithHTTPClient creates a new CreateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateVSphereCloudAccountParamsWithHTTPClient(client *http.Client) *CreateVSphereCloudAccountParams { - var () return &CreateVSphereCloudAccountParams{ HTTPClient: client, } } -/*CreateVSphereCloudAccountParams contains all the parameters to send to the API endpoint -for the create v sphere cloud account operation typically these are written to a http.Request +/* CreateVSphereCloudAccountParams contains all the parameters to send to the API endpoint + for the create v sphere cloud account operation. + + Typically these are written to a http.Request. */ type CreateVSphereCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountVsphere specification + /* Body. + + CloudAccountVsphere specification */ Body *models.CloudAccountVsphereSpecification @@ -78,6 +78,21 @@ type CreateVSphereCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVSphereCloudAccountParams) WithDefaults() *CreateVSphereCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVSphereCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create v sphere cloud account params func (o *CreateVSphereCloudAccountParams) WithTimeout(timeout time.Duration) *CreateVSphereCloudAccountParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateVSphereCloudAccountParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/create_vsphere_cloud_account_responses.go b/pkg/client/cloud_account/create_vsphere_cloud_account_responses.go index a95c5b76..3f1657eb 100644 --- a/pkg/client/cloud_account/create_vsphere_cloud_account_responses.go +++ b/pkg/client/cloud_account/create_vsphere_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *CreateVSphereCloudAccountReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateVSphereCloudAccountCreated() *CreateVSphereCloudAccountCreated { return &CreateVSphereCloudAccountCreated{} } -/*CreateVSphereCloudAccountCreated handles this case with default header values. +/* CreateVSphereCloudAccountCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateVSphereCloudAccountCreated struct { func (o *CreateVSphereCloudAccountCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere][%d] createVSphereCloudAccountCreated %+v", 201, o.Payload) } - func (o *CreateVSphereCloudAccountCreated) GetPayload() *models.CloudAccountVsphere { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateVSphereCloudAccountBadRequest() *CreateVSphereCloudAccountBadReque return &CreateVSphereCloudAccountBadRequest{} } -/*CreateVSphereCloudAccountBadRequest handles this case with default header values. +/* CreateVSphereCloudAccountBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateVSphereCloudAccountBadRequest struct { func (o *CreateVSphereCloudAccountBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere][%d] createVSphereCloudAccountBadRequest %+v", 400, o.Payload) } - func (o *CreateVSphereCloudAccountBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateVSphereCloudAccountForbidden() *CreateVSphereCloudAccountForbidden return &CreateVSphereCloudAccountForbidden{} } -/*CreateVSphereCloudAccountForbidden handles this case with default header values. +/* CreateVSphereCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateVSphereCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateVSphereCloudAccountForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere][%d] createVSphereCloudAccountForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere][%d] createVSphereCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *CreateVSphereCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateVSphereCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_aws_cloud_account_parameters.go b/pkg/client/cloud_account/delete_aws_cloud_account_parameters.go index 942b098d..2e1382be 100644 --- a/pkg/client/cloud_account/delete_aws_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_aws_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAwsCloudAccountParams creates a new DeleteAwsCloudAccountParams object -// with the default values initialized. +// NewDeleteAwsCloudAccountParams creates a new DeleteAwsCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteAwsCloudAccountParams() *DeleteAwsCloudAccountParams { - var () return &DeleteAwsCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAwsCloudAccountParamsWithTimeout creates a new DeleteAwsCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAwsCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteAwsCloudAccountParams { - var () return &DeleteAwsCloudAccountParams{ - timeout: timeout, } } // NewDeleteAwsCloudAccountParamsWithContext creates a new DeleteAwsCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAwsCloudAccountParamsWithContext(ctx context.Context) *DeleteAwsCloudAccountParams { - var () return &DeleteAwsCloudAccountParams{ - Context: ctx, } } // NewDeleteAwsCloudAccountParamsWithHTTPClient creates a new DeleteAwsCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAwsCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteAwsCloudAccountParams { - var () return &DeleteAwsCloudAccountParams{ HTTPClient: client, } } -/*DeleteAwsCloudAccountParams contains all the parameters to send to the API endpoint -for the delete aws cloud account operation typically these are written to a http.Request +/* DeleteAwsCloudAccountParams contains all the parameters to send to the API endpoint + for the delete aws cloud account operation. + + Typically these are written to a http.Request. */ type DeleteAwsCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteAwsCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAwsCloudAccountParams) WithDefaults() *DeleteAwsCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAwsCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete aws cloud account params func (o *DeleteAwsCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteAwsCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteAwsCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_aws_cloud_account_responses.go b/pkg/client/cloud_account/delete_aws_cloud_account_responses.go index 9a3735fd..b3c83093 100644 --- a/pkg/client/cloud_account/delete_aws_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_aws_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteAwsCloudAccountReader is a Reader for the DeleteAwsCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteAwsCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteAwsCloudAccountNoContent() *DeleteAwsCloudAccountNoContent { return &DeleteAwsCloudAccountNoContent{} } -/*DeleteAwsCloudAccountNoContent handles this case with default header values. +/* DeleteAwsCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteAwsCloudAccountForbidden() *DeleteAwsCloudAccountForbidden { return &DeleteAwsCloudAccountForbidden{} } -/*DeleteAwsCloudAccountForbidden handles this case with default header values. +/* DeleteAwsCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteAwsCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteAwsCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-aws/{id}][%d] deleteAwsCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-aws/{id}][%d] deleteAwsCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteAwsCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteAwsCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_azure_cloud_account_parameters.go b/pkg/client/cloud_account/delete_azure_cloud_account_parameters.go index 63137cc3..4e4882ec 100644 --- a/pkg/client/cloud_account/delete_azure_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_azure_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAzureCloudAccountParams creates a new DeleteAzureCloudAccountParams object -// with the default values initialized. +// NewDeleteAzureCloudAccountParams creates a new DeleteAzureCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteAzureCloudAccountParams() *DeleteAzureCloudAccountParams { - var () return &DeleteAzureCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAzureCloudAccountParamsWithTimeout creates a new DeleteAzureCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAzureCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteAzureCloudAccountParams { - var () return &DeleteAzureCloudAccountParams{ - timeout: timeout, } } // NewDeleteAzureCloudAccountParamsWithContext creates a new DeleteAzureCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAzureCloudAccountParamsWithContext(ctx context.Context) *DeleteAzureCloudAccountParams { - var () return &DeleteAzureCloudAccountParams{ - Context: ctx, } } // NewDeleteAzureCloudAccountParamsWithHTTPClient creates a new DeleteAzureCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAzureCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteAzureCloudAccountParams { - var () return &DeleteAzureCloudAccountParams{ HTTPClient: client, } } -/*DeleteAzureCloudAccountParams contains all the parameters to send to the API endpoint -for the delete azure cloud account operation typically these are written to a http.Request +/* DeleteAzureCloudAccountParams contains all the parameters to send to the API endpoint + for the delete azure cloud account operation. + + Typically these are written to a http.Request. */ type DeleteAzureCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteAzureCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAzureCloudAccountParams) WithDefaults() *DeleteAzureCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAzureCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete azure cloud account params func (o *DeleteAzureCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteAzureCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteAzureCloudAccountParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_azure_cloud_account_responses.go b/pkg/client/cloud_account/delete_azure_cloud_account_responses.go index 9c5035db..e60d9659 100644 --- a/pkg/client/cloud_account/delete_azure_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_azure_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteAzureCloudAccountReader is a Reader for the DeleteAzureCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteAzureCloudAccountReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteAzureCloudAccountNoContent() *DeleteAzureCloudAccountNoContent { return &DeleteAzureCloudAccountNoContent{} } -/*DeleteAzureCloudAccountNoContent handles this case with default header values. +/* DeleteAzureCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteAzureCloudAccountForbidden() *DeleteAzureCloudAccountForbidden { return &DeleteAzureCloudAccountForbidden{} } -/*DeleteAzureCloudAccountForbidden handles this case with default header values. +/* DeleteAzureCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteAzureCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteAzureCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-azure/{id}][%d] deleteAzureCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-azure/{id}][%d] deleteAzureCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteAzureCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteAzureCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_cloud_account_nsx_t_parameters.go b/pkg/client/cloud_account/delete_cloud_account_nsx_t_parameters.go index e7404319..fd734891 100644 --- a/pkg/client/cloud_account/delete_cloud_account_nsx_t_parameters.go +++ b/pkg/client/cloud_account/delete_cloud_account_nsx_t_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCloudAccountNsxTParams creates a new DeleteCloudAccountNsxTParams object -// with the default values initialized. +// NewDeleteCloudAccountNsxTParams creates a new DeleteCloudAccountNsxTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteCloudAccountNsxTParams() *DeleteCloudAccountNsxTParams { - var () return &DeleteCloudAccountNsxTParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteCloudAccountNsxTParamsWithTimeout creates a new DeleteCloudAccountNsxTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteCloudAccountNsxTParamsWithTimeout(timeout time.Duration) *DeleteCloudAccountNsxTParams { - var () return &DeleteCloudAccountNsxTParams{ - timeout: timeout, } } // NewDeleteCloudAccountNsxTParamsWithContext creates a new DeleteCloudAccountNsxTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteCloudAccountNsxTParamsWithContext(ctx context.Context) *DeleteCloudAccountNsxTParams { - var () return &DeleteCloudAccountNsxTParams{ - Context: ctx, } } // NewDeleteCloudAccountNsxTParamsWithHTTPClient creates a new DeleteCloudAccountNsxTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteCloudAccountNsxTParamsWithHTTPClient(client *http.Client) *DeleteCloudAccountNsxTParams { - var () return &DeleteCloudAccountNsxTParams{ HTTPClient: client, } } -/*DeleteCloudAccountNsxTParams contains all the parameters to send to the API endpoint -for the delete cloud account nsx t operation typically these are written to a http.Request +/* DeleteCloudAccountNsxTParams contains all the parameters to send to the API endpoint + for the delete cloud account nsx t operation. + + Typically these are written to a http.Request. */ type DeleteCloudAccountNsxTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteCloudAccountNsxTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete cloud account nsx t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountNsxTParams) WithDefaults() *DeleteCloudAccountNsxTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete cloud account nsx t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountNsxTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete cloud account nsx t params func (o *DeleteCloudAccountNsxTParams) WithTimeout(timeout time.Duration) *DeleteCloudAccountNsxTParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteCloudAccountNsxTParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_cloud_account_nsx_t_responses.go b/pkg/client/cloud_account/delete_cloud_account_nsx_t_responses.go index 96005889..0139237e 100644 --- a/pkg/client/cloud_account/delete_cloud_account_nsx_t_responses.go +++ b/pkg/client/cloud_account/delete_cloud_account_nsx_t_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteCloudAccountNsxTReader is a Reader for the DeleteCloudAccountNsxT structure. @@ -32,7 +35,6 @@ func (o *DeleteCloudAccountNsxTReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteCloudAccountNsxTNoContent() *DeleteCloudAccountNsxTNoContent { return &DeleteCloudAccountNsxTNoContent{} } -/*DeleteCloudAccountNsxTNoContent handles this case with default header values. +/* DeleteCloudAccountNsxTNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteCloudAccountNsxTForbidden() *DeleteCloudAccountNsxTForbidden { return &DeleteCloudAccountNsxTForbidden{} } -/*DeleteCloudAccountNsxTForbidden handles this case with default header values. +/* DeleteCloudAccountNsxTForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteCloudAccountNsxTForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteCloudAccountNsxTForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-nsx-t/{id}][%d] deleteCloudAccountNsxTForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-nsx-t/{id}][%d] deleteCloudAccountNsxTForbidden %+v", 403, o.Payload) +} +func (o *DeleteCloudAccountNsxTForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteCloudAccountNsxTForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_cloud_account_nsx_v_parameters.go b/pkg/client/cloud_account/delete_cloud_account_nsx_v_parameters.go index 0c25c8a8..d9251217 100644 --- a/pkg/client/cloud_account/delete_cloud_account_nsx_v_parameters.go +++ b/pkg/client/cloud_account/delete_cloud_account_nsx_v_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCloudAccountNsxVParams creates a new DeleteCloudAccountNsxVParams object -// with the default values initialized. +// NewDeleteCloudAccountNsxVParams creates a new DeleteCloudAccountNsxVParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteCloudAccountNsxVParams() *DeleteCloudAccountNsxVParams { - var () return &DeleteCloudAccountNsxVParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteCloudAccountNsxVParamsWithTimeout creates a new DeleteCloudAccountNsxVParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteCloudAccountNsxVParamsWithTimeout(timeout time.Duration) *DeleteCloudAccountNsxVParams { - var () return &DeleteCloudAccountNsxVParams{ - timeout: timeout, } } // NewDeleteCloudAccountNsxVParamsWithContext creates a new DeleteCloudAccountNsxVParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteCloudAccountNsxVParamsWithContext(ctx context.Context) *DeleteCloudAccountNsxVParams { - var () return &DeleteCloudAccountNsxVParams{ - Context: ctx, } } // NewDeleteCloudAccountNsxVParamsWithHTTPClient creates a new DeleteCloudAccountNsxVParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteCloudAccountNsxVParamsWithHTTPClient(client *http.Client) *DeleteCloudAccountNsxVParams { - var () return &DeleteCloudAccountNsxVParams{ HTTPClient: client, } } -/*DeleteCloudAccountNsxVParams contains all the parameters to send to the API endpoint -for the delete cloud account nsx v operation typically these are written to a http.Request +/* DeleteCloudAccountNsxVParams contains all the parameters to send to the API endpoint + for the delete cloud account nsx v operation. + + Typically these are written to a http.Request. */ type DeleteCloudAccountNsxVParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteCloudAccountNsxVParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete cloud account nsx v params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountNsxVParams) WithDefaults() *DeleteCloudAccountNsxVParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete cloud account nsx v params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountNsxVParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete cloud account nsx v params func (o *DeleteCloudAccountNsxVParams) WithTimeout(timeout time.Duration) *DeleteCloudAccountNsxVParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteCloudAccountNsxVParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_cloud_account_nsx_v_responses.go b/pkg/client/cloud_account/delete_cloud_account_nsx_v_responses.go index 368d5bf2..7521b80b 100644 --- a/pkg/client/cloud_account/delete_cloud_account_nsx_v_responses.go +++ b/pkg/client/cloud_account/delete_cloud_account_nsx_v_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteCloudAccountNsxVReader is a Reader for the DeleteCloudAccountNsxV structure. @@ -32,7 +35,6 @@ func (o *DeleteCloudAccountNsxVReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteCloudAccountNsxVNoContent() *DeleteCloudAccountNsxVNoContent { return &DeleteCloudAccountNsxVNoContent{} } -/*DeleteCloudAccountNsxVNoContent handles this case with default header values. +/* DeleteCloudAccountNsxVNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteCloudAccountNsxVForbidden() *DeleteCloudAccountNsxVForbidden { return &DeleteCloudAccountNsxVForbidden{} } -/*DeleteCloudAccountNsxVForbidden handles this case with default header values. +/* DeleteCloudAccountNsxVForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteCloudAccountNsxVForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteCloudAccountNsxVForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-nsx-v/{id}][%d] deleteCloudAccountNsxVForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-nsx-v/{id}][%d] deleteCloudAccountNsxVForbidden %+v", 403, o.Payload) +} +func (o *DeleteCloudAccountNsxVForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteCloudAccountNsxVForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_cloud_account_parameters.go b/pkg/client/cloud_account/delete_cloud_account_parameters.go index 287e79c3..94de3031 100644 --- a/pkg/client/cloud_account/delete_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCloudAccountParams creates a new DeleteCloudAccountParams object -// with the default values initialized. +// NewDeleteCloudAccountParams creates a new DeleteCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteCloudAccountParams() *DeleteCloudAccountParams { - var () return &DeleteCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteCloudAccountParamsWithTimeout creates a new DeleteCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteCloudAccountParams { - var () return &DeleteCloudAccountParams{ - timeout: timeout, } } // NewDeleteCloudAccountParamsWithContext creates a new DeleteCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteCloudAccountParamsWithContext(ctx context.Context) *DeleteCloudAccountParams { - var () return &DeleteCloudAccountParams{ - Context: ctx, } } // NewDeleteCloudAccountParamsWithHTTPClient creates a new DeleteCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteCloudAccountParams { - var () return &DeleteCloudAccountParams{ HTTPClient: client, } } -/*DeleteCloudAccountParams contains all the parameters to send to the API endpoint -for the delete cloud account operation typically these are written to a http.Request +/* DeleteCloudAccountParams contains all the parameters to send to the API endpoint + for the delete cloud account operation. + + Typically these are written to a http.Request. */ type DeleteCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountParams) WithDefaults() *DeleteCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete cloud account params func (o *DeleteCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_cloud_account_responses.go b/pkg/client/cloud_account/delete_cloud_account_responses.go index 79a5123b..7f0e7d25 100644 --- a/pkg/client/cloud_account/delete_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteCloudAccountReader is a Reader for the DeleteCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteCloudAccountNoContent() *DeleteCloudAccountNoContent { return &DeleteCloudAccountNoContent{} } -/*DeleteCloudAccountNoContent handles this case with default header values. +/* DeleteCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteCloudAccountForbidden() *DeleteCloudAccountForbidden { return &DeleteCloudAccountForbidden{} } -/*DeleteCloudAccountForbidden handles this case with default header values. +/* DeleteCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts/{id}][%d] deleteCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts/{id}][%d] deleteCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_gcp_cloud_account_parameters.go b/pkg/client/cloud_account/delete_gcp_cloud_account_parameters.go index 8628906f..cfabafff 100644 --- a/pkg/client/cloud_account/delete_gcp_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_gcp_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteGcpCloudAccountParams creates a new DeleteGcpCloudAccountParams object -// with the default values initialized. +// NewDeleteGcpCloudAccountParams creates a new DeleteGcpCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteGcpCloudAccountParams() *DeleteGcpCloudAccountParams { - var () return &DeleteGcpCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteGcpCloudAccountParamsWithTimeout creates a new DeleteGcpCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteGcpCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteGcpCloudAccountParams { - var () return &DeleteGcpCloudAccountParams{ - timeout: timeout, } } // NewDeleteGcpCloudAccountParamsWithContext creates a new DeleteGcpCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteGcpCloudAccountParamsWithContext(ctx context.Context) *DeleteGcpCloudAccountParams { - var () return &DeleteGcpCloudAccountParams{ - Context: ctx, } } // NewDeleteGcpCloudAccountParamsWithHTTPClient creates a new DeleteGcpCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteGcpCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteGcpCloudAccountParams { - var () return &DeleteGcpCloudAccountParams{ HTTPClient: client, } } -/*DeleteGcpCloudAccountParams contains all the parameters to send to the API endpoint -for the delete gcp cloud account operation typically these are written to a http.Request +/* DeleteGcpCloudAccountParams contains all the parameters to send to the API endpoint + for the delete gcp cloud account operation. + + Typically these are written to a http.Request. */ type DeleteGcpCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteGcpCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteGcpCloudAccountParams) WithDefaults() *DeleteGcpCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteGcpCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete gcp cloud account params func (o *DeleteGcpCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteGcpCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteGcpCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_gcp_cloud_account_responses.go b/pkg/client/cloud_account/delete_gcp_cloud_account_responses.go index 97652d9f..4610a423 100644 --- a/pkg/client/cloud_account/delete_gcp_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_gcp_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteGcpCloudAccountReader is a Reader for the DeleteGcpCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteGcpCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteGcpCloudAccountNoContent() *DeleteGcpCloudAccountNoContent { return &DeleteGcpCloudAccountNoContent{} } -/*DeleteGcpCloudAccountNoContent handles this case with default header values. +/* DeleteGcpCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteGcpCloudAccountForbidden() *DeleteGcpCloudAccountForbidden { return &DeleteGcpCloudAccountForbidden{} } -/*DeleteGcpCloudAccountForbidden handles this case with default header values. +/* DeleteGcpCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteGcpCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteGcpCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-gcp/{id}][%d] deleteGcpCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-gcp/{id}][%d] deleteGcpCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteGcpCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteGcpCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_vcf_cloud_account_parameters.go b/pkg/client/cloud_account/delete_vcf_cloud_account_parameters.go index 9745b740..d1ea7109 100644 --- a/pkg/client/cloud_account/delete_vcf_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_vcf_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteVcfCloudAccountParams creates a new DeleteVcfCloudAccountParams object -// with the default values initialized. +// NewDeleteVcfCloudAccountParams creates a new DeleteVcfCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteVcfCloudAccountParams() *DeleteVcfCloudAccountParams { - var () return &DeleteVcfCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteVcfCloudAccountParamsWithTimeout creates a new DeleteVcfCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteVcfCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteVcfCloudAccountParams { - var () return &DeleteVcfCloudAccountParams{ - timeout: timeout, } } // NewDeleteVcfCloudAccountParamsWithContext creates a new DeleteVcfCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteVcfCloudAccountParamsWithContext(ctx context.Context) *DeleteVcfCloudAccountParams { - var () return &DeleteVcfCloudAccountParams{ - Context: ctx, } } // NewDeleteVcfCloudAccountParamsWithHTTPClient creates a new DeleteVcfCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteVcfCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteVcfCloudAccountParams { - var () return &DeleteVcfCloudAccountParams{ HTTPClient: client, } } -/*DeleteVcfCloudAccountParams contains all the parameters to send to the API endpoint -for the delete vcf cloud account operation typically these are written to a http.Request +/* DeleteVcfCloudAccountParams contains all the parameters to send to the API endpoint + for the delete vcf cloud account operation. + + Typically these are written to a http.Request. */ type DeleteVcfCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteVcfCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVcfCloudAccountParams) WithDefaults() *DeleteVcfCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVcfCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete vcf cloud account params func (o *DeleteVcfCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteVcfCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteVcfCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_vcf_cloud_account_responses.go b/pkg/client/cloud_account/delete_vcf_cloud_account_responses.go index e7c7efe4..3f612c0a 100644 --- a/pkg/client/cloud_account/delete_vcf_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_vcf_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteVcfCloudAccountReader is a Reader for the DeleteVcfCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteVcfCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteVcfCloudAccountNoContent() *DeleteVcfCloudAccountNoContent { return &DeleteVcfCloudAccountNoContent{} } -/*DeleteVcfCloudAccountNoContent handles this case with default header values. +/* DeleteVcfCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteVcfCloudAccountForbidden() *DeleteVcfCloudAccountForbidden { return &DeleteVcfCloudAccountForbidden{} } -/*DeleteVcfCloudAccountForbidden handles this case with default header values. +/* DeleteVcfCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteVcfCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteVcfCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vcf/{id}][%d] deleteVcfCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vcf/{id}][%d] deleteVcfCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteVcfCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteVcfCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_vmc_cloud_account_parameters.go b/pkg/client/cloud_account/delete_vmc_cloud_account_parameters.go index 4db4de92..546de2a7 100644 --- a/pkg/client/cloud_account/delete_vmc_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_vmc_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteVmcCloudAccountParams creates a new DeleteVmcCloudAccountParams object -// with the default values initialized. +// NewDeleteVmcCloudAccountParams creates a new DeleteVmcCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteVmcCloudAccountParams() *DeleteVmcCloudAccountParams { - var () return &DeleteVmcCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteVmcCloudAccountParamsWithTimeout creates a new DeleteVmcCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteVmcCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteVmcCloudAccountParams { - var () return &DeleteVmcCloudAccountParams{ - timeout: timeout, } } // NewDeleteVmcCloudAccountParamsWithContext creates a new DeleteVmcCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteVmcCloudAccountParamsWithContext(ctx context.Context) *DeleteVmcCloudAccountParams { - var () return &DeleteVmcCloudAccountParams{ - Context: ctx, } } // NewDeleteVmcCloudAccountParamsWithHTTPClient creates a new DeleteVmcCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteVmcCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteVmcCloudAccountParams { - var () return &DeleteVmcCloudAccountParams{ HTTPClient: client, } } -/*DeleteVmcCloudAccountParams contains all the parameters to send to the API endpoint -for the delete vmc cloud account operation typically these are written to a http.Request +/* DeleteVmcCloudAccountParams contains all the parameters to send to the API endpoint + for the delete vmc cloud account operation. + + Typically these are written to a http.Request. */ type DeleteVmcCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteVmcCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVmcCloudAccountParams) WithDefaults() *DeleteVmcCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVmcCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete vmc cloud account params func (o *DeleteVmcCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteVmcCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteVmcCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_vmc_cloud_account_responses.go b/pkg/client/cloud_account/delete_vmc_cloud_account_responses.go index 6e852e1e..b3c74bfc 100644 --- a/pkg/client/cloud_account/delete_vmc_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_vmc_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteVmcCloudAccountReader is a Reader for the DeleteVmcCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteVmcCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteVmcCloudAccountNoContent() *DeleteVmcCloudAccountNoContent { return &DeleteVmcCloudAccountNoContent{} } -/*DeleteVmcCloudAccountNoContent handles this case with default header values. +/* DeleteVmcCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteVmcCloudAccountForbidden() *DeleteVmcCloudAccountForbidden { return &DeleteVmcCloudAccountForbidden{} } -/*DeleteVmcCloudAccountForbidden handles this case with default header values. +/* DeleteVmcCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteVmcCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteVmcCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vmc/{id}][%d] deleteVmcCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vmc/{id}][%d] deleteVmcCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteVmcCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteVmcCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/delete_vsphere_cloud_account_parameters.go b/pkg/client/cloud_account/delete_vsphere_cloud_account_parameters.go index 030c1673..57a9aec0 100644 --- a/pkg/client/cloud_account/delete_vsphere_cloud_account_parameters.go +++ b/pkg/client/cloud_account/delete_vsphere_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteVSphereCloudAccountParams creates a new DeleteVSphereCloudAccountParams object -// with the default values initialized. +// NewDeleteVSphereCloudAccountParams creates a new DeleteVSphereCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteVSphereCloudAccountParams() *DeleteVSphereCloudAccountParams { - var () return &DeleteVSphereCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteVSphereCloudAccountParamsWithTimeout creates a new DeleteVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteVSphereCloudAccountParamsWithTimeout(timeout time.Duration) *DeleteVSphereCloudAccountParams { - var () return &DeleteVSphereCloudAccountParams{ - timeout: timeout, } } // NewDeleteVSphereCloudAccountParamsWithContext creates a new DeleteVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteVSphereCloudAccountParamsWithContext(ctx context.Context) *DeleteVSphereCloudAccountParams { - var () return &DeleteVSphereCloudAccountParams{ - Context: ctx, } } // NewDeleteVSphereCloudAccountParamsWithHTTPClient creates a new DeleteVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteVSphereCloudAccountParamsWithHTTPClient(client *http.Client) *DeleteVSphereCloudAccountParams { - var () return &DeleteVSphereCloudAccountParams{ HTTPClient: client, } } -/*DeleteVSphereCloudAccountParams contains all the parameters to send to the API endpoint -for the delete v sphere cloud account operation typically these are written to a http.Request +/* DeleteVSphereCloudAccountParams contains all the parameters to send to the API endpoint + for the delete v sphere cloud account operation. + + Typically these are written to a http.Request. */ type DeleteVSphereCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type DeleteVSphereCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVSphereCloudAccountParams) WithDefaults() *DeleteVSphereCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVSphereCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete v sphere cloud account params func (o *DeleteVSphereCloudAccountParams) WithTimeout(timeout time.Duration) *DeleteVSphereCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteVSphereCloudAccountParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/delete_vsphere_cloud_account_responses.go b/pkg/client/cloud_account/delete_vsphere_cloud_account_responses.go index a636a0e1..d9916694 100644 --- a/pkg/client/cloud_account/delete_vsphere_cloud_account_responses.go +++ b/pkg/client/cloud_account/delete_vsphere_cloud_account_responses.go @@ -7,9 +7,12 @@ package cloud_account import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteVSphereCloudAccountReader is a Reader for the DeleteVSphereCloudAccount structure. @@ -32,7 +35,6 @@ func (o *DeleteVSphereCloudAccountReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteVSphereCloudAccountNoContent() *DeleteVSphereCloudAccountNoContent return &DeleteVSphereCloudAccountNoContent{} } -/*DeleteVSphereCloudAccountNoContent handles this case with default header values. +/* DeleteVSphereCloudAccountNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteVSphereCloudAccountForbidden() *DeleteVSphereCloudAccountForbidden return &DeleteVSphereCloudAccountForbidden{} } -/*DeleteVSphereCloudAccountForbidden handles this case with default header values. +/* DeleteVSphereCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteVSphereCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteVSphereCloudAccountForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vsphere/{id}][%d] deleteVSphereCloudAccountForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/cloud-accounts-vsphere/{id}][%d] deleteVSphereCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteVSphereCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteVSphereCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_aws_regions_parameters.go b/pkg/client/cloud_account/enumerate_aws_regions_parameters.go index 79518859..8f28ee56 100644 --- a/pkg/client/cloud_account/enumerate_aws_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_aws_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateAwsRegionsParams creates a new EnumerateAwsRegionsParams object -// with the default values initialized. +// NewEnumerateAwsRegionsParams creates a new EnumerateAwsRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateAwsRegionsParams() *EnumerateAwsRegionsParams { - var () return &EnumerateAwsRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateAwsRegionsParamsWithTimeout creates a new EnumerateAwsRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateAwsRegionsParamsWithTimeout(timeout time.Duration) *EnumerateAwsRegionsParams { - var () return &EnumerateAwsRegionsParams{ - timeout: timeout, } } // NewEnumerateAwsRegionsParamsWithContext creates a new EnumerateAwsRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateAwsRegionsParamsWithContext(ctx context.Context) *EnumerateAwsRegionsParams { - var () return &EnumerateAwsRegionsParams{ - Context: ctx, } } // NewEnumerateAwsRegionsParamsWithHTTPClient creates a new EnumerateAwsRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateAwsRegionsParamsWithHTTPClient(client *http.Client) *EnumerateAwsRegionsParams { - var () return &EnumerateAwsRegionsParams{ HTTPClient: client, } } -/*EnumerateAwsRegionsParams contains all the parameters to send to the API endpoint -for the enumerate aws regions operation typically these are written to a http.Request +/* EnumerateAwsRegionsParams contains all the parameters to send to the API endpoint + for the enumerate aws regions operation. + + Typically these are written to a http.Request. */ type EnumerateAwsRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount specification + /* Body. + + CloudAccount specification */ Body *models.CloudAccountAwsSpecification @@ -78,6 +78,21 @@ type EnumerateAwsRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate aws regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateAwsRegionsParams) WithDefaults() *EnumerateAwsRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate aws regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateAwsRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate aws regions params func (o *EnumerateAwsRegionsParams) WithTimeout(timeout time.Duration) *EnumerateAwsRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateAwsRegionsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_aws_regions_responses.go b/pkg/client/cloud_account/enumerate_aws_regions_responses.go index c112c671..bb34e212 100644 --- a/pkg/client/cloud_account/enumerate_aws_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_aws_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateAwsRegionsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateAwsRegionsOK() *EnumerateAwsRegionsOK { return &EnumerateAwsRegionsOK{} } -/*EnumerateAwsRegionsOK handles this case with default header values. +/* EnumerateAwsRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateAwsRegionsOK struct { func (o *EnumerateAwsRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws/region-enumeration][%d] enumerateAwsRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateAwsRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateAwsRegionsBadRequest() *EnumerateAwsRegionsBadRequest { return &EnumerateAwsRegionsBadRequest{} } -/*EnumerateAwsRegionsBadRequest handles this case with default header values. +/* EnumerateAwsRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateAwsRegionsBadRequest struct { func (o *EnumerateAwsRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws/region-enumeration][%d] enumerateAwsRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateAwsRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateAwsRegionsForbidden() *EnumerateAwsRegionsForbidden { return &EnumerateAwsRegionsForbidden{} } -/*EnumerateAwsRegionsForbidden handles this case with default header values. +/* EnumerateAwsRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateAwsRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateAwsRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws/region-enumeration][%d] enumerateAwsRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-aws/region-enumeration][%d] enumerateAwsRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateAwsRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateAwsRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_azure_regions_parameters.go b/pkg/client/cloud_account/enumerate_azure_regions_parameters.go index bd7e72a8..a85b3b1f 100644 --- a/pkg/client/cloud_account/enumerate_azure_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_azure_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateAzureRegionsParams creates a new EnumerateAzureRegionsParams object -// with the default values initialized. +// NewEnumerateAzureRegionsParams creates a new EnumerateAzureRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateAzureRegionsParams() *EnumerateAzureRegionsParams { - var () return &EnumerateAzureRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateAzureRegionsParamsWithTimeout creates a new EnumerateAzureRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateAzureRegionsParamsWithTimeout(timeout time.Duration) *EnumerateAzureRegionsParams { - var () return &EnumerateAzureRegionsParams{ - timeout: timeout, } } // NewEnumerateAzureRegionsParamsWithContext creates a new EnumerateAzureRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateAzureRegionsParamsWithContext(ctx context.Context) *EnumerateAzureRegionsParams { - var () return &EnumerateAzureRegionsParams{ - Context: ctx, } } // NewEnumerateAzureRegionsParamsWithHTTPClient creates a new EnumerateAzureRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateAzureRegionsParamsWithHTTPClient(client *http.Client) *EnumerateAzureRegionsParams { - var () return &EnumerateAzureRegionsParams{ HTTPClient: client, } } -/*EnumerateAzureRegionsParams contains all the parameters to send to the API endpoint -for the enumerate azure regions operation typically these are written to a http.Request +/* EnumerateAzureRegionsParams contains all the parameters to send to the API endpoint + for the enumerate azure regions operation. + + Typically these are written to a http.Request. */ type EnumerateAzureRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountAzure specification + /* Body. + + CloudAccountAzure specification */ Body *models.CloudAccountAzureSpecification @@ -78,6 +78,21 @@ type EnumerateAzureRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate azure regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateAzureRegionsParams) WithDefaults() *EnumerateAzureRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate azure regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateAzureRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate azure regions params func (o *EnumerateAzureRegionsParams) WithTimeout(timeout time.Duration) *EnumerateAzureRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateAzureRegionsParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_azure_regions_responses.go b/pkg/client/cloud_account/enumerate_azure_regions_responses.go index f0b5393e..8858a177 100644 --- a/pkg/client/cloud_account/enumerate_azure_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_azure_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateAzureRegionsReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateAzureRegionsOK() *EnumerateAzureRegionsOK { return &EnumerateAzureRegionsOK{} } -/*EnumerateAzureRegionsOK handles this case with default header values. +/* EnumerateAzureRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateAzureRegionsOK struct { func (o *EnumerateAzureRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure/region-enumeration][%d] enumerateAzureRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateAzureRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateAzureRegionsBadRequest() *EnumerateAzureRegionsBadRequest { return &EnumerateAzureRegionsBadRequest{} } -/*EnumerateAzureRegionsBadRequest handles this case with default header values. +/* EnumerateAzureRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateAzureRegionsBadRequest struct { func (o *EnumerateAzureRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure/region-enumeration][%d] enumerateAzureRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateAzureRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateAzureRegionsForbidden() *EnumerateAzureRegionsForbidden { return &EnumerateAzureRegionsForbidden{} } -/*EnumerateAzureRegionsForbidden handles this case with default header values. +/* EnumerateAzureRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateAzureRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateAzureRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure/region-enumeration][%d] enumerateAzureRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-azure/region-enumeration][%d] enumerateAzureRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateAzureRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateAzureRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_gcp_regions_parameters.go b/pkg/client/cloud_account/enumerate_gcp_regions_parameters.go index 06928a41..1eb07e46 100644 --- a/pkg/client/cloud_account/enumerate_gcp_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_gcp_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateGcpRegionsParams creates a new EnumerateGcpRegionsParams object -// with the default values initialized. +// NewEnumerateGcpRegionsParams creates a new EnumerateGcpRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateGcpRegionsParams() *EnumerateGcpRegionsParams { - var () return &EnumerateGcpRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateGcpRegionsParamsWithTimeout creates a new EnumerateGcpRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateGcpRegionsParamsWithTimeout(timeout time.Duration) *EnumerateGcpRegionsParams { - var () return &EnumerateGcpRegionsParams{ - timeout: timeout, } } // NewEnumerateGcpRegionsParamsWithContext creates a new EnumerateGcpRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateGcpRegionsParamsWithContext(ctx context.Context) *EnumerateGcpRegionsParams { - var () return &EnumerateGcpRegionsParams{ - Context: ctx, } } // NewEnumerateGcpRegionsParamsWithHTTPClient creates a new EnumerateGcpRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateGcpRegionsParamsWithHTTPClient(client *http.Client) *EnumerateGcpRegionsParams { - var () return &EnumerateGcpRegionsParams{ HTTPClient: client, } } -/*EnumerateGcpRegionsParams contains all the parameters to send to the API endpoint -for the enumerate gcp regions operation typically these are written to a http.Request +/* EnumerateGcpRegionsParams contains all the parameters to send to the API endpoint + for the enumerate gcp regions operation. + + Typically these are written to a http.Request. */ type EnumerateGcpRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount specification + /* Body. + + CloudAccount specification */ Body *models.CloudAccountGcpSpecification @@ -78,6 +78,21 @@ type EnumerateGcpRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate gcp regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateGcpRegionsParams) WithDefaults() *EnumerateGcpRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate gcp regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateGcpRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate gcp regions params func (o *EnumerateGcpRegionsParams) WithTimeout(timeout time.Duration) *EnumerateGcpRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateGcpRegionsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_gcp_regions_responses.go b/pkg/client/cloud_account/enumerate_gcp_regions_responses.go index b75160c9..d07c5a11 100644 --- a/pkg/client/cloud_account/enumerate_gcp_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_gcp_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateGcpRegionsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateGcpRegionsOK() *EnumerateGcpRegionsOK { return &EnumerateGcpRegionsOK{} } -/*EnumerateGcpRegionsOK handles this case with default header values. +/* EnumerateGcpRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateGcpRegionsOK struct { func (o *EnumerateGcpRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp/region-enumeration][%d] enumerateGcpRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateGcpRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateGcpRegionsBadRequest() *EnumerateGcpRegionsBadRequest { return &EnumerateGcpRegionsBadRequest{} } -/*EnumerateGcpRegionsBadRequest handles this case with default header values. +/* EnumerateGcpRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateGcpRegionsBadRequest struct { func (o *EnumerateGcpRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp/region-enumeration][%d] enumerateGcpRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateGcpRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateGcpRegionsForbidden() *EnumerateGcpRegionsForbidden { return &EnumerateGcpRegionsForbidden{} } -/*EnumerateGcpRegionsForbidden handles this case with default header values. +/* EnumerateGcpRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateGcpRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateGcpRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp/region-enumeration][%d] enumerateGcpRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-gcp/region-enumeration][%d] enumerateGcpRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateGcpRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateGcpRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_private_images_aws_parameters.go b/pkg/client/cloud_account/enumerate_private_images_aws_parameters.go index 2a584e73..3fbefd84 100644 --- a/pkg/client/cloud_account/enumerate_private_images_aws_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_aws_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesAWSParams creates a new EnumeratePrivateImagesAWSParams object -// with the default values initialized. +// NewEnumeratePrivateImagesAWSParams creates a new EnumeratePrivateImagesAWSParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesAWSParams() *EnumeratePrivateImagesAWSParams { - var () return &EnumeratePrivateImagesAWSParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesAWSParamsWithTimeout creates a new EnumeratePrivateImagesAWSParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesAWSParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesAWSParams { - var () return &EnumeratePrivateImagesAWSParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesAWSParamsWithContext creates a new EnumeratePrivateImagesAWSParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesAWSParamsWithContext(ctx context.Context) *EnumeratePrivateImagesAWSParams { - var () return &EnumeratePrivateImagesAWSParams{ - Context: ctx, } } // NewEnumeratePrivateImagesAWSParamsWithHTTPClient creates a new EnumeratePrivateImagesAWSParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesAWSParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesAWSParams { - var () return &EnumeratePrivateImagesAWSParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesAWSParams contains all the parameters to send to the API endpoint -for the enumerate private images a w s operation typically these are written to a http.Request +/* EnumeratePrivateImagesAWSParams contains all the parameters to send to the API endpoint + for the enumerate private images a w s operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesAWSParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of AWS cloud account to enumerate + /* ID. + + Id of AWS cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesAWSParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images a w s params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesAWSParams) WithDefaults() *EnumeratePrivateImagesAWSParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images a w s params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesAWSParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images a w s params func (o *EnumeratePrivateImagesAWSParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesAWSParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesAWSParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_aws_responses.go b/pkg/client/cloud_account/enumerate_private_images_aws_responses.go index 9b547695..11285e36 100644 --- a/pkg/client/cloud_account/enumerate_private_images_aws_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_aws_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesAWSDefault(code int) *EnumeratePrivateImagesAWSDef } } -/*EnumeratePrivateImagesAWSDefault handles this case with default header values. +/* EnumeratePrivateImagesAWSDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_azure_parameters.go b/pkg/client/cloud_account/enumerate_private_images_azure_parameters.go index f6f4c3b3..fdbb6738 100644 --- a/pkg/client/cloud_account/enumerate_private_images_azure_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_azure_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesAzureParams creates a new EnumeratePrivateImagesAzureParams object -// with the default values initialized. +// NewEnumeratePrivateImagesAzureParams creates a new EnumeratePrivateImagesAzureParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesAzureParams() *EnumeratePrivateImagesAzureParams { - var () return &EnumeratePrivateImagesAzureParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesAzureParamsWithTimeout creates a new EnumeratePrivateImagesAzureParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesAzureParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesAzureParams { - var () return &EnumeratePrivateImagesAzureParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesAzureParamsWithContext creates a new EnumeratePrivateImagesAzureParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesAzureParamsWithContext(ctx context.Context) *EnumeratePrivateImagesAzureParams { - var () return &EnumeratePrivateImagesAzureParams{ - Context: ctx, } } // NewEnumeratePrivateImagesAzureParamsWithHTTPClient creates a new EnumeratePrivateImagesAzureParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesAzureParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesAzureParams { - var () return &EnumeratePrivateImagesAzureParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesAzureParams contains all the parameters to send to the API endpoint -for the enumerate private images azure operation typically these are written to a http.Request +/* EnumeratePrivateImagesAzureParams contains all the parameters to send to the API endpoint + for the enumerate private images azure operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesAzureParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of Azure cloud account to enumerate + /* ID. + + Id of Azure cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesAzureParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images azure params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesAzureParams) WithDefaults() *EnumeratePrivateImagesAzureParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images azure params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesAzureParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images azure params func (o *EnumeratePrivateImagesAzureParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesAzureParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesAzureParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_azure_responses.go b/pkg/client/cloud_account/enumerate_private_images_azure_responses.go index 31795b5f..bbd319ba 100644 --- a/pkg/client/cloud_account/enumerate_private_images_azure_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_azure_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesAzureDefault(code int) *EnumeratePrivateImagesAzur } } -/*EnumeratePrivateImagesAzureDefault handles this case with default header values. +/* EnumeratePrivateImagesAzureDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_gcp_parameters.go b/pkg/client/cloud_account/enumerate_private_images_gcp_parameters.go index 43288a0d..32d8e928 100644 --- a/pkg/client/cloud_account/enumerate_private_images_gcp_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_gcp_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesGcpParams creates a new EnumeratePrivateImagesGcpParams object -// with the default values initialized. +// NewEnumeratePrivateImagesGcpParams creates a new EnumeratePrivateImagesGcpParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesGcpParams() *EnumeratePrivateImagesGcpParams { - var () return &EnumeratePrivateImagesGcpParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesGcpParamsWithTimeout creates a new EnumeratePrivateImagesGcpParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesGcpParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesGcpParams { - var () return &EnumeratePrivateImagesGcpParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesGcpParamsWithContext creates a new EnumeratePrivateImagesGcpParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesGcpParamsWithContext(ctx context.Context) *EnumeratePrivateImagesGcpParams { - var () return &EnumeratePrivateImagesGcpParams{ - Context: ctx, } } // NewEnumeratePrivateImagesGcpParamsWithHTTPClient creates a new EnumeratePrivateImagesGcpParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesGcpParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesGcpParams { - var () return &EnumeratePrivateImagesGcpParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesGcpParams contains all the parameters to send to the API endpoint -for the enumerate private images gcp operation typically these are written to a http.Request +/* EnumeratePrivateImagesGcpParams contains all the parameters to send to the API endpoint + for the enumerate private images gcp operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesGcpParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of GCP cloud account to enumerate + /* ID. + + Id of GCP cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesGcpParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images gcp params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesGcpParams) WithDefaults() *EnumeratePrivateImagesGcpParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images gcp params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesGcpParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images gcp params func (o *EnumeratePrivateImagesGcpParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesGcpParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesGcpParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_gcp_responses.go b/pkg/client/cloud_account/enumerate_private_images_gcp_responses.go index 6c7a3655..58a17eb6 100644 --- a/pkg/client/cloud_account/enumerate_private_images_gcp_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_gcp_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesGcpDefault(code int) *EnumeratePrivateImagesGcpDef } } -/*EnumeratePrivateImagesGcpDefault handles this case with default header values. +/* EnumeratePrivateImagesGcpDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_parameters.go b/pkg/client/cloud_account/enumerate_private_images_parameters.go index fcb75df8..ae5151f5 100644 --- a/pkg/client/cloud_account/enumerate_private_images_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesParams creates a new EnumeratePrivateImagesParams object -// with the default values initialized. +// NewEnumeratePrivateImagesParams creates a new EnumeratePrivateImagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesParams() *EnumeratePrivateImagesParams { - var () return &EnumeratePrivateImagesParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesParamsWithTimeout creates a new EnumeratePrivateImagesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesParams { - var () return &EnumeratePrivateImagesParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesParamsWithContext creates a new EnumeratePrivateImagesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesParamsWithContext(ctx context.Context) *EnumeratePrivateImagesParams { - var () return &EnumeratePrivateImagesParams{ - Context: ctx, } } // NewEnumeratePrivateImagesParamsWithHTTPClient creates a new EnumeratePrivateImagesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesParams { - var () return &EnumeratePrivateImagesParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesParams contains all the parameters to send to the API endpoint -for the enumerate private images operation typically these are written to a http.Request +/* EnumeratePrivateImagesParams contains all the parameters to send to the API endpoint + for the enumerate private images operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of cloud account to enumerate + /* ID. + + Id of cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesParams) WithDefaults() *EnumeratePrivateImagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images params func (o *EnumeratePrivateImagesParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_responses.go b/pkg/client/cloud_account/enumerate_private_images_responses.go index c8beffd4..faf3be2b 100644 --- a/pkg/client/cloud_account/enumerate_private_images_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesDefault(code int) *EnumeratePrivateImagesDefault { } } -/*EnumeratePrivateImagesDefault handles this case with default header values. +/* EnumeratePrivateImagesDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_vcf_parameters.go b/pkg/client/cloud_account/enumerate_private_images_vcf_parameters.go index 3fbdf802..376b2bda 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vcf_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_vcf_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesVCFParams creates a new EnumeratePrivateImagesVCFParams object -// with the default values initialized. +// NewEnumeratePrivateImagesVCFParams creates a new EnumeratePrivateImagesVCFParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesVCFParams() *EnumeratePrivateImagesVCFParams { - var () return &EnumeratePrivateImagesVCFParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesVCFParamsWithTimeout creates a new EnumeratePrivateImagesVCFParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesVCFParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesVCFParams { - var () return &EnumeratePrivateImagesVCFParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesVCFParamsWithContext creates a new EnumeratePrivateImagesVCFParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesVCFParamsWithContext(ctx context.Context) *EnumeratePrivateImagesVCFParams { - var () return &EnumeratePrivateImagesVCFParams{ - Context: ctx, } } // NewEnumeratePrivateImagesVCFParamsWithHTTPClient creates a new EnumeratePrivateImagesVCFParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesVCFParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesVCFParams { - var () return &EnumeratePrivateImagesVCFParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesVCFParams contains all the parameters to send to the API endpoint -for the enumerate private images v c f operation typically these are written to a http.Request +/* EnumeratePrivateImagesVCFParams contains all the parameters to send to the API endpoint + for the enumerate private images v c f operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesVCFParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of VCF cloud account to enumerate + /* ID. + + Id of VCF cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesVCFParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images v c f params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVCFParams) WithDefaults() *EnumeratePrivateImagesVCFParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images v c f params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVCFParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images v c f params func (o *EnumeratePrivateImagesVCFParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesVCFParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesVCFParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_vcf_responses.go b/pkg/client/cloud_account/enumerate_private_images_vcf_responses.go index e81019bc..36f05d45 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vcf_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_vcf_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesVCFDefault(code int) *EnumeratePrivateImagesVCFDef } } -/*EnumeratePrivateImagesVCFDefault handles this case with default header values. +/* EnumeratePrivateImagesVCFDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_vmc_parameters.go b/pkg/client/cloud_account/enumerate_private_images_vmc_parameters.go index 4cb4264e..8ebc1e35 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vmc_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_vmc_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesVMCParams creates a new EnumeratePrivateImagesVMCParams object -// with the default values initialized. +// NewEnumeratePrivateImagesVMCParams creates a new EnumeratePrivateImagesVMCParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesVMCParams() *EnumeratePrivateImagesVMCParams { - var () return &EnumeratePrivateImagesVMCParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesVMCParamsWithTimeout creates a new EnumeratePrivateImagesVMCParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesVMCParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesVMCParams { - var () return &EnumeratePrivateImagesVMCParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesVMCParamsWithContext creates a new EnumeratePrivateImagesVMCParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesVMCParamsWithContext(ctx context.Context) *EnumeratePrivateImagesVMCParams { - var () return &EnumeratePrivateImagesVMCParams{ - Context: ctx, } } // NewEnumeratePrivateImagesVMCParamsWithHTTPClient creates a new EnumeratePrivateImagesVMCParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesVMCParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesVMCParams { - var () return &EnumeratePrivateImagesVMCParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesVMCParams contains all the parameters to send to the API endpoint -for the enumerate private images VM c operation typically these are written to a http.Request +/* EnumeratePrivateImagesVMCParams contains all the parameters to send to the API endpoint + for the enumerate private images VM c operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesVMCParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of VMC cloud account to enumerate + /* ID. + + Id of VMC cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesVMCParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images VM c params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVMCParams) WithDefaults() *EnumeratePrivateImagesVMCParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images VM c params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVMCParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images VM c params func (o *EnumeratePrivateImagesVMCParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesVMCParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesVMCParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_vmc_responses.go b/pkg/client/cloud_account/enumerate_private_images_vmc_responses.go index 0b376ffc..fcb86dcb 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vmc_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_vmc_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesVMCDefault(code int) *EnumeratePrivateImagesVMCDef } } -/*EnumeratePrivateImagesVMCDefault handles this case with default header values. +/* EnumeratePrivateImagesVMCDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_private_images_vsphere_parameters.go b/pkg/client/cloud_account/enumerate_private_images_vsphere_parameters.go index d3e6745b..17a925e5 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vsphere_parameters.go +++ b/pkg/client/cloud_account/enumerate_private_images_vsphere_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnumeratePrivateImagesVSphereParams creates a new EnumeratePrivateImagesVSphereParams object -// with the default values initialized. +// NewEnumeratePrivateImagesVSphereParams creates a new EnumeratePrivateImagesVSphereParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumeratePrivateImagesVSphereParams() *EnumeratePrivateImagesVSphereParams { - var () return &EnumeratePrivateImagesVSphereParams{ - timeout: cr.DefaultTimeout, } } // NewEnumeratePrivateImagesVSphereParamsWithTimeout creates a new EnumeratePrivateImagesVSphereParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumeratePrivateImagesVSphereParamsWithTimeout(timeout time.Duration) *EnumeratePrivateImagesVSphereParams { - var () return &EnumeratePrivateImagesVSphereParams{ - timeout: timeout, } } // NewEnumeratePrivateImagesVSphereParamsWithContext creates a new EnumeratePrivateImagesVSphereParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumeratePrivateImagesVSphereParamsWithContext(ctx context.Context) *EnumeratePrivateImagesVSphereParams { - var () return &EnumeratePrivateImagesVSphereParams{ - Context: ctx, } } // NewEnumeratePrivateImagesVSphereParamsWithHTTPClient creates a new EnumeratePrivateImagesVSphereParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumeratePrivateImagesVSphereParamsWithHTTPClient(client *http.Client) *EnumeratePrivateImagesVSphereParams { - var () return &EnumeratePrivateImagesVSphereParams{ HTTPClient: client, } } -/*EnumeratePrivateImagesVSphereParams contains all the parameters to send to the API endpoint -for the enumerate private images v sphere operation typically these are written to a http.Request +/* EnumeratePrivateImagesVSphereParams contains all the parameters to send to the API endpoint + for the enumerate private images v sphere operation. + + Typically these are written to a http.Request. */ type EnumeratePrivateImagesVSphereParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - Id of vSphere cloud account to enumerate + /* ID. + + Id of vSphere cloud account to enumerate */ ID string @@ -76,6 +76,21 @@ type EnumeratePrivateImagesVSphereParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate private images v sphere params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVSphereParams) WithDefaults() *EnumeratePrivateImagesVSphereParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate private images v sphere params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumeratePrivateImagesVSphereParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate private images v sphere params func (o *EnumeratePrivateImagesVSphereParams) WithTimeout(timeout time.Duration) *EnumeratePrivateImagesVSphereParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *EnumeratePrivateImagesVSphereParams) WriteToRequest(r runtime.ClientReq // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/enumerate_private_images_vsphere_responses.go b/pkg/client/cloud_account/enumerate_private_images_vsphere_responses.go index 0039c1fe..7d7c3fe6 100644 --- a/pkg/client/cloud_account/enumerate_private_images_vsphere_responses.go +++ b/pkg/client/cloud_account/enumerate_private_images_vsphere_responses.go @@ -36,7 +36,7 @@ func NewEnumeratePrivateImagesVSphereDefault(code int) *EnumeratePrivateImagesVS } } -/*EnumeratePrivateImagesVSphereDefault handles this case with default header values. +/* EnumeratePrivateImagesVSphereDefault describes a response with status code -1, with default header values. successful operation */ diff --git a/pkg/client/cloud_account/enumerate_regions_parameters.go b/pkg/client/cloud_account/enumerate_regions_parameters.go index de34361c..1c1c2de8 100644 --- a/pkg/client/cloud_account/enumerate_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateRegionsParams creates a new EnumerateRegionsParams object -// with the default values initialized. +// NewEnumerateRegionsParams creates a new EnumerateRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateRegionsParams() *EnumerateRegionsParams { - var () return &EnumerateRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateRegionsParamsWithTimeout creates a new EnumerateRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateRegionsParamsWithTimeout(timeout time.Duration) *EnumerateRegionsParams { - var () return &EnumerateRegionsParams{ - timeout: timeout, } } // NewEnumerateRegionsParamsWithContext creates a new EnumerateRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateRegionsParamsWithContext(ctx context.Context) *EnumerateRegionsParams { - var () return &EnumerateRegionsParams{ - Context: ctx, } } // NewEnumerateRegionsParamsWithHTTPClient creates a new EnumerateRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateRegionsParamsWithHTTPClient(client *http.Client) *EnumerateRegionsParams { - var () return &EnumerateRegionsParams{ HTTPClient: client, } } -/*EnumerateRegionsParams contains all the parameters to send to the API endpoint -for the enumerate regions operation typically these are written to a http.Request +/* EnumerateRegionsParams contains all the parameters to send to the API endpoint + for the enumerate regions operation. + + Typically these are written to a http.Request. */ type EnumerateRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount instance + /* Body. + + CloudAccount instance */ Body *models.CloudAccountSpecification @@ -78,6 +78,21 @@ type EnumerateRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateRegionsParams) WithDefaults() *EnumerateRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate regions params func (o *EnumerateRegionsParams) WithTimeout(timeout time.Duration) *EnumerateRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateRegionsParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_regions_responses.go b/pkg/client/cloud_account/enumerate_regions_responses.go index 6362d604..54282d8c 100644 --- a/pkg/client/cloud_account/enumerate_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateRegionsReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateRegionsOK() *EnumerateRegionsOK { return &EnumerateRegionsOK{} } -/*EnumerateRegionsOK handles this case with default header values. +/* EnumerateRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateRegionsOK struct { func (o *EnumerateRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts/region-enumeration][%d] enumerateRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateRegionsBadRequest() *EnumerateRegionsBadRequest { return &EnumerateRegionsBadRequest{} } -/*EnumerateRegionsBadRequest handles this case with default header values. +/* EnumerateRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateRegionsBadRequest struct { func (o *EnumerateRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts/region-enumeration][%d] enumerateRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateRegionsForbidden() *EnumerateRegionsForbidden { return &EnumerateRegionsForbidden{} } -/*EnumerateRegionsForbidden handles this case with default header values. +/* EnumerateRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts/region-enumeration][%d] enumerateRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts/region-enumeration][%d] enumerateRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_vcf_regions_parameters.go b/pkg/client/cloud_account/enumerate_vcf_regions_parameters.go index aff07bd0..fe450a6c 100644 --- a/pkg/client/cloud_account/enumerate_vcf_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_vcf_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateVcfRegionsParams creates a new EnumerateVcfRegionsParams object -// with the default values initialized. +// NewEnumerateVcfRegionsParams creates a new EnumerateVcfRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateVcfRegionsParams() *EnumerateVcfRegionsParams { - var () return &EnumerateVcfRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateVcfRegionsParamsWithTimeout creates a new EnumerateVcfRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateVcfRegionsParamsWithTimeout(timeout time.Duration) *EnumerateVcfRegionsParams { - var () return &EnumerateVcfRegionsParams{ - timeout: timeout, } } // NewEnumerateVcfRegionsParamsWithContext creates a new EnumerateVcfRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateVcfRegionsParamsWithContext(ctx context.Context) *EnumerateVcfRegionsParams { - var () return &EnumerateVcfRegionsParams{ - Context: ctx, } } // NewEnumerateVcfRegionsParamsWithHTTPClient creates a new EnumerateVcfRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateVcfRegionsParamsWithHTTPClient(client *http.Client) *EnumerateVcfRegionsParams { - var () return &EnumerateVcfRegionsParams{ HTTPClient: client, } } -/*EnumerateVcfRegionsParams contains all the parameters to send to the API endpoint -for the enumerate vcf regions operation typically these are written to a http.Request +/* EnumerateVcfRegionsParams contains all the parameters to send to the API endpoint + for the enumerate vcf regions operation. + + Typically these are written to a http.Request. */ type EnumerateVcfRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount specification + /* Body. + + CloudAccount specification */ Body *models.CloudAccountVcfSpecification @@ -78,6 +78,21 @@ type EnumerateVcfRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate vcf regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVcfRegionsParams) WithDefaults() *EnumerateVcfRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate vcf regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVcfRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate vcf regions params func (o *EnumerateVcfRegionsParams) WithTimeout(timeout time.Duration) *EnumerateVcfRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateVcfRegionsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_vcf_regions_responses.go b/pkg/client/cloud_account/enumerate_vcf_regions_responses.go index 068e5b04..ca351694 100644 --- a/pkg/client/cloud_account/enumerate_vcf_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_vcf_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateVcfRegionsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateVcfRegionsOK() *EnumerateVcfRegionsOK { return &EnumerateVcfRegionsOK{} } -/*EnumerateVcfRegionsOK handles this case with default header values. +/* EnumerateVcfRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateVcfRegionsOK struct { func (o *EnumerateVcfRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf/region-enumeration][%d] enumerateVcfRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateVcfRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateVcfRegionsBadRequest() *EnumerateVcfRegionsBadRequest { return &EnumerateVcfRegionsBadRequest{} } -/*EnumerateVcfRegionsBadRequest handles this case with default header values. +/* EnumerateVcfRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateVcfRegionsBadRequest struct { func (o *EnumerateVcfRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf/region-enumeration][%d] enumerateVcfRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateVcfRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateVcfRegionsForbidden() *EnumerateVcfRegionsForbidden { return &EnumerateVcfRegionsForbidden{} } -/*EnumerateVcfRegionsForbidden handles this case with default header values. +/* EnumerateVcfRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateVcfRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateVcfRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf/region-enumeration][%d] enumerateVcfRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vcf/region-enumeration][%d] enumerateVcfRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateVcfRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateVcfRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_vmc_regions_parameters.go b/pkg/client/cloud_account/enumerate_vmc_regions_parameters.go index c3bc8358..2da38b38 100644 --- a/pkg/client/cloud_account/enumerate_vmc_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_vmc_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateVmcRegionsParams creates a new EnumerateVmcRegionsParams object -// with the default values initialized. +// NewEnumerateVmcRegionsParams creates a new EnumerateVmcRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateVmcRegionsParams() *EnumerateVmcRegionsParams { - var () return &EnumerateVmcRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateVmcRegionsParamsWithTimeout creates a new EnumerateVmcRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateVmcRegionsParamsWithTimeout(timeout time.Duration) *EnumerateVmcRegionsParams { - var () return &EnumerateVmcRegionsParams{ - timeout: timeout, } } // NewEnumerateVmcRegionsParamsWithContext creates a new EnumerateVmcRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateVmcRegionsParamsWithContext(ctx context.Context) *EnumerateVmcRegionsParams { - var () return &EnumerateVmcRegionsParams{ - Context: ctx, } } // NewEnumerateVmcRegionsParamsWithHTTPClient creates a new EnumerateVmcRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateVmcRegionsParamsWithHTTPClient(client *http.Client) *EnumerateVmcRegionsParams { - var () return &EnumerateVmcRegionsParams{ HTTPClient: client, } } -/*EnumerateVmcRegionsParams contains all the parameters to send to the API endpoint -for the enumerate vmc regions operation typically these are written to a http.Request +/* EnumerateVmcRegionsParams contains all the parameters to send to the API endpoint + for the enumerate vmc regions operation. + + Typically these are written to a http.Request. */ type EnumerateVmcRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccount specification + /* Body. + + CloudAccount specification */ Body *models.CloudAccountVmcSpecification @@ -78,6 +78,21 @@ type EnumerateVmcRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate vmc regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVmcRegionsParams) WithDefaults() *EnumerateVmcRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate vmc regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVmcRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate vmc regions params func (o *EnumerateVmcRegionsParams) WithTimeout(timeout time.Duration) *EnumerateVmcRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateVmcRegionsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_vmc_regions_responses.go b/pkg/client/cloud_account/enumerate_vmc_regions_responses.go index 7fe40e7c..1ab90441 100644 --- a/pkg/client/cloud_account/enumerate_vmc_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_vmc_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateVmcRegionsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateVmcRegionsOK() *EnumerateVmcRegionsOK { return &EnumerateVmcRegionsOK{} } -/*EnumerateVmcRegionsOK handles this case with default header values. +/* EnumerateVmcRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateVmcRegionsOK struct { func (o *EnumerateVmcRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc/region-enumeration][%d] enumerateVmcRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateVmcRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateVmcRegionsBadRequest() *EnumerateVmcRegionsBadRequest { return &EnumerateVmcRegionsBadRequest{} } -/*EnumerateVmcRegionsBadRequest handles this case with default header values. +/* EnumerateVmcRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateVmcRegionsBadRequest struct { func (o *EnumerateVmcRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc/region-enumeration][%d] enumerateVmcRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateVmcRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateVmcRegionsForbidden() *EnumerateVmcRegionsForbidden { return &EnumerateVmcRegionsForbidden{} } -/*EnumerateVmcRegionsForbidden handles this case with default header values. +/* EnumerateVmcRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateVmcRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateVmcRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc/region-enumeration][%d] enumerateVmcRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vmc/region-enumeration][%d] enumerateVmcRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateVmcRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateVmcRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/enumerate_vsphere_regions_parameters.go b/pkg/client/cloud_account/enumerate_vsphere_regions_parameters.go index 405980e0..789231e7 100644 --- a/pkg/client/cloud_account/enumerate_vsphere_regions_parameters.go +++ b/pkg/client/cloud_account/enumerate_vsphere_regions_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateVSphereRegionsParams creates a new EnumerateVSphereRegionsParams object -// with the default values initialized. +// NewEnumerateVSphereRegionsParams creates a new EnumerateVSphereRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateVSphereRegionsParams() *EnumerateVSphereRegionsParams { - var () return &EnumerateVSphereRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateVSphereRegionsParamsWithTimeout creates a new EnumerateVSphereRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateVSphereRegionsParamsWithTimeout(timeout time.Duration) *EnumerateVSphereRegionsParams { - var () return &EnumerateVSphereRegionsParams{ - timeout: timeout, } } // NewEnumerateVSphereRegionsParamsWithContext creates a new EnumerateVSphereRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateVSphereRegionsParamsWithContext(ctx context.Context) *EnumerateVSphereRegionsParams { - var () return &EnumerateVSphereRegionsParams{ - Context: ctx, } } // NewEnumerateVSphereRegionsParamsWithHTTPClient creates a new EnumerateVSphereRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateVSphereRegionsParamsWithHTTPClient(client *http.Client) *EnumerateVSphereRegionsParams { - var () return &EnumerateVSphereRegionsParams{ HTTPClient: client, } } -/*EnumerateVSphereRegionsParams contains all the parameters to send to the API endpoint -for the enumerate v sphere regions operation typically these are written to a http.Request +/* EnumerateVSphereRegionsParams contains all the parameters to send to the API endpoint + for the enumerate v sphere regions operation. + + Typically these are written to a http.Request. */ type EnumerateVSphereRegionsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CloudAccountVsphere specification + /* Body. + + CloudAccountVsphere specification */ Body *models.CloudAccountVsphereSpecification @@ -78,6 +78,21 @@ type EnumerateVSphereRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate v sphere regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVSphereRegionsParams) WithDefaults() *EnumerateVSphereRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate v sphere regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateVSphereRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate v sphere regions params func (o *EnumerateVSphereRegionsParams) WithTimeout(timeout time.Duration) *EnumerateVSphereRegionsParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *EnumerateVSphereRegionsParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/enumerate_vsphere_regions_responses.go b/pkg/client/cloud_account/enumerate_vsphere_regions_responses.go index 02d0a606..587ced67 100644 --- a/pkg/client/cloud_account/enumerate_vsphere_regions_responses.go +++ b/pkg/client/cloud_account/enumerate_vsphere_regions_responses.go @@ -41,7 +41,6 @@ func (o *EnumerateVSphereRegionsReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewEnumerateVSphereRegionsOK() *EnumerateVSphereRegionsOK { return &EnumerateVSphereRegionsOK{} } -/*EnumerateVSphereRegionsOK handles this case with default header values. +/* EnumerateVSphereRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type EnumerateVSphereRegionsOK struct { func (o *EnumerateVSphereRegionsOK) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere/region-enumeration][%d] enumerateVSphereRegionsOK %+v", 200, o.Payload) } - func (o *EnumerateVSphereRegionsOK) GetPayload() *models.CloudAccountRegions { return o.Payload } @@ -85,7 +83,7 @@ func NewEnumerateVSphereRegionsBadRequest() *EnumerateVSphereRegionsBadRequest { return &EnumerateVSphereRegionsBadRequest{} } -/*EnumerateVSphereRegionsBadRequest handles this case with default header values. +/* EnumerateVSphereRegionsBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type EnumerateVSphereRegionsBadRequest struct { func (o *EnumerateVSphereRegionsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere/region-enumeration][%d] enumerateVSphereRegionsBadRequest %+v", 400, o.Payload) } - func (o *EnumerateVSphereRegionsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewEnumerateVSphereRegionsForbidden() *EnumerateVSphereRegionsForbidden { return &EnumerateVSphereRegionsForbidden{} } -/*EnumerateVSphereRegionsForbidden handles this case with default header values. +/* EnumerateVSphereRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type EnumerateVSphereRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *EnumerateVSphereRegionsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere/region-enumeration][%d] enumerateVSphereRegionsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/cloud-accounts-vsphere/region-enumeration][%d] enumerateVSphereRegionsForbidden %+v", 403, o.Payload) +} +func (o *EnumerateVSphereRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *EnumerateVSphereRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_aws_cloud_account_parameters.go b/pkg/client/cloud_account/get_aws_cloud_account_parameters.go index 79d6b2d3..e8420321 100644 --- a/pkg/client/cloud_account/get_aws_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_aws_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAwsCloudAccountParams creates a new GetAwsCloudAccountParams object -// with the default values initialized. +// NewGetAwsCloudAccountParams creates a new GetAwsCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAwsCloudAccountParams() *GetAwsCloudAccountParams { - var () return &GetAwsCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetAwsCloudAccountParamsWithTimeout creates a new GetAwsCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAwsCloudAccountParamsWithTimeout(timeout time.Duration) *GetAwsCloudAccountParams { - var () return &GetAwsCloudAccountParams{ - timeout: timeout, } } // NewGetAwsCloudAccountParamsWithContext creates a new GetAwsCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAwsCloudAccountParamsWithContext(ctx context.Context) *GetAwsCloudAccountParams { - var () return &GetAwsCloudAccountParams{ - Context: ctx, } } // NewGetAwsCloudAccountParamsWithHTTPClient creates a new GetAwsCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAwsCloudAccountParamsWithHTTPClient(client *http.Client) *GetAwsCloudAccountParams { - var () return &GetAwsCloudAccountParams{ HTTPClient: client, } } -/*GetAwsCloudAccountParams contains all the parameters to send to the API endpoint -for the get aws cloud account operation typically these are written to a http.Request +/* GetAwsCloudAccountParams contains all the parameters to send to the API endpoint + for the get aws cloud account operation. + + Typically these are written to a http.Request. */ type GetAwsCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetAwsCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudAccountParams) WithDefaults() *GetAwsCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get aws cloud account params func (o *GetAwsCloudAccountParams) WithTimeout(timeout time.Duration) *GetAwsCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetAwsCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_aws_cloud_account_responses.go b/pkg/client/cloud_account/get_aws_cloud_account_responses.go index 1cbdb88c..4ab5e323 100644 --- a/pkg/client/cloud_account/get_aws_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_aws_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetAwsCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetAwsCloudAccountOK() *GetAwsCloudAccountOK { return &GetAwsCloudAccountOK{} } -/*GetAwsCloudAccountOK handles this case with default header values. +/* GetAwsCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetAwsCloudAccountOK struct { func (o *GetAwsCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws/{id}][%d] getAwsCloudAccountOK %+v", 200, o.Payload) } - func (o *GetAwsCloudAccountOK) GetPayload() *models.CloudAccountAws { return o.Payload } @@ -85,19 +83,30 @@ func NewGetAwsCloudAccountForbidden() *GetAwsCloudAccountForbidden { return &GetAwsCloudAccountForbidden{} } -/*GetAwsCloudAccountForbidden handles this case with default header values. +/* GetAwsCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAwsCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAwsCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws/{id}][%d] getAwsCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws/{id}][%d] getAwsCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetAwsCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAwsCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetAwsCloudAccountNotFound() *GetAwsCloudAccountNotFound { return &GetAwsCloudAccountNotFound{} } -/*GetAwsCloudAccountNotFound handles this case with default header values. +/* GetAwsCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetAwsCloudAccountNotFound struct { func (o *GetAwsCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws/{id}][%d] getAwsCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetAwsCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_aws_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_aws_cloud_accounts_parameters.go index 2fa60d99..4e5774db 100644 --- a/pkg/client/cloud_account/get_aws_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_aws_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAwsCloudAccountsParams creates a new GetAwsCloudAccountsParams object -// with the default values initialized. +// NewGetAwsCloudAccountsParams creates a new GetAwsCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAwsCloudAccountsParams() *GetAwsCloudAccountsParams { - var () return &GetAwsCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetAwsCloudAccountsParamsWithTimeout creates a new GetAwsCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAwsCloudAccountsParamsWithTimeout(timeout time.Duration) *GetAwsCloudAccountsParams { - var () return &GetAwsCloudAccountsParams{ - timeout: timeout, } } // NewGetAwsCloudAccountsParamsWithContext creates a new GetAwsCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAwsCloudAccountsParamsWithContext(ctx context.Context) *GetAwsCloudAccountsParams { - var () return &GetAwsCloudAccountsParams{ - Context: ctx, } } // NewGetAwsCloudAccountsParamsWithHTTPClient creates a new GetAwsCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAwsCloudAccountsParamsWithHTTPClient(client *http.Client) *GetAwsCloudAccountsParams { - var () return &GetAwsCloudAccountsParams{ HTTPClient: client, } } -/*GetAwsCloudAccountsParams contains all the parameters to send to the API endpoint -for the get aws cloud accounts operation typically these are written to a http.Request +/* GetAwsCloudAccountsParams contains all the parameters to send to the API endpoint + for the get aws cloud accounts operation. + + Typically these are written to a http.Request. */ type GetAwsCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetAwsCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get aws cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudAccountsParams) WithDefaults() *GetAwsCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get aws cloud accounts params func (o *GetAwsCloudAccountsParams) WithTimeout(timeout time.Duration) *GetAwsCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetAwsCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_aws_cloud_accounts_responses.go b/pkg/client/cloud_account/get_aws_cloud_accounts_responses.go index 4d6c46b7..2a815103 100644 --- a/pkg/client/cloud_account/get_aws_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_aws_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetAwsCloudAccountsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAwsCloudAccountsOK() *GetAwsCloudAccountsOK { return &GetAwsCloudAccountsOK{} } -/*GetAwsCloudAccountsOK handles this case with default header values. +/* GetAwsCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetAwsCloudAccountsOK struct { func (o *GetAwsCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws][%d] getAwsCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetAwsCloudAccountsOK) GetPayload() *models.CloudAccountAwsResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetAwsCloudAccountsForbidden() *GetAwsCloudAccountsForbidden { return &GetAwsCloudAccountsForbidden{} } -/*GetAwsCloudAccountsForbidden handles this case with default header values. +/* GetAwsCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAwsCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAwsCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws][%d] getAwsCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-aws][%d] getAwsCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetAwsCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAwsCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_azure_cloud_account_parameters.go b/pkg/client/cloud_account/get_azure_cloud_account_parameters.go index 86e056b4..59225bf4 100644 --- a/pkg/client/cloud_account/get_azure_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_azure_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAzureCloudAccountParams creates a new GetAzureCloudAccountParams object -// with the default values initialized. +// NewGetAzureCloudAccountParams creates a new GetAzureCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAzureCloudAccountParams() *GetAzureCloudAccountParams { - var () return &GetAzureCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetAzureCloudAccountParamsWithTimeout creates a new GetAzureCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAzureCloudAccountParamsWithTimeout(timeout time.Duration) *GetAzureCloudAccountParams { - var () return &GetAzureCloudAccountParams{ - timeout: timeout, } } // NewGetAzureCloudAccountParamsWithContext creates a new GetAzureCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAzureCloudAccountParamsWithContext(ctx context.Context) *GetAzureCloudAccountParams { - var () return &GetAzureCloudAccountParams{ - Context: ctx, } } // NewGetAzureCloudAccountParamsWithHTTPClient creates a new GetAzureCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAzureCloudAccountParamsWithHTTPClient(client *http.Client) *GetAzureCloudAccountParams { - var () return &GetAzureCloudAccountParams{ HTTPClient: client, } } -/*GetAzureCloudAccountParams contains all the parameters to send to the API endpoint -for the get azure cloud account operation typically these are written to a http.Request +/* GetAzureCloudAccountParams contains all the parameters to send to the API endpoint + for the get azure cloud account operation. + + Typically these are written to a http.Request. */ type GetAzureCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetAzureCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureCloudAccountParams) WithDefaults() *GetAzureCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get azure cloud account params func (o *GetAzureCloudAccountParams) WithTimeout(timeout time.Duration) *GetAzureCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetAzureCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_azure_cloud_account_responses.go b/pkg/client/cloud_account/get_azure_cloud_account_responses.go index 8b2ca50b..f82f021b 100644 --- a/pkg/client/cloud_account/get_azure_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_azure_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetAzureCloudAccountReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetAzureCloudAccountOK() *GetAzureCloudAccountOK { return &GetAzureCloudAccountOK{} } -/*GetAzureCloudAccountOK handles this case with default header values. +/* GetAzureCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetAzureCloudAccountOK struct { func (o *GetAzureCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure/{id}][%d] getAzureCloudAccountOK %+v", 200, o.Payload) } - func (o *GetAzureCloudAccountOK) GetPayload() *models.CloudAccountAzure { return o.Payload } @@ -85,19 +83,30 @@ func NewGetAzureCloudAccountForbidden() *GetAzureCloudAccountForbidden { return &GetAzureCloudAccountForbidden{} } -/*GetAzureCloudAccountForbidden handles this case with default header values. +/* GetAzureCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAzureCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAzureCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure/{id}][%d] getAzureCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure/{id}][%d] getAzureCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetAzureCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAzureCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetAzureCloudAccountNotFound() *GetAzureCloudAccountNotFound { return &GetAzureCloudAccountNotFound{} } -/*GetAzureCloudAccountNotFound handles this case with default header values. +/* GetAzureCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetAzureCloudAccountNotFound struct { func (o *GetAzureCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure/{id}][%d] getAzureCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetAzureCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_azure_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_azure_cloud_accounts_parameters.go index 30fa93c0..a8ef4ecb 100644 --- a/pkg/client/cloud_account/get_azure_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_azure_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAzureCloudAccountsParams creates a new GetAzureCloudAccountsParams object -// with the default values initialized. +// NewGetAzureCloudAccountsParams creates a new GetAzureCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAzureCloudAccountsParams() *GetAzureCloudAccountsParams { - var () return &GetAzureCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetAzureCloudAccountsParamsWithTimeout creates a new GetAzureCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAzureCloudAccountsParamsWithTimeout(timeout time.Duration) *GetAzureCloudAccountsParams { - var () return &GetAzureCloudAccountsParams{ - timeout: timeout, } } // NewGetAzureCloudAccountsParamsWithContext creates a new GetAzureCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAzureCloudAccountsParamsWithContext(ctx context.Context) *GetAzureCloudAccountsParams { - var () return &GetAzureCloudAccountsParams{ - Context: ctx, } } // NewGetAzureCloudAccountsParamsWithHTTPClient creates a new GetAzureCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAzureCloudAccountsParamsWithHTTPClient(client *http.Client) *GetAzureCloudAccountsParams { - var () return &GetAzureCloudAccountsParams{ HTTPClient: client, } } -/*GetAzureCloudAccountsParams contains all the parameters to send to the API endpoint -for the get azure cloud accounts operation typically these are written to a http.Request +/* GetAzureCloudAccountsParams contains all the parameters to send to the API endpoint + for the get azure cloud accounts operation. + + Typically these are written to a http.Request. */ type GetAzureCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetAzureCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get azure cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureCloudAccountsParams) WithDefaults() *GetAzureCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get azure cloud accounts params func (o *GetAzureCloudAccountsParams) WithTimeout(timeout time.Duration) *GetAzureCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetAzureCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_azure_cloud_accounts_responses.go b/pkg/client/cloud_account/get_azure_cloud_accounts_responses.go index be79d4f3..01f65169 100644 --- a/pkg/client/cloud_account/get_azure_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_azure_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetAzureCloudAccountsReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAzureCloudAccountsOK() *GetAzureCloudAccountsOK { return &GetAzureCloudAccountsOK{} } -/*GetAzureCloudAccountsOK handles this case with default header values. +/* GetAzureCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetAzureCloudAccountsOK struct { func (o *GetAzureCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure][%d] getAzureCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetAzureCloudAccountsOK) GetPayload() *models.CloudAccountAzureResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetAzureCloudAccountsForbidden() *GetAzureCloudAccountsForbidden { return &GetAzureCloudAccountsForbidden{} } -/*GetAzureCloudAccountsForbidden handles this case with default header values. +/* GetAzureCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAzureCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAzureCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure][%d] getAzureCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-azure][%d] getAzureCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetAzureCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAzureCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_cloud_account_parameters.go b/pkg/client/cloud_account/get_cloud_account_parameters.go index e2f0b353..faa2f28a 100644 --- a/pkg/client/cloud_account/get_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_cloud_account_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCloudAccountParams creates a new GetCloudAccountParams object -// with the default values initialized. +// NewGetCloudAccountParams creates a new GetCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCloudAccountParams() *GetCloudAccountParams { - var () return &GetCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetCloudAccountParamsWithTimeout creates a new GetCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCloudAccountParamsWithTimeout(timeout time.Duration) *GetCloudAccountParams { - var () return &GetCloudAccountParams{ - timeout: timeout, } } // NewGetCloudAccountParamsWithContext creates a new GetCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCloudAccountParamsWithContext(ctx context.Context) *GetCloudAccountParams { - var () return &GetCloudAccountParams{ - Context: ctx, } } // NewGetCloudAccountParamsWithHTTPClient creates a new GetCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCloudAccountParamsWithHTTPClient(client *http.Client) *GetCloudAccountParams { - var () return &GetCloudAccountParams{ HTTPClient: client, } } -/*GetCloudAccountParams contains all the parameters to send to the API endpoint -for the get cloud account operation typically these are written to a http.Request +/* GetCloudAccountParams contains all the parameters to send to the API endpoint + for the get cloud account operation. + + Typically these are written to a http.Request. */ type GetCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +82,21 @@ type GetCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCloudAccountParams) WithDefaults() *GetCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get cloud account params func (o *GetCloudAccountParams) WithTimeout(timeout time.Duration) *GetCloudAccountParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetCloudAccountParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get cloud account params +func (o *GetCloudAccountParams) WithDollarSelect(dollarSelect *string) *GetCloudAccountParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get cloud account params +func (o *GetCloudAccountParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get cloud account params func (o *GetCloudAccountParams) WithAPIVersion(aPIVersion *string) *GetCloudAccountParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_cloud_account_responses.go b/pkg/client/cloud_account/get_cloud_account_responses.go index fe4f529f..51c968b3 100644 --- a/pkg/client/cloud_account/get_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetCloudAccountReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetCloudAccountOK() *GetCloudAccountOK { return &GetCloudAccountOK{} } -/*GetCloudAccountOK handles this case with default header values. +/* GetCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetCloudAccountOK struct { func (o *GetCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts/{id}][%d] getCloudAccountOK %+v", 200, o.Payload) } - func (o *GetCloudAccountOK) GetPayload() *models.CloudAccount { return o.Payload } @@ -85,19 +83,30 @@ func NewGetCloudAccountForbidden() *GetCloudAccountForbidden { return &GetCloudAccountForbidden{} } -/*GetCloudAccountForbidden handles this case with default header values. +/* GetCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts/{id}][%d] getCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts/{id}][%d] getCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetCloudAccountNotFound() *GetCloudAccountNotFound { return &GetCloudAccountNotFound{} } -/*GetCloudAccountNotFound handles this case with default header values. +/* GetCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetCloudAccountNotFound struct { func (o *GetCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts/{id}][%d] getCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_cloud_accounts_parameters.go index 46875aec..7e029728 100644 --- a/pkg/client/cloud_account/get_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_cloud_accounts_parameters.go @@ -14,55 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetCloudAccountsParams creates a new GetCloudAccountsParams object -// with the default values initialized. +// NewGetCloudAccountsParams creates a new GetCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetCloudAccountsParams() *GetCloudAccountsParams { - var () return &GetCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetCloudAccountsParamsWithTimeout creates a new GetCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCloudAccountsParamsWithTimeout(timeout time.Duration) *GetCloudAccountsParams { - var () return &GetCloudAccountsParams{ - timeout: timeout, } } // NewGetCloudAccountsParamsWithContext creates a new GetCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCloudAccountsParamsWithContext(ctx context.Context) *GetCloudAccountsParams { - var () return &GetCloudAccountsParams{ - Context: ctx, } } // NewGetCloudAccountsParamsWithHTTPClient creates a new GetCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCloudAccountsParamsWithHTTPClient(client *http.Client) *GetCloudAccountsParams { - var () return &GetCloudAccountsParams{ HTTPClient: client, } } -/*GetCloudAccountsParams contains all the parameters to send to the API endpoint -for the get cloud accounts operation typically these are written to a http.Request +/* GetCloudAccountsParams contains all the parameters to send to the API endpoint + for the get cloud accounts operation. + + Typically these are written to a http.Request. */ type GetCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarCount. + + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. + */ + DollarFilter *string + + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +101,21 @@ type GetCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCloudAccountsParams) WithDefaults() *GetCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get cloud accounts params func (o *GetCloudAccountsParams) WithTimeout(timeout time.Duration) *GetCloudAccountsParams { o.SetTimeout(timeout) @@ -104,6 +149,61 @@ func (o *GetCloudAccountsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get cloud accounts params +func (o *GetCloudAccountsParams) WithDollarCount(dollarCount *bool) *GetCloudAccountsParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get cloud accounts params +func (o *GetCloudAccountsParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + +// WithDollarFilter adds the dollarFilter to the get cloud accounts params +func (o *GetCloudAccountsParams) WithDollarFilter(dollarFilter *string) *GetCloudAccountsParams { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the get cloud accounts params +func (o *GetCloudAccountsParams) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarSelect adds the dollarSelect to the get cloud accounts params +func (o *GetCloudAccountsParams) WithDollarSelect(dollarSelect *string) *GetCloudAccountsParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get cloud accounts params +func (o *GetCloudAccountsParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get cloud accounts params +func (o *GetCloudAccountsParams) WithDollarSkip(dollarSkip *int64) *GetCloudAccountsParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get cloud accounts params +func (o *GetCloudAccountsParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get cloud accounts params +func (o *GetCloudAccountsParams) WithDollarTop(dollarTop *int64) *GetCloudAccountsParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get cloud accounts params +func (o *GetCloudAccountsParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get cloud accounts params func (o *GetCloudAccountsParams) WithAPIVersion(aPIVersion *string) *GetCloudAccountsParams { o.SetAPIVersion(aPIVersion) @@ -123,20 +223,106 @@ func (o *GetCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg str } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_cloud_accounts_responses.go b/pkg/client/cloud_account/get_cloud_accounts_responses.go index 84cb7f8b..5c896cc5 100644 --- a/pkg/client/cloud_account/get_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetCloudAccountsReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetCloudAccountsOK() *GetCloudAccountsOK { return &GetCloudAccountsOK{} } -/*GetCloudAccountsOK handles this case with default header values. +/* GetCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetCloudAccountsOK struct { func (o *GetCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts][%d] getCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetCloudAccountsOK) GetPayload() *models.CloudAccountResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetCloudAccountsForbidden() *GetCloudAccountsForbidden { return &GetCloudAccountsForbidden{} } -/*GetCloudAccountsForbidden handles this case with default header values. +/* GetCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts][%d] getCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts][%d] getCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_gcp_cloud_account_parameters.go b/pkg/client/cloud_account/get_gcp_cloud_account_parameters.go index eb06409e..4fd97660 100644 --- a/pkg/client/cloud_account/get_gcp_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_gcp_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetGcpCloudAccountParams creates a new GetGcpCloudAccountParams object -// with the default values initialized. +// NewGetGcpCloudAccountParams creates a new GetGcpCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetGcpCloudAccountParams() *GetGcpCloudAccountParams { - var () return &GetGcpCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetGcpCloudAccountParamsWithTimeout creates a new GetGcpCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetGcpCloudAccountParamsWithTimeout(timeout time.Duration) *GetGcpCloudAccountParams { - var () return &GetGcpCloudAccountParams{ - timeout: timeout, } } // NewGetGcpCloudAccountParamsWithContext creates a new GetGcpCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetGcpCloudAccountParamsWithContext(ctx context.Context) *GetGcpCloudAccountParams { - var () return &GetGcpCloudAccountParams{ - Context: ctx, } } // NewGetGcpCloudAccountParamsWithHTTPClient creates a new GetGcpCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetGcpCloudAccountParamsWithHTTPClient(client *http.Client) *GetGcpCloudAccountParams { - var () return &GetGcpCloudAccountParams{ HTTPClient: client, } } -/*GetGcpCloudAccountParams contains all the parameters to send to the API endpoint -for the get gcp cloud account operation typically these are written to a http.Request +/* GetGcpCloudAccountParams contains all the parameters to send to the API endpoint + for the get gcp cloud account operation. + + Typically these are written to a http.Request. */ type GetGcpCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetGcpCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGcpCloudAccountParams) WithDefaults() *GetGcpCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGcpCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get gcp cloud account params func (o *GetGcpCloudAccountParams) WithTimeout(timeout time.Duration) *GetGcpCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetGcpCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_gcp_cloud_account_responses.go b/pkg/client/cloud_account/get_gcp_cloud_account_responses.go index a57051b5..ada40e7e 100644 --- a/pkg/client/cloud_account/get_gcp_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_gcp_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetGcpCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetGcpCloudAccountOK() *GetGcpCloudAccountOK { return &GetGcpCloudAccountOK{} } -/*GetGcpCloudAccountOK handles this case with default header values. +/* GetGcpCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetGcpCloudAccountOK struct { func (o *GetGcpCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp/{id}][%d] getGcpCloudAccountOK %+v", 200, o.Payload) } - func (o *GetGcpCloudAccountOK) GetPayload() *models.CloudAccountGcp { return o.Payload } @@ -85,19 +83,30 @@ func NewGetGcpCloudAccountForbidden() *GetGcpCloudAccountForbidden { return &GetGcpCloudAccountForbidden{} } -/*GetGcpCloudAccountForbidden handles this case with default header values. +/* GetGcpCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetGcpCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetGcpCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp/{id}][%d] getGcpCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp/{id}][%d] getGcpCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetGcpCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetGcpCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetGcpCloudAccountNotFound() *GetGcpCloudAccountNotFound { return &GetGcpCloudAccountNotFound{} } -/*GetGcpCloudAccountNotFound handles this case with default header values. +/* GetGcpCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetGcpCloudAccountNotFound struct { func (o *GetGcpCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp/{id}][%d] getGcpCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetGcpCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_gcp_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_gcp_cloud_accounts_parameters.go index 7d002e68..106deca4 100644 --- a/pkg/client/cloud_account/get_gcp_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_gcp_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetGcpCloudAccountsParams creates a new GetGcpCloudAccountsParams object -// with the default values initialized. +// NewGetGcpCloudAccountsParams creates a new GetGcpCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetGcpCloudAccountsParams() *GetGcpCloudAccountsParams { - var () return &GetGcpCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetGcpCloudAccountsParamsWithTimeout creates a new GetGcpCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetGcpCloudAccountsParamsWithTimeout(timeout time.Duration) *GetGcpCloudAccountsParams { - var () return &GetGcpCloudAccountsParams{ - timeout: timeout, } } // NewGetGcpCloudAccountsParamsWithContext creates a new GetGcpCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetGcpCloudAccountsParamsWithContext(ctx context.Context) *GetGcpCloudAccountsParams { - var () return &GetGcpCloudAccountsParams{ - Context: ctx, } } // NewGetGcpCloudAccountsParamsWithHTTPClient creates a new GetGcpCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetGcpCloudAccountsParamsWithHTTPClient(client *http.Client) *GetGcpCloudAccountsParams { - var () return &GetGcpCloudAccountsParams{ HTTPClient: client, } } -/*GetGcpCloudAccountsParams contains all the parameters to send to the API endpoint -for the get gcp cloud accounts operation typically these are written to a http.Request +/* GetGcpCloudAccountsParams contains all the parameters to send to the API endpoint + for the get gcp cloud accounts operation. + + Typically these are written to a http.Request. */ type GetGcpCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetGcpCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get gcp cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGcpCloudAccountsParams) WithDefaults() *GetGcpCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get gcp cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGcpCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get gcp cloud accounts params func (o *GetGcpCloudAccountsParams) WithTimeout(timeout time.Duration) *GetGcpCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetGcpCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_gcp_cloud_accounts_responses.go b/pkg/client/cloud_account/get_gcp_cloud_accounts_responses.go index 7c2a2e97..1ed3e312 100644 --- a/pkg/client/cloud_account/get_gcp_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_gcp_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetGcpCloudAccountsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetGcpCloudAccountsOK() *GetGcpCloudAccountsOK { return &GetGcpCloudAccountsOK{} } -/*GetGcpCloudAccountsOK handles this case with default header values. +/* GetGcpCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetGcpCloudAccountsOK struct { func (o *GetGcpCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp][%d] getGcpCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetGcpCloudAccountsOK) GetPayload() *models.CloudAccountGcpResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetGcpCloudAccountsForbidden() *GetGcpCloudAccountsForbidden { return &GetGcpCloudAccountsForbidden{} } -/*GetGcpCloudAccountsForbidden handles this case with default header values. +/* GetGcpCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetGcpCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetGcpCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp][%d] getGcpCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-gcp][%d] getGcpCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetGcpCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetGcpCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_nsx_t_cloud_account_parameters.go b/pkg/client/cloud_account/get_nsx_t_cloud_account_parameters.go index cfddaf88..3cb10ddc 100644 --- a/pkg/client/cloud_account/get_nsx_t_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_nsx_t_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNsxTCloudAccountParams creates a new GetNsxTCloudAccountParams object -// with the default values initialized. +// NewGetNsxTCloudAccountParams creates a new GetNsxTCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNsxTCloudAccountParams() *GetNsxTCloudAccountParams { - var () return &GetNsxTCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetNsxTCloudAccountParamsWithTimeout creates a new GetNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNsxTCloudAccountParamsWithTimeout(timeout time.Duration) *GetNsxTCloudAccountParams { - var () return &GetNsxTCloudAccountParams{ - timeout: timeout, } } // NewGetNsxTCloudAccountParamsWithContext creates a new GetNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNsxTCloudAccountParamsWithContext(ctx context.Context) *GetNsxTCloudAccountParams { - var () return &GetNsxTCloudAccountParams{ - Context: ctx, } } // NewGetNsxTCloudAccountParamsWithHTTPClient creates a new GetNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNsxTCloudAccountParamsWithHTTPClient(client *http.Client) *GetNsxTCloudAccountParams { - var () return &GetNsxTCloudAccountParams{ HTTPClient: client, } } -/*GetNsxTCloudAccountParams contains all the parameters to send to the API endpoint -for the get nsx t cloud account operation typically these are written to a http.Request +/* GetNsxTCloudAccountParams contains all the parameters to send to the API endpoint + for the get nsx t cloud account operation. + + Typically these are written to a http.Request. */ type GetNsxTCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetNsxTCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxTCloudAccountParams) WithDefaults() *GetNsxTCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxTCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get nsx t cloud account params func (o *GetNsxTCloudAccountParams) WithTimeout(timeout time.Duration) *GetNsxTCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetNsxTCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_nsx_t_cloud_account_responses.go b/pkg/client/cloud_account/get_nsx_t_cloud_account_responses.go index 985ae438..17d18269 100644 --- a/pkg/client/cloud_account/get_nsx_t_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_nsx_t_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetNsxTCloudAccountReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetNsxTCloudAccountOK() *GetNsxTCloudAccountOK { return &GetNsxTCloudAccountOK{} } -/*GetNsxTCloudAccountOK handles this case with default header values. +/* GetNsxTCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetNsxTCloudAccountOK struct { func (o *GetNsxTCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t/{id}][%d] getNsxTCloudAccountOK %+v", 200, o.Payload) } - func (o *GetNsxTCloudAccountOK) GetPayload() *models.CloudAccountNsxT { return o.Payload } @@ -85,19 +83,30 @@ func NewGetNsxTCloudAccountForbidden() *GetNsxTCloudAccountForbidden { return &GetNsxTCloudAccountForbidden{} } -/*GetNsxTCloudAccountForbidden handles this case with default header values. +/* GetNsxTCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNsxTCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNsxTCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t/{id}][%d] getNsxTCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t/{id}][%d] getNsxTCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetNsxTCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNsxTCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetNsxTCloudAccountNotFound() *GetNsxTCloudAccountNotFound { return &GetNsxTCloudAccountNotFound{} } -/*GetNsxTCloudAccountNotFound handles this case with default header values. +/* GetNsxTCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetNsxTCloudAccountNotFound struct { func (o *GetNsxTCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t/{id}][%d] getNsxTCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetNsxTCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_nsx_t_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_nsx_t_cloud_accounts_parameters.go index c94da6d6..22144d80 100644 --- a/pkg/client/cloud_account/get_nsx_t_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_nsx_t_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNsxTCloudAccountsParams creates a new GetNsxTCloudAccountsParams object -// with the default values initialized. +// NewGetNsxTCloudAccountsParams creates a new GetNsxTCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNsxTCloudAccountsParams() *GetNsxTCloudAccountsParams { - var () return &GetNsxTCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetNsxTCloudAccountsParamsWithTimeout creates a new GetNsxTCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNsxTCloudAccountsParamsWithTimeout(timeout time.Duration) *GetNsxTCloudAccountsParams { - var () return &GetNsxTCloudAccountsParams{ - timeout: timeout, } } // NewGetNsxTCloudAccountsParamsWithContext creates a new GetNsxTCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNsxTCloudAccountsParamsWithContext(ctx context.Context) *GetNsxTCloudAccountsParams { - var () return &GetNsxTCloudAccountsParams{ - Context: ctx, } } // NewGetNsxTCloudAccountsParamsWithHTTPClient creates a new GetNsxTCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNsxTCloudAccountsParamsWithHTTPClient(client *http.Client) *GetNsxTCloudAccountsParams { - var () return &GetNsxTCloudAccountsParams{ HTTPClient: client, } } -/*GetNsxTCloudAccountsParams contains all the parameters to send to the API endpoint -for the get nsx t cloud accounts operation typically these are written to a http.Request +/* GetNsxTCloudAccountsParams contains all the parameters to send to the API endpoint + for the get nsx t cloud accounts operation. + + Typically these are written to a http.Request. */ type GetNsxTCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetNsxTCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get nsx t cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxTCloudAccountsParams) WithDefaults() *GetNsxTCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get nsx t cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxTCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get nsx t cloud accounts params func (o *GetNsxTCloudAccountsParams) WithTimeout(timeout time.Duration) *GetNsxTCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetNsxTCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_nsx_t_cloud_accounts_responses.go b/pkg/client/cloud_account/get_nsx_t_cloud_accounts_responses.go index 2c9b1fbb..ffda0845 100644 --- a/pkg/client/cloud_account/get_nsx_t_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_nsx_t_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetNsxTCloudAccountsReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetNsxTCloudAccountsOK() *GetNsxTCloudAccountsOK { return &GetNsxTCloudAccountsOK{} } -/*GetNsxTCloudAccountsOK handles this case with default header values. +/* GetNsxTCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetNsxTCloudAccountsOK struct { func (o *GetNsxTCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t][%d] getNsxTCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetNsxTCloudAccountsOK) GetPayload() *models.CloudAccountNsxTResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetNsxTCloudAccountsForbidden() *GetNsxTCloudAccountsForbidden { return &GetNsxTCloudAccountsForbidden{} } -/*GetNsxTCloudAccountsForbidden handles this case with default header values. +/* GetNsxTCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNsxTCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNsxTCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t][%d] getNsxTCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-t][%d] getNsxTCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetNsxTCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNsxTCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_nsx_v_cloud_account_parameters.go b/pkg/client/cloud_account/get_nsx_v_cloud_account_parameters.go index 8f23b6c0..2a7761a5 100644 --- a/pkg/client/cloud_account/get_nsx_v_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_nsx_v_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNsxVCloudAccountParams creates a new GetNsxVCloudAccountParams object -// with the default values initialized. +// NewGetNsxVCloudAccountParams creates a new GetNsxVCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNsxVCloudAccountParams() *GetNsxVCloudAccountParams { - var () return &GetNsxVCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetNsxVCloudAccountParamsWithTimeout creates a new GetNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNsxVCloudAccountParamsWithTimeout(timeout time.Duration) *GetNsxVCloudAccountParams { - var () return &GetNsxVCloudAccountParams{ - timeout: timeout, } } // NewGetNsxVCloudAccountParamsWithContext creates a new GetNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNsxVCloudAccountParamsWithContext(ctx context.Context) *GetNsxVCloudAccountParams { - var () return &GetNsxVCloudAccountParams{ - Context: ctx, } } // NewGetNsxVCloudAccountParamsWithHTTPClient creates a new GetNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNsxVCloudAccountParamsWithHTTPClient(client *http.Client) *GetNsxVCloudAccountParams { - var () return &GetNsxVCloudAccountParams{ HTTPClient: client, } } -/*GetNsxVCloudAccountParams contains all the parameters to send to the API endpoint -for the get nsx v cloud account operation typically these are written to a http.Request +/* GetNsxVCloudAccountParams contains all the parameters to send to the API endpoint + for the get nsx v cloud account operation. + + Typically these are written to a http.Request. */ type GetNsxVCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetNsxVCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxVCloudAccountParams) WithDefaults() *GetNsxVCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxVCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get nsx v cloud account params func (o *GetNsxVCloudAccountParams) WithTimeout(timeout time.Duration) *GetNsxVCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetNsxVCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_nsx_v_cloud_account_responses.go b/pkg/client/cloud_account/get_nsx_v_cloud_account_responses.go index 1bc61f4c..0a14eb6d 100644 --- a/pkg/client/cloud_account/get_nsx_v_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_nsx_v_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetNsxVCloudAccountReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetNsxVCloudAccountOK() *GetNsxVCloudAccountOK { return &GetNsxVCloudAccountOK{} } -/*GetNsxVCloudAccountOK handles this case with default header values. +/* GetNsxVCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetNsxVCloudAccountOK struct { func (o *GetNsxVCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v/{id}][%d] getNsxVCloudAccountOK %+v", 200, o.Payload) } - func (o *GetNsxVCloudAccountOK) GetPayload() *models.CloudAccountNsxV { return o.Payload } @@ -85,19 +83,30 @@ func NewGetNsxVCloudAccountForbidden() *GetNsxVCloudAccountForbidden { return &GetNsxVCloudAccountForbidden{} } -/*GetNsxVCloudAccountForbidden handles this case with default header values. +/* GetNsxVCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNsxVCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNsxVCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v/{id}][%d] getNsxVCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v/{id}][%d] getNsxVCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetNsxVCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNsxVCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetNsxVCloudAccountNotFound() *GetNsxVCloudAccountNotFound { return &GetNsxVCloudAccountNotFound{} } -/*GetNsxVCloudAccountNotFound handles this case with default header values. +/* GetNsxVCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetNsxVCloudAccountNotFound struct { func (o *GetNsxVCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v/{id}][%d] getNsxVCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetNsxVCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_nsx_v_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_nsx_v_cloud_accounts_parameters.go index 831a2d11..f17be4da 100644 --- a/pkg/client/cloud_account/get_nsx_v_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_nsx_v_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNsxVCloudAccountsParams creates a new GetNsxVCloudAccountsParams object -// with the default values initialized. +// NewGetNsxVCloudAccountsParams creates a new GetNsxVCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNsxVCloudAccountsParams() *GetNsxVCloudAccountsParams { - var () return &GetNsxVCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetNsxVCloudAccountsParamsWithTimeout creates a new GetNsxVCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNsxVCloudAccountsParamsWithTimeout(timeout time.Duration) *GetNsxVCloudAccountsParams { - var () return &GetNsxVCloudAccountsParams{ - timeout: timeout, } } // NewGetNsxVCloudAccountsParamsWithContext creates a new GetNsxVCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNsxVCloudAccountsParamsWithContext(ctx context.Context) *GetNsxVCloudAccountsParams { - var () return &GetNsxVCloudAccountsParams{ - Context: ctx, } } // NewGetNsxVCloudAccountsParamsWithHTTPClient creates a new GetNsxVCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNsxVCloudAccountsParamsWithHTTPClient(client *http.Client) *GetNsxVCloudAccountsParams { - var () return &GetNsxVCloudAccountsParams{ HTTPClient: client, } } -/*GetNsxVCloudAccountsParams contains all the parameters to send to the API endpoint -for the get nsx v cloud accounts operation typically these are written to a http.Request +/* GetNsxVCloudAccountsParams contains all the parameters to send to the API endpoint + for the get nsx v cloud accounts operation. + + Typically these are written to a http.Request. */ type GetNsxVCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetNsxVCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get nsx v cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxVCloudAccountsParams) WithDefaults() *GetNsxVCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get nsx v cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNsxVCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get nsx v cloud accounts params func (o *GetNsxVCloudAccountsParams) WithTimeout(timeout time.Duration) *GetNsxVCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetNsxVCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_nsx_v_cloud_accounts_responses.go b/pkg/client/cloud_account/get_nsx_v_cloud_accounts_responses.go index 1502c360..37c79611 100644 --- a/pkg/client/cloud_account/get_nsx_v_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_nsx_v_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetNsxVCloudAccountsReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetNsxVCloudAccountsOK() *GetNsxVCloudAccountsOK { return &GetNsxVCloudAccountsOK{} } -/*GetNsxVCloudAccountsOK handles this case with default header values. +/* GetNsxVCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetNsxVCloudAccountsOK struct { func (o *GetNsxVCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v][%d] getNsxVCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetNsxVCloudAccountsOK) GetPayload() *models.CloudAccountNsxVResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetNsxVCloudAccountsForbidden() *GetNsxVCloudAccountsForbidden { return &GetNsxVCloudAccountsForbidden{} } -/*GetNsxVCloudAccountsForbidden handles this case with default header values. +/* GetNsxVCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNsxVCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNsxVCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v][%d] getNsxVCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-nsx-v][%d] getNsxVCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetNsxVCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNsxVCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_vcf_cloud_account_parameters.go b/pkg/client/cloud_account/get_vcf_cloud_account_parameters.go index d0f1e8af..ffc952eb 100644 --- a/pkg/client/cloud_account/get_vcf_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_vcf_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVcfCloudAccountParams creates a new GetVcfCloudAccountParams object -// with the default values initialized. +// NewGetVcfCloudAccountParams creates a new GetVcfCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVcfCloudAccountParams() *GetVcfCloudAccountParams { - var () return &GetVcfCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetVcfCloudAccountParamsWithTimeout creates a new GetVcfCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVcfCloudAccountParamsWithTimeout(timeout time.Duration) *GetVcfCloudAccountParams { - var () return &GetVcfCloudAccountParams{ - timeout: timeout, } } // NewGetVcfCloudAccountParamsWithContext creates a new GetVcfCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVcfCloudAccountParamsWithContext(ctx context.Context) *GetVcfCloudAccountParams { - var () return &GetVcfCloudAccountParams{ - Context: ctx, } } // NewGetVcfCloudAccountParamsWithHTTPClient creates a new GetVcfCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVcfCloudAccountParamsWithHTTPClient(client *http.Client) *GetVcfCloudAccountParams { - var () return &GetVcfCloudAccountParams{ HTTPClient: client, } } -/*GetVcfCloudAccountParams contains all the parameters to send to the API endpoint -for the get vcf cloud account operation typically these are written to a http.Request +/* GetVcfCloudAccountParams contains all the parameters to send to the API endpoint + for the get vcf cloud account operation. + + Typically these are written to a http.Request. */ type GetVcfCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetVcfCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVcfCloudAccountParams) WithDefaults() *GetVcfCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVcfCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vcf cloud account params func (o *GetVcfCloudAccountParams) WithTimeout(timeout time.Duration) *GetVcfCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetVcfCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_vcf_cloud_account_responses.go b/pkg/client/cloud_account/get_vcf_cloud_account_responses.go index 4ff6da03..d08b9005 100644 --- a/pkg/client/cloud_account/get_vcf_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_vcf_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetVcfCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVcfCloudAccountOK() *GetVcfCloudAccountOK { return &GetVcfCloudAccountOK{} } -/*GetVcfCloudAccountOK handles this case with default header values. +/* GetVcfCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetVcfCloudAccountOK struct { func (o *GetVcfCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf/{id}][%d] getVcfCloudAccountOK %+v", 200, o.Payload) } - func (o *GetVcfCloudAccountOK) GetPayload() *models.CloudAccountVcf { return o.Payload } @@ -85,19 +83,30 @@ func NewGetVcfCloudAccountForbidden() *GetVcfCloudAccountForbidden { return &GetVcfCloudAccountForbidden{} } -/*GetVcfCloudAccountForbidden handles this case with default header values. +/* GetVcfCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVcfCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVcfCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf/{id}][%d] getVcfCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf/{id}][%d] getVcfCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetVcfCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVcfCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetVcfCloudAccountNotFound() *GetVcfCloudAccountNotFound { return &GetVcfCloudAccountNotFound{} } -/*GetVcfCloudAccountNotFound handles this case with default header values. +/* GetVcfCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetVcfCloudAccountNotFound struct { func (o *GetVcfCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf/{id}][%d] getVcfCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetVcfCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_vcf_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_vcf_cloud_accounts_parameters.go index 08c64751..062161bd 100644 --- a/pkg/client/cloud_account/get_vcf_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_vcf_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVcfCloudAccountsParams creates a new GetVcfCloudAccountsParams object -// with the default values initialized. +// NewGetVcfCloudAccountsParams creates a new GetVcfCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVcfCloudAccountsParams() *GetVcfCloudAccountsParams { - var () return &GetVcfCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetVcfCloudAccountsParamsWithTimeout creates a new GetVcfCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVcfCloudAccountsParamsWithTimeout(timeout time.Duration) *GetVcfCloudAccountsParams { - var () return &GetVcfCloudAccountsParams{ - timeout: timeout, } } // NewGetVcfCloudAccountsParamsWithContext creates a new GetVcfCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVcfCloudAccountsParamsWithContext(ctx context.Context) *GetVcfCloudAccountsParams { - var () return &GetVcfCloudAccountsParams{ - Context: ctx, } } // NewGetVcfCloudAccountsParamsWithHTTPClient creates a new GetVcfCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVcfCloudAccountsParamsWithHTTPClient(client *http.Client) *GetVcfCloudAccountsParams { - var () return &GetVcfCloudAccountsParams{ HTTPClient: client, } } -/*GetVcfCloudAccountsParams contains all the parameters to send to the API endpoint -for the get vcf cloud accounts operation typically these are written to a http.Request +/* GetVcfCloudAccountsParams contains all the parameters to send to the API endpoint + for the get vcf cloud accounts operation. + + Typically these are written to a http.Request. */ type GetVcfCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetVcfCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vcf cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVcfCloudAccountsParams) WithDefaults() *GetVcfCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vcf cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVcfCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vcf cloud accounts params func (o *GetVcfCloudAccountsParams) WithTimeout(timeout time.Duration) *GetVcfCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetVcfCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_vcf_cloud_accounts_responses.go b/pkg/client/cloud_account/get_vcf_cloud_accounts_responses.go index 396c5772..dc4e1446 100644 --- a/pkg/client/cloud_account/get_vcf_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_vcf_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetVcfCloudAccountsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetVcfCloudAccountsOK() *GetVcfCloudAccountsOK { return &GetVcfCloudAccountsOK{} } -/*GetVcfCloudAccountsOK handles this case with default header values. +/* GetVcfCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetVcfCloudAccountsOK struct { func (o *GetVcfCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf][%d] getVcfCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetVcfCloudAccountsOK) GetPayload() *models.CloudAccountVcfResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetVcfCloudAccountsForbidden() *GetVcfCloudAccountsForbidden { return &GetVcfCloudAccountsForbidden{} } -/*GetVcfCloudAccountsForbidden handles this case with default header values. +/* GetVcfCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVcfCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVcfCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf][%d] getVcfCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vcf][%d] getVcfCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetVcfCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVcfCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_vmc_cloud_account_parameters.go b/pkg/client/cloud_account/get_vmc_cloud_account_parameters.go index 3137eeef..ed09509f 100644 --- a/pkg/client/cloud_account/get_vmc_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_vmc_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVmcCloudAccountParams creates a new GetVmcCloudAccountParams object -// with the default values initialized. +// NewGetVmcCloudAccountParams creates a new GetVmcCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVmcCloudAccountParams() *GetVmcCloudAccountParams { - var () return &GetVmcCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetVmcCloudAccountParamsWithTimeout creates a new GetVmcCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVmcCloudAccountParamsWithTimeout(timeout time.Duration) *GetVmcCloudAccountParams { - var () return &GetVmcCloudAccountParams{ - timeout: timeout, } } // NewGetVmcCloudAccountParamsWithContext creates a new GetVmcCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVmcCloudAccountParamsWithContext(ctx context.Context) *GetVmcCloudAccountParams { - var () return &GetVmcCloudAccountParams{ - Context: ctx, } } // NewGetVmcCloudAccountParamsWithHTTPClient creates a new GetVmcCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVmcCloudAccountParamsWithHTTPClient(client *http.Client) *GetVmcCloudAccountParams { - var () return &GetVmcCloudAccountParams{ HTTPClient: client, } } -/*GetVmcCloudAccountParams contains all the parameters to send to the API endpoint -for the get vmc cloud account operation typically these are written to a http.Request +/* GetVmcCloudAccountParams contains all the parameters to send to the API endpoint + for the get vmc cloud account operation. + + Typically these are written to a http.Request. */ type GetVmcCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetVmcCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVmcCloudAccountParams) WithDefaults() *GetVmcCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVmcCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vmc cloud account params func (o *GetVmcCloudAccountParams) WithTimeout(timeout time.Duration) *GetVmcCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetVmcCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_vmc_cloud_account_responses.go b/pkg/client/cloud_account/get_vmc_cloud_account_responses.go index 1b0547a4..daf5b092 100644 --- a/pkg/client/cloud_account/get_vmc_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_vmc_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetVmcCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVmcCloudAccountOK() *GetVmcCloudAccountOK { return &GetVmcCloudAccountOK{} } -/*GetVmcCloudAccountOK handles this case with default header values. +/* GetVmcCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetVmcCloudAccountOK struct { func (o *GetVmcCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc/{id}][%d] getVmcCloudAccountOK %+v", 200, o.Payload) } - func (o *GetVmcCloudAccountOK) GetPayload() *models.CloudAccountVmc { return o.Payload } @@ -85,19 +83,30 @@ func NewGetVmcCloudAccountForbidden() *GetVmcCloudAccountForbidden { return &GetVmcCloudAccountForbidden{} } -/*GetVmcCloudAccountForbidden handles this case with default header values. +/* GetVmcCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVmcCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVmcCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc/{id}][%d] getVmcCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc/{id}][%d] getVmcCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetVmcCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVmcCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetVmcCloudAccountNotFound() *GetVmcCloudAccountNotFound { return &GetVmcCloudAccountNotFound{} } -/*GetVmcCloudAccountNotFound handles this case with default header values. +/* GetVmcCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetVmcCloudAccountNotFound struct { func (o *GetVmcCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc/{id}][%d] getVmcCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetVmcCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_vmc_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_vmc_cloud_accounts_parameters.go index 5a1fcda4..4342220b 100644 --- a/pkg/client/cloud_account/get_vmc_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_vmc_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVmcCloudAccountsParams creates a new GetVmcCloudAccountsParams object -// with the default values initialized. +// NewGetVmcCloudAccountsParams creates a new GetVmcCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVmcCloudAccountsParams() *GetVmcCloudAccountsParams { - var () return &GetVmcCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetVmcCloudAccountsParamsWithTimeout creates a new GetVmcCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVmcCloudAccountsParamsWithTimeout(timeout time.Duration) *GetVmcCloudAccountsParams { - var () return &GetVmcCloudAccountsParams{ - timeout: timeout, } } // NewGetVmcCloudAccountsParamsWithContext creates a new GetVmcCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVmcCloudAccountsParamsWithContext(ctx context.Context) *GetVmcCloudAccountsParams { - var () return &GetVmcCloudAccountsParams{ - Context: ctx, } } // NewGetVmcCloudAccountsParamsWithHTTPClient creates a new GetVmcCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVmcCloudAccountsParamsWithHTTPClient(client *http.Client) *GetVmcCloudAccountsParams { - var () return &GetVmcCloudAccountsParams{ HTTPClient: client, } } -/*GetVmcCloudAccountsParams contains all the parameters to send to the API endpoint -for the get vmc cloud accounts operation typically these are written to a http.Request +/* GetVmcCloudAccountsParams contains all the parameters to send to the API endpoint + for the get vmc cloud accounts operation. + + Typically these are written to a http.Request. */ type GetVmcCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetVmcCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vmc cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVmcCloudAccountsParams) WithDefaults() *GetVmcCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vmc cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVmcCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vmc cloud accounts params func (o *GetVmcCloudAccountsParams) WithTimeout(timeout time.Duration) *GetVmcCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetVmcCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_vmc_cloud_accounts_responses.go b/pkg/client/cloud_account/get_vmc_cloud_accounts_responses.go index 7c04171b..a4e36cd9 100644 --- a/pkg/client/cloud_account/get_vmc_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_vmc_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetVmcCloudAccountsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetVmcCloudAccountsOK() *GetVmcCloudAccountsOK { return &GetVmcCloudAccountsOK{} } -/*GetVmcCloudAccountsOK handles this case with default header values. +/* GetVmcCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetVmcCloudAccountsOK struct { func (o *GetVmcCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc][%d] getVmcCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetVmcCloudAccountsOK) GetPayload() *models.CloudAccountVmcResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetVmcCloudAccountsForbidden() *GetVmcCloudAccountsForbidden { return &GetVmcCloudAccountsForbidden{} } -/*GetVmcCloudAccountsForbidden handles this case with default header values. +/* GetVmcCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVmcCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVmcCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc][%d] getVmcCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vmc][%d] getVmcCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetVmcCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVmcCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/get_vsphere_cloud_account_parameters.go b/pkg/client/cloud_account/get_vsphere_cloud_account_parameters.go index 520f778a..d887f618 100644 --- a/pkg/client/cloud_account/get_vsphere_cloud_account_parameters.go +++ b/pkg/client/cloud_account/get_vsphere_cloud_account_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVSphereCloudAccountParams creates a new GetVSphereCloudAccountParams object -// with the default values initialized. +// NewGetVSphereCloudAccountParams creates a new GetVSphereCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVSphereCloudAccountParams() *GetVSphereCloudAccountParams { - var () return &GetVSphereCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetVSphereCloudAccountParamsWithTimeout creates a new GetVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVSphereCloudAccountParamsWithTimeout(timeout time.Duration) *GetVSphereCloudAccountParams { - var () return &GetVSphereCloudAccountParams{ - timeout: timeout, } } // NewGetVSphereCloudAccountParamsWithContext creates a new GetVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVSphereCloudAccountParamsWithContext(ctx context.Context) *GetVSphereCloudAccountParams { - var () return &GetVSphereCloudAccountParams{ - Context: ctx, } } // NewGetVSphereCloudAccountParamsWithHTTPClient creates a new GetVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVSphereCloudAccountParamsWithHTTPClient(client *http.Client) *GetVSphereCloudAccountParams { - var () return &GetVSphereCloudAccountParams{ HTTPClient: client, } } -/*GetVSphereCloudAccountParams contains all the parameters to send to the API endpoint -for the get v sphere cloud account operation typically these are written to a http.Request +/* GetVSphereCloudAccountParams contains all the parameters to send to the API endpoint + for the get v sphere cloud account operation. + + Typically these are written to a http.Request. */ type GetVSphereCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Cloud Account + /* ID. + + The ID of the Cloud Account */ ID string @@ -76,6 +76,21 @@ type GetVSphereCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereCloudAccountParams) WithDefaults() *GetVSphereCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get v sphere cloud account params func (o *GetVSphereCloudAccountParams) WithTimeout(timeout time.Duration) *GetVSphereCloudAccountParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetVSphereCloudAccountParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/cloud_account/get_vsphere_cloud_account_responses.go b/pkg/client/cloud_account/get_vsphere_cloud_account_responses.go index 5eeb0829..0d62b270 100644 --- a/pkg/client/cloud_account/get_vsphere_cloud_account_responses.go +++ b/pkg/client/cloud_account/get_vsphere_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *GetVSphereCloudAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVSphereCloudAccountOK() *GetVSphereCloudAccountOK { return &GetVSphereCloudAccountOK{} } -/*GetVSphereCloudAccountOK handles this case with default header values. +/* GetVSphereCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetVSphereCloudAccountOK struct { func (o *GetVSphereCloudAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere/{id}][%d] getVSphereCloudAccountOK %+v", 200, o.Payload) } - func (o *GetVSphereCloudAccountOK) GetPayload() *models.CloudAccountVsphere { return o.Payload } @@ -85,19 +83,30 @@ func NewGetVSphereCloudAccountForbidden() *GetVSphereCloudAccountForbidden { return &GetVSphereCloudAccountForbidden{} } -/*GetVSphereCloudAccountForbidden handles this case with default header values. +/* GetVSphereCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVSphereCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVSphereCloudAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere/{id}][%d] getVSphereCloudAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere/{id}][%d] getVSphereCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *GetVSphereCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVSphereCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetVSphereCloudAccountNotFound() *GetVSphereCloudAccountNotFound { return &GetVSphereCloudAccountNotFound{} } -/*GetVSphereCloudAccountNotFound handles this case with default header values. +/* GetVSphereCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetVSphereCloudAccountNotFound struct { func (o *GetVSphereCloudAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere/{id}][%d] getVSphereCloudAccountNotFound %+v", 404, o.Payload) } - func (o *GetVSphereCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/get_vsphere_cloud_accounts_parameters.go b/pkg/client/cloud_account/get_vsphere_cloud_accounts_parameters.go index 5a2d4fb5..f1ea9af4 100644 --- a/pkg/client/cloud_account/get_vsphere_cloud_accounts_parameters.go +++ b/pkg/client/cloud_account/get_vsphere_cloud_accounts_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVSphereCloudAccountsParams creates a new GetVSphereCloudAccountsParams object -// with the default values initialized. +// NewGetVSphereCloudAccountsParams creates a new GetVSphereCloudAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVSphereCloudAccountsParams() *GetVSphereCloudAccountsParams { - var () return &GetVSphereCloudAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetVSphereCloudAccountsParamsWithTimeout creates a new GetVSphereCloudAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVSphereCloudAccountsParamsWithTimeout(timeout time.Duration) *GetVSphereCloudAccountsParams { - var () return &GetVSphereCloudAccountsParams{ - timeout: timeout, } } // NewGetVSphereCloudAccountsParamsWithContext creates a new GetVSphereCloudAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVSphereCloudAccountsParamsWithContext(ctx context.Context) *GetVSphereCloudAccountsParams { - var () return &GetVSphereCloudAccountsParams{ - Context: ctx, } } // NewGetVSphereCloudAccountsParamsWithHTTPClient creates a new GetVSphereCloudAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVSphereCloudAccountsParamsWithHTTPClient(client *http.Client) *GetVSphereCloudAccountsParams { - var () return &GetVSphereCloudAccountsParams{ HTTPClient: client, } } -/*GetVSphereCloudAccountsParams contains all the parameters to send to the API endpoint -for the get v sphere cloud accounts operation typically these are written to a http.Request +/* GetVSphereCloudAccountsParams contains all the parameters to send to the API endpoint + for the get v sphere cloud accounts operation. + + Typically these are written to a http.Request. */ type GetVSphereCloudAccountsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetVSphereCloudAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get v sphere cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereCloudAccountsParams) WithDefaults() *GetVSphereCloudAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v sphere cloud accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereCloudAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get v sphere cloud accounts params func (o *GetVSphereCloudAccountsParams) WithTimeout(timeout time.Duration) *GetVSphereCloudAccountsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetVSphereCloudAccountsParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/cloud_account/get_vsphere_cloud_accounts_responses.go b/pkg/client/cloud_account/get_vsphere_cloud_accounts_responses.go index 23821002..1c4327e8 100644 --- a/pkg/client/cloud_account/get_vsphere_cloud_accounts_responses.go +++ b/pkg/client/cloud_account/get_vsphere_cloud_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetVSphereCloudAccountsReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetVSphereCloudAccountsOK() *GetVSphereCloudAccountsOK { return &GetVSphereCloudAccountsOK{} } -/*GetVSphereCloudAccountsOK handles this case with default header values. +/* GetVSphereCloudAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetVSphereCloudAccountsOK struct { func (o *GetVSphereCloudAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere][%d] getVSphereCloudAccountsOK %+v", 200, o.Payload) } - func (o *GetVSphereCloudAccountsOK) GetPayload() *models.CloudAccountVsphereResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetVSphereCloudAccountsForbidden() *GetVSphereCloudAccountsForbidden { return &GetVSphereCloudAccountsForbidden{} } -/*GetVSphereCloudAccountsForbidden handles this case with default header values. +/* GetVSphereCloudAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVSphereCloudAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVSphereCloudAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere][%d] getVSphereCloudAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/cloud-accounts-vsphere][%d] getVSphereCloudAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetVSphereCloudAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVSphereCloudAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/cloud_account/update_aws_cloud_account_parameters.go b/pkg/client/cloud_account/update_aws_cloud_account_parameters.go index bf7c1249..d48b6d7f 100644 --- a/pkg/client/cloud_account/update_aws_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_aws_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateAwsCloudAccountParams creates a new UpdateAwsCloudAccountParams object -// with the default values initialized. +// NewUpdateAwsCloudAccountParams creates a new UpdateAwsCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateAwsCloudAccountParams() *UpdateAwsCloudAccountParams { - var () return &UpdateAwsCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAwsCloudAccountParamsWithTimeout creates a new UpdateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAwsCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateAwsCloudAccountParams { - var () return &UpdateAwsCloudAccountParams{ - timeout: timeout, } } // NewUpdateAwsCloudAccountParamsWithContext creates a new UpdateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAwsCloudAccountParamsWithContext(ctx context.Context) *UpdateAwsCloudAccountParams { - var () return &UpdateAwsCloudAccountParams{ - Context: ctx, } } // NewUpdateAwsCloudAccountParamsWithHTTPClient creates a new UpdateAwsCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAwsCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateAwsCloudAccountParams { - var () return &UpdateAwsCloudAccountParams{ HTTPClient: client, } } -/*UpdateAwsCloudAccountParams contains all the parameters to send to the API endpoint -for the update aws cloud account operation typically these are written to a http.Request +/* UpdateAwsCloudAccountParams contains all the parameters to send to the API endpoint + for the update aws cloud account operation. + + Typically these are written to a http.Request. */ type UpdateAwsCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - AWS cloud account details to be updated + /* Body. + + AWS cloud account details to be updated */ Body *models.UpdateCloudAccountAwsSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateAwsCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsCloudAccountParams) WithDefaults() *UpdateAwsCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update aws cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update aws cloud account params func (o *UpdateAwsCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateAwsCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateAwsCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_aws_cloud_account_responses.go b/pkg/client/cloud_account/update_aws_cloud_account_responses.go index 76dede78..da353688 100644 --- a/pkg/client/cloud_account/update_aws_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_aws_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateAwsCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateAwsCloudAccountOK() *UpdateAwsCloudAccountOK { return &UpdateAwsCloudAccountOK{} } -/*UpdateAwsCloudAccountOK handles this case with default header values. +/* UpdateAwsCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateAwsCloudAccountOK struct { func (o *UpdateAwsCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-aws/{id}][%d] updateAwsCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateAwsCloudAccountOK) GetPayload() *models.CloudAccountAws { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateAwsCloudAccountForbidden() *UpdateAwsCloudAccountForbidden { return &UpdateAwsCloudAccountForbidden{} } -/*UpdateAwsCloudAccountForbidden handles this case with default header values. +/* UpdateAwsCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateAwsCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateAwsCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-aws/{id}][%d] updateAwsCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-aws/{id}][%d] updateAwsCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateAwsCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateAwsCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateAwsCloudAccountNotFound() *UpdateAwsCloudAccountNotFound { return &UpdateAwsCloudAccountNotFound{} } -/*UpdateAwsCloudAccountNotFound handles this case with default header values. +/* UpdateAwsCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateAwsCloudAccountNotFound struct { func (o *UpdateAwsCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-aws/{id}][%d] updateAwsCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateAwsCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_azure_cloud_account_parameters.go b/pkg/client/cloud_account/update_azure_cloud_account_parameters.go index 6929016e..743f5d36 100644 --- a/pkg/client/cloud_account/update_azure_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_azure_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateAzureCloudAccountParams creates a new UpdateAzureCloudAccountParams object -// with the default values initialized. +// NewUpdateAzureCloudAccountParams creates a new UpdateAzureCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateAzureCloudAccountParams() *UpdateAzureCloudAccountParams { - var () return &UpdateAzureCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAzureCloudAccountParamsWithTimeout creates a new UpdateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAzureCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateAzureCloudAccountParams { - var () return &UpdateAzureCloudAccountParams{ - timeout: timeout, } } // NewUpdateAzureCloudAccountParamsWithContext creates a new UpdateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAzureCloudAccountParamsWithContext(ctx context.Context) *UpdateAzureCloudAccountParams { - var () return &UpdateAzureCloudAccountParams{ - Context: ctx, } } // NewUpdateAzureCloudAccountParamsWithHTTPClient creates a new UpdateAzureCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAzureCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateAzureCloudAccountParams { - var () return &UpdateAzureCloudAccountParams{ HTTPClient: client, } } -/*UpdateAzureCloudAccountParams contains all the parameters to send to the API endpoint -for the update azure cloud account operation typically these are written to a http.Request +/* UpdateAzureCloudAccountParams contains all the parameters to send to the API endpoint + for the update azure cloud account operation. + + Typically these are written to a http.Request. */ type UpdateAzureCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Azure cloud account details to be updated + /* Body. + + Azure cloud account details to be updated */ Body *models.UpdateCloudAccountAzureSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateAzureCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureCloudAccountParams) WithDefaults() *UpdateAzureCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update azure cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update azure cloud account params func (o *UpdateAzureCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateAzureCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateAzureCloudAccountParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_azure_cloud_account_responses.go b/pkg/client/cloud_account/update_azure_cloud_account_responses.go index 5891e9e5..6533d364 100644 --- a/pkg/client/cloud_account/update_azure_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_azure_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateAzureCloudAccountReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateAzureCloudAccountOK() *UpdateAzureCloudAccountOK { return &UpdateAzureCloudAccountOK{} } -/*UpdateAzureCloudAccountOK handles this case with default header values. +/* UpdateAzureCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateAzureCloudAccountOK struct { func (o *UpdateAzureCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-azure/{id}][%d] updateAzureCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateAzureCloudAccountOK) GetPayload() *models.CloudAccountAzure { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateAzureCloudAccountForbidden() *UpdateAzureCloudAccountForbidden { return &UpdateAzureCloudAccountForbidden{} } -/*UpdateAzureCloudAccountForbidden handles this case with default header values. +/* UpdateAzureCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateAzureCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateAzureCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-azure/{id}][%d] updateAzureCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-azure/{id}][%d] updateAzureCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateAzureCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateAzureCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateAzureCloudAccountNotFound() *UpdateAzureCloudAccountNotFound { return &UpdateAzureCloudAccountNotFound{} } -/*UpdateAzureCloudAccountNotFound handles this case with default header values. +/* UpdateAzureCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateAzureCloudAccountNotFound struct { func (o *UpdateAzureCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-azure/{id}][%d] updateAzureCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateAzureCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_cloud_account_parameters.go b/pkg/client/cloud_account/update_cloud_account_parameters.go index ca90520a..54019726 100644 --- a/pkg/client/cloud_account/update_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateCloudAccountParams creates a new UpdateCloudAccountParams object -// with the default values initialized. +// NewUpdateCloudAccountParams creates a new UpdateCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateCloudAccountParams() *UpdateCloudAccountParams { - var () return &UpdateCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateCloudAccountParamsWithTimeout creates a new UpdateCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateCloudAccountParams { - var () return &UpdateCloudAccountParams{ - timeout: timeout, } } // NewUpdateCloudAccountParamsWithContext creates a new UpdateCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateCloudAccountParamsWithContext(ctx context.Context) *UpdateCloudAccountParams { - var () return &UpdateCloudAccountParams{ - Context: ctx, } } // NewUpdateCloudAccountParamsWithHTTPClient creates a new UpdateCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateCloudAccountParams { - var () return &UpdateCloudAccountParams{ HTTPClient: client, } } -/*UpdateCloudAccountParams contains all the parameters to send to the API endpoint -for the update cloud account operation typically these are written to a http.Request +/* UpdateCloudAccountParams contains all the parameters to send to the API endpoint + for the update cloud account operation. + + Typically these are written to a http.Request. */ type UpdateCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Cloud account details to be updated + /* Body. + + Cloud account details to be updated */ Body *models.UpdateCloudAccountSpecification - /*ID - The ID of the cloudAccount + /* ID. + + The ID of the cloudAccount */ ID string @@ -83,6 +84,21 @@ type UpdateCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCloudAccountParams) WithDefaults() *UpdateCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update cloud account params func (o *UpdateCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateCloudAccountParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_cloud_account_responses.go b/pkg/client/cloud_account/update_cloud_account_responses.go index 3574c80a..8982f9fb 100644 --- a/pkg/client/cloud_account/update_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateCloudAccountReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateCloudAccountOK() *UpdateCloudAccountOK { return &UpdateCloudAccountOK{} } -/*UpdateCloudAccountOK handles this case with default header values. +/* UpdateCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateCloudAccountOK struct { func (o *UpdateCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts/{id}][%d] updateCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateCloudAccountOK) GetPayload() *models.CloudAccount { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateCloudAccountForbidden() *UpdateCloudAccountForbidden { return &UpdateCloudAccountForbidden{} } -/*UpdateCloudAccountForbidden handles this case with default header values. +/* UpdateCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts/{id}][%d] updateCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts/{id}][%d] updateCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateCloudAccountNotFound() *UpdateCloudAccountNotFound { return &UpdateCloudAccountNotFound{} } -/*UpdateCloudAccountNotFound handles this case with default header values. +/* UpdateCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateCloudAccountNotFound struct { func (o *UpdateCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts/{id}][%d] updateCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_gcp_cloud_account_parameters.go b/pkg/client/cloud_account/update_gcp_cloud_account_parameters.go index 307999ca..fe8e5b4e 100644 --- a/pkg/client/cloud_account/update_gcp_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_gcp_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateGcpCloudAccountParams creates a new UpdateGcpCloudAccountParams object -// with the default values initialized. +// NewUpdateGcpCloudAccountParams creates a new UpdateGcpCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateGcpCloudAccountParams() *UpdateGcpCloudAccountParams { - var () return &UpdateGcpCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateGcpCloudAccountParamsWithTimeout creates a new UpdateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateGcpCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateGcpCloudAccountParams { - var () return &UpdateGcpCloudAccountParams{ - timeout: timeout, } } // NewUpdateGcpCloudAccountParamsWithContext creates a new UpdateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateGcpCloudAccountParamsWithContext(ctx context.Context) *UpdateGcpCloudAccountParams { - var () return &UpdateGcpCloudAccountParams{ - Context: ctx, } } // NewUpdateGcpCloudAccountParamsWithHTTPClient creates a new UpdateGcpCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateGcpCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateGcpCloudAccountParams { - var () return &UpdateGcpCloudAccountParams{ HTTPClient: client, } } -/*UpdateGcpCloudAccountParams contains all the parameters to send to the API endpoint -for the update gcp cloud account operation typically these are written to a http.Request +/* UpdateGcpCloudAccountParams contains all the parameters to send to the API endpoint + for the update gcp cloud account operation. + + Typically these are written to a http.Request. */ type UpdateGcpCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - GCP cloud account details to be updated + /* Body. + + GCP cloud account details to be updated */ Body *models.UpdateCloudAccountGcpSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateGcpCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateGcpCloudAccountParams) WithDefaults() *UpdateGcpCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update gcp cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateGcpCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update gcp cloud account params func (o *UpdateGcpCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateGcpCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateGcpCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_gcp_cloud_account_responses.go b/pkg/client/cloud_account/update_gcp_cloud_account_responses.go index a348507e..57f1215f 100644 --- a/pkg/client/cloud_account/update_gcp_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_gcp_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateGcpCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateGcpCloudAccountOK() *UpdateGcpCloudAccountOK { return &UpdateGcpCloudAccountOK{} } -/*UpdateGcpCloudAccountOK handles this case with default header values. +/* UpdateGcpCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateGcpCloudAccountOK struct { func (o *UpdateGcpCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-gcp/{id}][%d] updateGcpCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateGcpCloudAccountOK) GetPayload() *models.CloudAccountGcp { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateGcpCloudAccountForbidden() *UpdateGcpCloudAccountForbidden { return &UpdateGcpCloudAccountForbidden{} } -/*UpdateGcpCloudAccountForbidden handles this case with default header values. +/* UpdateGcpCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateGcpCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateGcpCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-gcp/{id}][%d] updateGcpCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-gcp/{id}][%d] updateGcpCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateGcpCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateGcpCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateGcpCloudAccountNotFound() *UpdateGcpCloudAccountNotFound { return &UpdateGcpCloudAccountNotFound{} } -/*UpdateGcpCloudAccountNotFound handles this case with default header values. +/* UpdateGcpCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateGcpCloudAccountNotFound struct { func (o *UpdateGcpCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-gcp/{id}][%d] updateGcpCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateGcpCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_nsx_t_cloud_account_parameters.go b/pkg/client/cloud_account/update_nsx_t_cloud_account_parameters.go index a963f480..ba249755 100644 --- a/pkg/client/cloud_account/update_nsx_t_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_nsx_t_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateNsxTCloudAccountParams creates a new UpdateNsxTCloudAccountParams object -// with the default values initialized. +// NewUpdateNsxTCloudAccountParams creates a new UpdateNsxTCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateNsxTCloudAccountParams() *UpdateNsxTCloudAccountParams { - var () return &UpdateNsxTCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateNsxTCloudAccountParamsWithTimeout creates a new UpdateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateNsxTCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateNsxTCloudAccountParams { - var () return &UpdateNsxTCloudAccountParams{ - timeout: timeout, } } // NewUpdateNsxTCloudAccountParamsWithContext creates a new UpdateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateNsxTCloudAccountParamsWithContext(ctx context.Context) *UpdateNsxTCloudAccountParams { - var () return &UpdateNsxTCloudAccountParams{ - Context: ctx, } } // NewUpdateNsxTCloudAccountParamsWithHTTPClient creates a new UpdateNsxTCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateNsxTCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateNsxTCloudAccountParams { - var () return &UpdateNsxTCloudAccountParams{ HTTPClient: client, } } -/*UpdateNsxTCloudAccountParams contains all the parameters to send to the API endpoint -for the update nsx t cloud account operation typically these are written to a http.Request +/* UpdateNsxTCloudAccountParams contains all the parameters to send to the API endpoint + for the update nsx t cloud account operation. + + Typically these are written to a http.Request. */ type UpdateNsxTCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - NSX-T cloud account details to be updated + /* Body. + + NSX-T cloud account details to be updated */ Body *models.UpdateCloudAccountNsxTSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateNsxTCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNsxTCloudAccountParams) WithDefaults() *UpdateNsxTCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nsx t cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNsxTCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update nsx t cloud account params func (o *UpdateNsxTCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateNsxTCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateNsxTCloudAccountParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_nsx_t_cloud_account_responses.go b/pkg/client/cloud_account/update_nsx_t_cloud_account_responses.go index c8bebe54..60eb991a 100644 --- a/pkg/client/cloud_account/update_nsx_t_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_nsx_t_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateNsxTCloudAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateNsxTCloudAccountOK() *UpdateNsxTCloudAccountOK { return &UpdateNsxTCloudAccountOK{} } -/*UpdateNsxTCloudAccountOK handles this case with default header values. +/* UpdateNsxTCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateNsxTCloudAccountOK struct { func (o *UpdateNsxTCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-t/{id}][%d] updateNsxTCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateNsxTCloudAccountOK) GetPayload() *models.CloudAccountNsxT { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateNsxTCloudAccountForbidden() *UpdateNsxTCloudAccountForbidden { return &UpdateNsxTCloudAccountForbidden{} } -/*UpdateNsxTCloudAccountForbidden handles this case with default header values. +/* UpdateNsxTCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateNsxTCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateNsxTCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-t/{id}][%d] updateNsxTCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-t/{id}][%d] updateNsxTCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateNsxTCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateNsxTCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateNsxTCloudAccountNotFound() *UpdateNsxTCloudAccountNotFound { return &UpdateNsxTCloudAccountNotFound{} } -/*UpdateNsxTCloudAccountNotFound handles this case with default header values. +/* UpdateNsxTCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateNsxTCloudAccountNotFound struct { func (o *UpdateNsxTCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-t/{id}][%d] updateNsxTCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateNsxTCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_nsx_v_cloud_account_parameters.go b/pkg/client/cloud_account/update_nsx_v_cloud_account_parameters.go index 7649813c..0952aa07 100644 --- a/pkg/client/cloud_account/update_nsx_v_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_nsx_v_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateNsxVCloudAccountParams creates a new UpdateNsxVCloudAccountParams object -// with the default values initialized. +// NewUpdateNsxVCloudAccountParams creates a new UpdateNsxVCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateNsxVCloudAccountParams() *UpdateNsxVCloudAccountParams { - var () return &UpdateNsxVCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateNsxVCloudAccountParamsWithTimeout creates a new UpdateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateNsxVCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateNsxVCloudAccountParams { - var () return &UpdateNsxVCloudAccountParams{ - timeout: timeout, } } // NewUpdateNsxVCloudAccountParamsWithContext creates a new UpdateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateNsxVCloudAccountParamsWithContext(ctx context.Context) *UpdateNsxVCloudAccountParams { - var () return &UpdateNsxVCloudAccountParams{ - Context: ctx, } } // NewUpdateNsxVCloudAccountParamsWithHTTPClient creates a new UpdateNsxVCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateNsxVCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateNsxVCloudAccountParams { - var () return &UpdateNsxVCloudAccountParams{ HTTPClient: client, } } -/*UpdateNsxVCloudAccountParams contains all the parameters to send to the API endpoint -for the update nsx v cloud account operation typically these are written to a http.Request +/* UpdateNsxVCloudAccountParams contains all the parameters to send to the API endpoint + for the update nsx v cloud account operation. + + Typically these are written to a http.Request. */ type UpdateNsxVCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - NSX-V cloud account details to be updated + /* Body. + + NSX-V cloud account details to be updated */ Body *models.UpdateCloudAccountNsxVSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateNsxVCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNsxVCloudAccountParams) WithDefaults() *UpdateNsxVCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nsx v cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNsxVCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update nsx v cloud account params func (o *UpdateNsxVCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateNsxVCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateNsxVCloudAccountParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_nsx_v_cloud_account_responses.go b/pkg/client/cloud_account/update_nsx_v_cloud_account_responses.go index afb1fe89..80742a25 100644 --- a/pkg/client/cloud_account/update_nsx_v_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_nsx_v_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateNsxVCloudAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateNsxVCloudAccountOK() *UpdateNsxVCloudAccountOK { return &UpdateNsxVCloudAccountOK{} } -/*UpdateNsxVCloudAccountOK handles this case with default header values. +/* UpdateNsxVCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateNsxVCloudAccountOK struct { func (o *UpdateNsxVCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-v/{id}][%d] updateNsxVCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateNsxVCloudAccountOK) GetPayload() *models.CloudAccountNsxV { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateNsxVCloudAccountForbidden() *UpdateNsxVCloudAccountForbidden { return &UpdateNsxVCloudAccountForbidden{} } -/*UpdateNsxVCloudAccountForbidden handles this case with default header values. +/* UpdateNsxVCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateNsxVCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateNsxVCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-v/{id}][%d] updateNsxVCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-v/{id}][%d] updateNsxVCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateNsxVCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateNsxVCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateNsxVCloudAccountNotFound() *UpdateNsxVCloudAccountNotFound { return &UpdateNsxVCloudAccountNotFound{} } -/*UpdateNsxVCloudAccountNotFound handles this case with default header values. +/* UpdateNsxVCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateNsxVCloudAccountNotFound struct { func (o *UpdateNsxVCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-nsx-v/{id}][%d] updateNsxVCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateNsxVCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_vcf_cloud_account_parameters.go b/pkg/client/cloud_account/update_vcf_cloud_account_parameters.go index fa13307d..b5593b27 100644 --- a/pkg/client/cloud_account/update_vcf_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_vcf_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateVcfCloudAccountParams creates a new UpdateVcfCloudAccountParams object -// with the default values initialized. +// NewUpdateVcfCloudAccountParams creates a new UpdateVcfCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateVcfCloudAccountParams() *UpdateVcfCloudAccountParams { - var () return &UpdateVcfCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateVcfCloudAccountParamsWithTimeout creates a new UpdateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateVcfCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateVcfCloudAccountParams { - var () return &UpdateVcfCloudAccountParams{ - timeout: timeout, } } // NewUpdateVcfCloudAccountParamsWithContext creates a new UpdateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateVcfCloudAccountParamsWithContext(ctx context.Context) *UpdateVcfCloudAccountParams { - var () return &UpdateVcfCloudAccountParams{ - Context: ctx, } } // NewUpdateVcfCloudAccountParamsWithHTTPClient creates a new UpdateVcfCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateVcfCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateVcfCloudAccountParams { - var () return &UpdateVcfCloudAccountParams{ HTTPClient: client, } } -/*UpdateVcfCloudAccountParams contains all the parameters to send to the API endpoint -for the update vcf cloud account operation typically these are written to a http.Request +/* UpdateVcfCloudAccountParams contains all the parameters to send to the API endpoint + for the update vcf cloud account operation. + + Typically these are written to a http.Request. */ type UpdateVcfCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - VCF cloud account details to be updated + /* Body. + + VCF cloud account details to be updated */ Body *models.UpdateCloudAccountVcfSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateVcfCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVcfCloudAccountParams) WithDefaults() *UpdateVcfCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update vcf cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVcfCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update vcf cloud account params func (o *UpdateVcfCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateVcfCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateVcfCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_vcf_cloud_account_responses.go b/pkg/client/cloud_account/update_vcf_cloud_account_responses.go index abdde404..01d5d4b5 100644 --- a/pkg/client/cloud_account/update_vcf_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_vcf_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateVcfCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateVcfCloudAccountOK() *UpdateVcfCloudAccountOK { return &UpdateVcfCloudAccountOK{} } -/*UpdateVcfCloudAccountOK handles this case with default header values. +/* UpdateVcfCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateVcfCloudAccountOK struct { func (o *UpdateVcfCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vcf/{id}][%d] updateVcfCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateVcfCloudAccountOK) GetPayload() *models.CloudAccountVcf { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateVcfCloudAccountForbidden() *UpdateVcfCloudAccountForbidden { return &UpdateVcfCloudAccountForbidden{} } -/*UpdateVcfCloudAccountForbidden handles this case with default header values. +/* UpdateVcfCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateVcfCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateVcfCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vcf/{id}][%d] updateVcfCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vcf/{id}][%d] updateVcfCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateVcfCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateVcfCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateVcfCloudAccountNotFound() *UpdateVcfCloudAccountNotFound { return &UpdateVcfCloudAccountNotFound{} } -/*UpdateVcfCloudAccountNotFound handles this case with default header values. +/* UpdateVcfCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateVcfCloudAccountNotFound struct { func (o *UpdateVcfCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vcf/{id}][%d] updateVcfCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateVcfCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_vmc_cloud_account_parameters.go b/pkg/client/cloud_account/update_vmc_cloud_account_parameters.go index 806c0655..08ab54ea 100644 --- a/pkg/client/cloud_account/update_vmc_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_vmc_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateVmcCloudAccountParams creates a new UpdateVmcCloudAccountParams object -// with the default values initialized. +// NewUpdateVmcCloudAccountParams creates a new UpdateVmcCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateVmcCloudAccountParams() *UpdateVmcCloudAccountParams { - var () return &UpdateVmcCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateVmcCloudAccountParamsWithTimeout creates a new UpdateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateVmcCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateVmcCloudAccountParams { - var () return &UpdateVmcCloudAccountParams{ - timeout: timeout, } } // NewUpdateVmcCloudAccountParamsWithContext creates a new UpdateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateVmcCloudAccountParamsWithContext(ctx context.Context) *UpdateVmcCloudAccountParams { - var () return &UpdateVmcCloudAccountParams{ - Context: ctx, } } // NewUpdateVmcCloudAccountParamsWithHTTPClient creates a new UpdateVmcCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateVmcCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateVmcCloudAccountParams { - var () return &UpdateVmcCloudAccountParams{ HTTPClient: client, } } -/*UpdateVmcCloudAccountParams contains all the parameters to send to the API endpoint -for the update vmc cloud account operation typically these are written to a http.Request +/* UpdateVmcCloudAccountParams contains all the parameters to send to the API endpoint + for the update vmc cloud account operation. + + Typically these are written to a http.Request. */ type UpdateVmcCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - VMC cloud account details to be updated + /* Body. + + VMC cloud account details to be updated */ Body *models.UpdateCloudAccountVmcSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateVmcCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVmcCloudAccountParams) WithDefaults() *UpdateVmcCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update vmc cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVmcCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update vmc cloud account params func (o *UpdateVmcCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateVmcCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateVmcCloudAccountParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_vmc_cloud_account_responses.go b/pkg/client/cloud_account/update_vmc_cloud_account_responses.go index 1645fe48..fca754ec 100644 --- a/pkg/client/cloud_account/update_vmc_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_vmc_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateVmcCloudAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateVmcCloudAccountOK() *UpdateVmcCloudAccountOK { return &UpdateVmcCloudAccountOK{} } -/*UpdateVmcCloudAccountOK handles this case with default header values. +/* UpdateVmcCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateVmcCloudAccountOK struct { func (o *UpdateVmcCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vmc/{id}][%d] updateVmcCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateVmcCloudAccountOK) GetPayload() *models.CloudAccountVmc { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateVmcCloudAccountForbidden() *UpdateVmcCloudAccountForbidden { return &UpdateVmcCloudAccountForbidden{} } -/*UpdateVmcCloudAccountForbidden handles this case with default header values. +/* UpdateVmcCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateVmcCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateVmcCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vmc/{id}][%d] updateVmcCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vmc/{id}][%d] updateVmcCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateVmcCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateVmcCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateVmcCloudAccountNotFound() *UpdateVmcCloudAccountNotFound { return &UpdateVmcCloudAccountNotFound{} } -/*UpdateVmcCloudAccountNotFound handles this case with default header values. +/* UpdateVmcCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateVmcCloudAccountNotFound struct { func (o *UpdateVmcCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vmc/{id}][%d] updateVmcCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateVmcCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/cloud_account/update_vsphere_cloud_account_parameters.go b/pkg/client/cloud_account/update_vsphere_cloud_account_parameters.go index 6e09d80b..0f8809c1 100644 --- a/pkg/client/cloud_account/update_vsphere_cloud_account_parameters.go +++ b/pkg/client/cloud_account/update_vsphere_cloud_account_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateVSphereCloudAccountParams creates a new UpdateVSphereCloudAccountParams object -// with the default values initialized. +// NewUpdateVSphereCloudAccountParams creates a new UpdateVSphereCloudAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateVSphereCloudAccountParams() *UpdateVSphereCloudAccountParams { - var () return &UpdateVSphereCloudAccountParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateVSphereCloudAccountParamsWithTimeout creates a new UpdateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateVSphereCloudAccountParamsWithTimeout(timeout time.Duration) *UpdateVSphereCloudAccountParams { - var () return &UpdateVSphereCloudAccountParams{ - timeout: timeout, } } // NewUpdateVSphereCloudAccountParamsWithContext creates a new UpdateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateVSphereCloudAccountParamsWithContext(ctx context.Context) *UpdateVSphereCloudAccountParams { - var () return &UpdateVSphereCloudAccountParams{ - Context: ctx, } } // NewUpdateVSphereCloudAccountParamsWithHTTPClient creates a new UpdateVSphereCloudAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateVSphereCloudAccountParamsWithHTTPClient(client *http.Client) *UpdateVSphereCloudAccountParams { - var () return &UpdateVSphereCloudAccountParams{ HTTPClient: client, } } -/*UpdateVSphereCloudAccountParams contains all the parameters to send to the API endpoint -for the update v sphere cloud account operation typically these are written to a http.Request +/* UpdateVSphereCloudAccountParams contains all the parameters to send to the API endpoint + for the update v sphere cloud account operation. + + Typically these are written to a http.Request. */ type UpdateVSphereCloudAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - VSphere cloud account details to be updated + /* Body. + + VSphere cloud account details to be updated */ Body *models.UpdateCloudAccountVsphereSpecification - /*ID - Cloud account id + /* ID. + + Cloud account id */ ID string @@ -83,6 +84,21 @@ type UpdateVSphereCloudAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVSphereCloudAccountParams) WithDefaults() *UpdateVSphereCloudAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update v sphere cloud account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVSphereCloudAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update v sphere cloud account params func (o *UpdateVSphereCloudAccountParams) WithTimeout(timeout time.Duration) *UpdateVSphereCloudAccountParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateVSphereCloudAccountParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/cloud_account/update_vsphere_cloud_account_responses.go b/pkg/client/cloud_account/update_vsphere_cloud_account_responses.go index d0d9e298..d0af78ec 100644 --- a/pkg/client/cloud_account/update_vsphere_cloud_account_responses.go +++ b/pkg/client/cloud_account/update_vsphere_cloud_account_responses.go @@ -41,7 +41,6 @@ func (o *UpdateVSphereCloudAccountReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateVSphereCloudAccountOK() *UpdateVSphereCloudAccountOK { return &UpdateVSphereCloudAccountOK{} } -/*UpdateVSphereCloudAccountOK handles this case with default header values. +/* UpdateVSphereCloudAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateVSphereCloudAccountOK struct { func (o *UpdateVSphereCloudAccountOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vsphere/{id}][%d] updateVSphereCloudAccountOK %+v", 200, o.Payload) } - func (o *UpdateVSphereCloudAccountOK) GetPayload() *models.CloudAccountVsphere { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateVSphereCloudAccountForbidden() *UpdateVSphereCloudAccountForbidden return &UpdateVSphereCloudAccountForbidden{} } -/*UpdateVSphereCloudAccountForbidden handles this case with default header values. +/* UpdateVSphereCloudAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateVSphereCloudAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateVSphereCloudAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vsphere/{id}][%d] updateVSphereCloudAccountForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vsphere/{id}][%d] updateVSphereCloudAccountForbidden %+v", 403, o.Payload) +} +func (o *UpdateVSphereCloudAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateVSphereCloudAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateVSphereCloudAccountNotFound() *UpdateVSphereCloudAccountNotFound { return &UpdateVSphereCloudAccountNotFound{} } -/*UpdateVSphereCloudAccountNotFound handles this case with default header values. +/* UpdateVSphereCloudAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateVSphereCloudAccountNotFound struct { func (o *UpdateVSphereCloudAccountNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/cloud-accounts-vsphere/{id}][%d] updateVSphereCloudAccountNotFound %+v", 404, o.Payload) } - func (o *UpdateVSphereCloudAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/compute_client.go b/pkg/client/compute/compute_client.go index 419e1a77..59c85ac2 100644 --- a/pkg/client/compute/compute_client.go +++ b/pkg/client/compute/compute_client.go @@ -25,43 +25,46 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateMachine(params *CreateMachineParams) (*CreateMachineAccepted, error) + CreateMachine(params *CreateMachineParams, opts ...ClientOption) (*CreateMachineAccepted, error) - CreateMachineSnapshot(params *CreateMachineSnapshotParams) (*CreateMachineSnapshotAccepted, error) + CreateMachineSnapshot(params *CreateMachineSnapshotParams, opts ...ClientOption) (*CreateMachineSnapshotAccepted, error) - DeleteMachine(params *DeleteMachineParams) (*DeleteMachineAccepted, error) + DeleteMachine(params *DeleteMachineParams, opts ...ClientOption) (*DeleteMachineAccepted, error) - DeleteMachineSnapshot(params *DeleteMachineSnapshotParams) (*DeleteMachineSnapshotAccepted, error) + DeleteMachineSnapshot(params *DeleteMachineSnapshotParams, opts ...ClientOption) (*DeleteMachineSnapshotAccepted, error) - GetMachine(params *GetMachineParams) (*GetMachineOK, error) + GetMachine(params *GetMachineParams, opts ...ClientOption) (*GetMachineOK, error) - GetMachineSnapshot(params *GetMachineSnapshotParams) (*GetMachineSnapshotOK, error) + GetMachineSnapshot(params *GetMachineSnapshotParams, opts ...ClientOption) (*GetMachineSnapshotOK, error) - GetMachineSnapshots(params *GetMachineSnapshotsParams) (*GetMachineSnapshotsOK, error) + GetMachineSnapshots(params *GetMachineSnapshotsParams, opts ...ClientOption) (*GetMachineSnapshotsOK, error) - GetMachines(params *GetMachinesParams) (*GetMachinesOK, error) + GetMachines(params *GetMachinesParams, opts ...ClientOption) (*GetMachinesOK, error) - PowerOffMachine(params *PowerOffMachineParams) (*PowerOffMachineAccepted, error) + PowerOffMachine(params *PowerOffMachineParams, opts ...ClientOption) (*PowerOffMachineAccepted, error) - PowerOnMachine(params *PowerOnMachineParams) (*PowerOnMachineAccepted, error) + PowerOnMachine(params *PowerOnMachineParams, opts ...ClientOption) (*PowerOnMachineAccepted, error) - RebootMachine(params *RebootMachineParams) (*RebootMachineAccepted, error) + RebootMachine(params *RebootMachineParams, opts ...ClientOption) (*RebootMachineAccepted, error) - ResetMachine(params *ResetMachineParams) (*ResetMachineAccepted, error) + ResetMachine(params *ResetMachineParams, opts ...ClientOption) (*ResetMachineAccepted, error) - ResizeMachine(params *ResizeMachineParams) (*ResizeMachineAccepted, error) + ResizeMachine(params *ResizeMachineParams, opts ...ClientOption) (*ResizeMachineAccepted, error) - RestartMachine(params *RestartMachineParams) (*RestartMachineAccepted, error) + RestartMachine(params *RestartMachineParams, opts ...ClientOption) (*RestartMachineAccepted, error) - RevertMachineSnapshot(params *RevertMachineSnapshotParams) (*RevertMachineSnapshotAccepted, error) + RevertMachineSnapshot(params *RevertMachineSnapshotParams, opts ...ClientOption) (*RevertMachineSnapshotAccepted, error) - ShutdownMachine(params *ShutdownMachineParams) (*ShutdownMachineAccepted, error) + ShutdownMachine(params *ShutdownMachineParams, opts ...ClientOption) (*ShutdownMachineAccepted, error) - SuspendMachine(params *SuspendMachineParams) (*SuspendMachineAccepted, error) + SuspendMachine(params *SuspendMachineParams, opts ...ClientOption) (*SuspendMachineAccepted, error) - UpdateMachine(params *UpdateMachineParams) (*UpdateMachineOK, error) + UpdateMachine(params *UpdateMachineParams, opts ...ClientOption) (*UpdateMachineOK, error) SetTransport(transport runtime.ClientTransport) } @@ -71,13 +74,12 @@ type ClientService interface { Create machine */ -func (a *Client) CreateMachine(params *CreateMachineParams) (*CreateMachineAccepted, error) { +func (a *Client) CreateMachine(params *CreateMachineParams, opts ...ClientOption) (*CreateMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createMachine", Method: "POST", PathPattern: "/iaas/api/machines", @@ -88,7 +90,12 @@ func (a *Client) CreateMachine(params *CreateMachineParams) (*CreateMachineAccep Reader: &CreateMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -107,13 +114,12 @@ func (a *Client) CreateMachine(params *CreateMachineParams) (*CreateMachineAccep Second day create snapshot operation for machine */ -func (a *Client) CreateMachineSnapshot(params *CreateMachineSnapshotParams) (*CreateMachineSnapshotAccepted, error) { +func (a *Client) CreateMachineSnapshot(params *CreateMachineSnapshotParams, opts ...ClientOption) (*CreateMachineSnapshotAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateMachineSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createMachineSnapshot", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/snapshots", @@ -124,7 +130,12 @@ func (a *Client) CreateMachineSnapshot(params *CreateMachineSnapshotParams) (*Cr Reader: &CreateMachineSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -143,13 +154,12 @@ func (a *Client) CreateMachineSnapshot(params *CreateMachineSnapshotParams) (*Cr Delete Machine with a given id */ -func (a *Client) DeleteMachine(params *DeleteMachineParams) (*DeleteMachineAccepted, error) { +func (a *Client) DeleteMachine(params *DeleteMachineParams, opts ...ClientOption) (*DeleteMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteMachine", Method: "DELETE", PathPattern: "/iaas/api/machines/{id}", @@ -160,7 +170,12 @@ func (a *Client) DeleteMachine(params *DeleteMachineParams) (*DeleteMachineAccep Reader: &DeleteMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -179,13 +194,12 @@ func (a *Client) DeleteMachine(params *DeleteMachineParams) (*DeleteMachineAccep Second day delete snapshot operation for machine */ -func (a *Client) DeleteMachineSnapshot(params *DeleteMachineSnapshotParams) (*DeleteMachineSnapshotAccepted, error) { +func (a *Client) DeleteMachineSnapshot(params *DeleteMachineSnapshotParams, opts ...ClientOption) (*DeleteMachineSnapshotAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteMachineSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteMachineSnapshot", Method: "DELETE", PathPattern: "/iaas/api/machines/{id}/snapshots/{id1}", @@ -196,7 +210,12 @@ func (a *Client) DeleteMachineSnapshot(params *DeleteMachineSnapshotParams) (*De Reader: &DeleteMachineSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -215,13 +234,12 @@ func (a *Client) DeleteMachineSnapshot(params *DeleteMachineSnapshotParams) (*De Get machine with a given id */ -func (a *Client) GetMachine(params *GetMachineParams) (*GetMachineOK, error) { +func (a *Client) GetMachine(params *GetMachineParams, opts ...ClientOption) (*GetMachineOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachine", Method: "GET", PathPattern: "/iaas/api/machines/{id}", @@ -232,7 +250,12 @@ func (a *Client) GetMachine(params *GetMachineParams) (*GetMachineOK, error) { Reader: &GetMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -251,13 +274,12 @@ func (a *Client) GetMachine(params *GetMachineParams) (*GetMachineOK, error) { Get snapshot with a given id for specific machine */ -func (a *Client) GetMachineSnapshot(params *GetMachineSnapshotParams) (*GetMachineSnapshotOK, error) { +func (a *Client) GetMachineSnapshot(params *GetMachineSnapshotParams, opts ...ClientOption) (*GetMachineSnapshotOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachineSnapshot", Method: "GET", PathPattern: "/iaas/api/machines/{id}/snapshots/{id1}", @@ -268,7 +290,12 @@ func (a *Client) GetMachineSnapshot(params *GetMachineSnapshotParams) (*GetMachi Reader: &GetMachineSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -287,13 +314,12 @@ func (a *Client) GetMachineSnapshot(params *GetMachineSnapshotParams) (*GetMachi Get machine snapshots information */ -func (a *Client) GetMachineSnapshots(params *GetMachineSnapshotsParams) (*GetMachineSnapshotsOK, error) { +func (a *Client) GetMachineSnapshots(params *GetMachineSnapshotsParams, opts ...ClientOption) (*GetMachineSnapshotsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineSnapshotsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachineSnapshots", Method: "GET", PathPattern: "/iaas/api/machines/{id}/snapshots", @@ -304,7 +330,12 @@ func (a *Client) GetMachineSnapshots(params *GetMachineSnapshotsParams) (*GetMac Reader: &GetMachineSnapshotsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -323,13 +354,12 @@ func (a *Client) GetMachineSnapshots(params *GetMachineSnapshotsParams) (*GetMac Get all machines */ -func (a *Client) GetMachines(params *GetMachinesParams) (*GetMachinesOK, error) { +func (a *Client) GetMachines(params *GetMachinesParams, opts ...ClientOption) (*GetMachinesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachinesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachines", Method: "GET", PathPattern: "/iaas/api/machines", @@ -340,7 +370,12 @@ func (a *Client) GetMachines(params *GetMachinesParams) (*GetMachinesOK, error) Reader: &GetMachinesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -359,13 +394,12 @@ func (a *Client) GetMachines(params *GetMachinesParams) (*GetMachinesOK, error) Second day power-off operation for machine */ -func (a *Client) PowerOffMachine(params *PowerOffMachineParams) (*PowerOffMachineAccepted, error) { +func (a *Client) PowerOffMachine(params *PowerOffMachineParams, opts ...ClientOption) (*PowerOffMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPowerOffMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "powerOffMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/power-off", @@ -376,7 +410,12 @@ func (a *Client) PowerOffMachine(params *PowerOffMachineParams) (*PowerOffMachin Reader: &PowerOffMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -395,13 +434,12 @@ func (a *Client) PowerOffMachine(params *PowerOffMachineParams) (*PowerOffMachin Second day power-on operation for machine */ -func (a *Client) PowerOnMachine(params *PowerOnMachineParams) (*PowerOnMachineAccepted, error) { +func (a *Client) PowerOnMachine(params *PowerOnMachineParams, opts ...ClientOption) (*PowerOnMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPowerOnMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "powerOnMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/power-on", @@ -412,7 +450,12 @@ func (a *Client) PowerOnMachine(params *PowerOnMachineParams) (*PowerOnMachineAc Reader: &PowerOnMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -431,13 +474,12 @@ func (a *Client) PowerOnMachine(params *PowerOnMachineParams) (*PowerOnMachineAc Second day reboot operation for machine */ -func (a *Client) RebootMachine(params *RebootMachineParams) (*RebootMachineAccepted, error) { +func (a *Client) RebootMachine(params *RebootMachineParams, opts ...ClientOption) (*RebootMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewRebootMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "rebootMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/reboot", @@ -448,7 +490,12 @@ func (a *Client) RebootMachine(params *RebootMachineParams) (*RebootMachineAccep Reader: &RebootMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -467,13 +514,12 @@ func (a *Client) RebootMachine(params *RebootMachineParams) (*RebootMachineAccep Second day reset operation for machine */ -func (a *Client) ResetMachine(params *ResetMachineParams) (*ResetMachineAccepted, error) { +func (a *Client) ResetMachine(params *ResetMachineParams, opts ...ClientOption) (*ResetMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewResetMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "resetMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/reset", @@ -484,7 +530,12 @@ func (a *Client) ResetMachine(params *ResetMachineParams) (*ResetMachineAccepted Reader: &ResetMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -503,13 +554,12 @@ func (a *Client) ResetMachine(params *ResetMachineParams) (*ResetMachineAccepted Second day resize operation for machine */ -func (a *Client) ResizeMachine(params *ResizeMachineParams) (*ResizeMachineAccepted, error) { +func (a *Client) ResizeMachine(params *ResizeMachineParams, opts ...ClientOption) (*ResizeMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewResizeMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "resizeMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/resize", @@ -520,7 +570,12 @@ func (a *Client) ResizeMachine(params *ResizeMachineParams) (*ResizeMachineAccep Reader: &ResizeMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -539,13 +594,12 @@ func (a *Client) ResizeMachine(params *ResizeMachineParams) (*ResizeMachineAccep Second day restart operation for machine */ -func (a *Client) RestartMachine(params *RestartMachineParams) (*RestartMachineAccepted, error) { +func (a *Client) RestartMachine(params *RestartMachineParams, opts ...ClientOption) (*RestartMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewRestartMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "restartMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/restart", @@ -556,7 +610,12 @@ func (a *Client) RestartMachine(params *RestartMachineParams) (*RestartMachineAc Reader: &RestartMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -575,13 +634,12 @@ func (a *Client) RestartMachine(params *RestartMachineParams) (*RestartMachineAc Second day revert snapshot operation for machine */ -func (a *Client) RevertMachineSnapshot(params *RevertMachineSnapshotParams) (*RevertMachineSnapshotAccepted, error) { +func (a *Client) RevertMachineSnapshot(params *RevertMachineSnapshotParams, opts ...ClientOption) (*RevertMachineSnapshotAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewRevertMachineSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "revertMachineSnapshot", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/revert", @@ -592,7 +650,12 @@ func (a *Client) RevertMachineSnapshot(params *RevertMachineSnapshotParams) (*Re Reader: &RevertMachineSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -611,13 +674,12 @@ func (a *Client) RevertMachineSnapshot(params *RevertMachineSnapshotParams) (*Re Second day shut down operation machine */ -func (a *Client) ShutdownMachine(params *ShutdownMachineParams) (*ShutdownMachineAccepted, error) { +func (a *Client) ShutdownMachine(params *ShutdownMachineParams, opts ...ClientOption) (*ShutdownMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewShutdownMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "shutdownMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/shutdown", @@ -628,7 +690,12 @@ func (a *Client) ShutdownMachine(params *ShutdownMachineParams) (*ShutdownMachin Reader: &ShutdownMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -647,13 +714,12 @@ func (a *Client) ShutdownMachine(params *ShutdownMachineParams) (*ShutdownMachin Second day suspend operation for machine */ -func (a *Client) SuspendMachine(params *SuspendMachineParams) (*SuspendMachineAccepted, error) { +func (a *Client) SuspendMachine(params *SuspendMachineParams, opts ...ClientOption) (*SuspendMachineAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewSuspendMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "suspendMachine", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/suspend", @@ -664,7 +730,12 @@ func (a *Client) SuspendMachine(params *SuspendMachineParams) (*SuspendMachineAc Reader: &SuspendMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -683,13 +754,12 @@ func (a *Client) SuspendMachine(params *SuspendMachineParams) (*SuspendMachineAc Update machine. Only description, tag and custom property updates are supported. All other properties in the MachineSpecification body are ignored. */ -func (a *Client) UpdateMachine(params *UpdateMachineParams) (*UpdateMachineOK, error) { +func (a *Client) UpdateMachine(params *UpdateMachineParams, opts ...ClientOption) (*UpdateMachineOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateMachineParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateMachine", Method: "PATCH", PathPattern: "/iaas/api/machines/{id}", @@ -700,7 +770,12 @@ func (a *Client) UpdateMachine(params *UpdateMachineParams) (*UpdateMachineOK, e Reader: &UpdateMachineReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/compute/create_machine_parameters.go b/pkg/client/compute/create_machine_parameters.go index 0b0a903c..0a8a1cf7 100644 --- a/pkg/client/compute/create_machine_parameters.go +++ b/pkg/client/compute/create_machine_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateMachineParams creates a new CreateMachineParams object -// with the default values initialized. +// NewCreateMachineParams creates a new CreateMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateMachineParams() *CreateMachineParams { - var () return &CreateMachineParams{ - timeout: cr.DefaultTimeout, } } // NewCreateMachineParamsWithTimeout creates a new CreateMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateMachineParamsWithTimeout(timeout time.Duration) *CreateMachineParams { - var () return &CreateMachineParams{ - timeout: timeout, } } // NewCreateMachineParamsWithContext creates a new CreateMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateMachineParamsWithContext(ctx context.Context) *CreateMachineParams { - var () return &CreateMachineParams{ - Context: ctx, } } // NewCreateMachineParamsWithHTTPClient creates a new CreateMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateMachineParamsWithHTTPClient(client *http.Client) *CreateMachineParams { - var () return &CreateMachineParams{ HTTPClient: client, } } -/*CreateMachineParams contains all the parameters to send to the API endpoint -for the create machine operation typically these are written to a http.Request +/* CreateMachineParams contains all the parameters to send to the API endpoint + for the create machine operation. + + Typically these are written to a http.Request. */ type CreateMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Machine Specification instance + /* Body. + + Machine Specification instance */ Body *models.MachineSpecification @@ -78,6 +78,21 @@ type CreateMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMachineParams) WithDefaults() *CreateMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create machine params func (o *CreateMachineParams) WithTimeout(timeout time.Duration) *CreateMachineParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/compute/create_machine_responses.go b/pkg/client/compute/create_machine_responses.go index 5dff86d8..4897600e 100644 --- a/pkg/client/compute/create_machine_responses.go +++ b/pkg/client/compute/create_machine_responses.go @@ -41,7 +41,6 @@ func (o *CreateMachineReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateMachineAccepted() *CreateMachineAccepted { return &CreateMachineAccepted{} } -/*CreateMachineAccepted handles this case with default header values. +/* CreateMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateMachineAccepted struct { func (o *CreateMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines][%d] createMachineAccepted %+v", 202, o.Payload) } - func (o *CreateMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateMachineBadRequest() *CreateMachineBadRequest { return &CreateMachineBadRequest{} } -/*CreateMachineBadRequest handles this case with default header values. +/* CreateMachineBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateMachineBadRequest struct { func (o *CreateMachineBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/machines][%d] createMachineBadRequest %+v", 400, o.Payload) } - func (o *CreateMachineBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateMachineForbidden() *CreateMachineForbidden { return &CreateMachineForbidden{} } -/*CreateMachineForbidden handles this case with default header values. +/* CreateMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines][%d] createMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines][%d] createMachineForbidden %+v", 403, o.Payload) +} +func (o *CreateMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute/create_machine_snapshot_parameters.go b/pkg/client/compute/create_machine_snapshot_parameters.go index 33ee19b2..b6492fb2 100644 --- a/pkg/client/compute/create_machine_snapshot_parameters.go +++ b/pkg/client/compute/create_machine_snapshot_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateMachineSnapshotParams creates a new CreateMachineSnapshotParams object -// with the default values initialized. +// NewCreateMachineSnapshotParams creates a new CreateMachineSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateMachineSnapshotParams() *CreateMachineSnapshotParams { - var () return &CreateMachineSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewCreateMachineSnapshotParamsWithTimeout creates a new CreateMachineSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateMachineSnapshotParamsWithTimeout(timeout time.Duration) *CreateMachineSnapshotParams { - var () return &CreateMachineSnapshotParams{ - timeout: timeout, } } // NewCreateMachineSnapshotParamsWithContext creates a new CreateMachineSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateMachineSnapshotParamsWithContext(ctx context.Context) *CreateMachineSnapshotParams { - var () return &CreateMachineSnapshotParams{ - Context: ctx, } } // NewCreateMachineSnapshotParamsWithHTTPClient creates a new CreateMachineSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateMachineSnapshotParamsWithHTTPClient(client *http.Client) *CreateMachineSnapshotParams { - var () return &CreateMachineSnapshotParams{ HTTPClient: client, } } -/*CreateMachineSnapshotParams contains all the parameters to send to the API endpoint -for the create machine snapshot operation typically these are written to a http.Request +/* CreateMachineSnapshotParams contains all the parameters to send to the API endpoint + for the create machine snapshot operation. + + Typically these are written to a http.Request. */ type CreateMachineSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Snapshot Specification details + /* Body. + + Snapshot Specification details */ Body *models.SnapshotSpecification - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -83,6 +84,21 @@ type CreateMachineSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMachineSnapshotParams) WithDefaults() *CreateMachineSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMachineSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create machine snapshot params func (o *CreateMachineSnapshotParams) WithTimeout(timeout time.Duration) *CreateMachineSnapshotParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *CreateMachineSnapshotParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/compute/create_machine_snapshot_responses.go b/pkg/client/compute/create_machine_snapshot_responses.go index bd25e174..775e2292 100644 --- a/pkg/client/compute/create_machine_snapshot_responses.go +++ b/pkg/client/compute/create_machine_snapshot_responses.go @@ -41,7 +41,6 @@ func (o *CreateMachineSnapshotReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateMachineSnapshotAccepted() *CreateMachineSnapshotAccepted { return &CreateMachineSnapshotAccepted{} } -/*CreateMachineSnapshotAccepted handles this case with default header values. +/* CreateMachineSnapshotAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateMachineSnapshotAccepted struct { func (o *CreateMachineSnapshotAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/snapshots][%d] createMachineSnapshotAccepted %+v", 202, o.Payload) } - func (o *CreateMachineSnapshotAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewCreateMachineSnapshotForbidden() *CreateMachineSnapshotForbidden { return &CreateMachineSnapshotForbidden{} } -/*CreateMachineSnapshotForbidden handles this case with default header values. +/* CreateMachineSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateMachineSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateMachineSnapshotForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/snapshots][%d] createMachineSnapshotForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/snapshots][%d] createMachineSnapshotForbidden %+v", 403, o.Payload) +} +func (o *CreateMachineSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateMachineSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewCreateMachineSnapshotNotFound() *CreateMachineSnapshotNotFound { return &CreateMachineSnapshotNotFound{} } -/*CreateMachineSnapshotNotFound handles this case with default header values. +/* CreateMachineSnapshotNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type CreateMachineSnapshotNotFound struct { func (o *CreateMachineSnapshotNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/snapshots][%d] createMachineSnapshotNotFound %+v", 404, o.Payload) } - func (o *CreateMachineSnapshotNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/delete_machine_parameters.go b/pkg/client/compute/delete_machine_parameters.go index cbd84d52..1fb4eb86 100644 --- a/pkg/client/compute/delete_machine_parameters.go +++ b/pkg/client/compute/delete_machine_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteMachineParams creates a new DeleteMachineParams object -// with the default values initialized. +// NewDeleteMachineParams creates a new DeleteMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteMachineParams() *DeleteMachineParams { - var () return &DeleteMachineParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteMachineParamsWithTimeout creates a new DeleteMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteMachineParamsWithTimeout(timeout time.Duration) *DeleteMachineParams { - var () return &DeleteMachineParams{ - timeout: timeout, } } // NewDeleteMachineParamsWithContext creates a new DeleteMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteMachineParamsWithContext(ctx context.Context) *DeleteMachineParams { - var () return &DeleteMachineParams{ - Context: ctx, } } // NewDeleteMachineParamsWithHTTPClient creates a new DeleteMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteMachineParamsWithHTTPClient(client *http.Client) *DeleteMachineParams { - var () return &DeleteMachineParams{ HTTPClient: client, } } -/*DeleteMachineParams contains all the parameters to send to the API endpoint -for the delete machine operation typically these are written to a http.Request +/* DeleteMachineParams contains all the parameters to send to the API endpoint + for the delete machine operation. + + Typically these are written to a http.Request. */ type DeleteMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this machine. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this machine. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string @@ -82,6 +83,21 @@ type DeleteMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineParams) WithDefaults() *DeleteMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete machine params func (o *DeleteMachineParams) WithTimeout(timeout time.Duration) *DeleteMachineParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/delete_machine_responses.go b/pkg/client/compute/delete_machine_responses.go index 7e87a42d..6180111e 100644 --- a/pkg/client/compute/delete_machine_responses.go +++ b/pkg/client/compute/delete_machine_responses.go @@ -35,7 +35,6 @@ func (o *DeleteMachineReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteMachineAccepted() *DeleteMachineAccepted { return &DeleteMachineAccepted{} } -/*DeleteMachineAccepted handles this case with default header values. +/* DeleteMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteMachineAccepted struct { func (o *DeleteMachineAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/machines/{id}][%d] deleteMachineAccepted %+v", 202, o.Payload) } - func (o *DeleteMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteMachineForbidden() *DeleteMachineForbidden { return &DeleteMachineForbidden{} } -/*DeleteMachineForbidden handles this case with default header values. +/* DeleteMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteMachineForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/machines/{id}][%d] deleteMachineForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/machines/{id}][%d] deleteMachineForbidden %+v", 403, o.Payload) +} +func (o *DeleteMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute/delete_machine_snapshot_parameters.go b/pkg/client/compute/delete_machine_snapshot_parameters.go index 072fe103..a59ec4dc 100644 --- a/pkg/client/compute/delete_machine_snapshot_parameters.go +++ b/pkg/client/compute/delete_machine_snapshot_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteMachineSnapshotParams creates a new DeleteMachineSnapshotParams object -// with the default values initialized. +// NewDeleteMachineSnapshotParams creates a new DeleteMachineSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteMachineSnapshotParams() *DeleteMachineSnapshotParams { - var () return &DeleteMachineSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteMachineSnapshotParamsWithTimeout creates a new DeleteMachineSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteMachineSnapshotParamsWithTimeout(timeout time.Duration) *DeleteMachineSnapshotParams { - var () return &DeleteMachineSnapshotParams{ - timeout: timeout, } } // NewDeleteMachineSnapshotParamsWithContext creates a new DeleteMachineSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteMachineSnapshotParamsWithContext(ctx context.Context) *DeleteMachineSnapshotParams { - var () return &DeleteMachineSnapshotParams{ - Context: ctx, } } // NewDeleteMachineSnapshotParamsWithHTTPClient creates a new DeleteMachineSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteMachineSnapshotParamsWithHTTPClient(client *http.Client) *DeleteMachineSnapshotParams { - var () return &DeleteMachineSnapshotParams{ HTTPClient: client, } } -/*DeleteMachineSnapshotParams contains all the parameters to send to the API endpoint -for the delete machine snapshot operation typically these are written to a http.Request +/* DeleteMachineSnapshotParams contains all the parameters to send to the API endpoint + for the delete machine snapshot operation. + + Typically these are written to a http.Request. */ type DeleteMachineSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string - /*Id1 - Snapshot id to delete. + /* Id1. + + Snapshot id to delete. */ Id1 string @@ -81,6 +82,21 @@ type DeleteMachineSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineSnapshotParams) WithDefaults() *DeleteMachineSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete machine snapshot params func (o *DeleteMachineSnapshotParams) WithTimeout(timeout time.Duration) *DeleteMachineSnapshotParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *DeleteMachineSnapshotParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/delete_machine_snapshot_responses.go b/pkg/client/compute/delete_machine_snapshot_responses.go index 03f000b3..9cda9440 100644 --- a/pkg/client/compute/delete_machine_snapshot_responses.go +++ b/pkg/client/compute/delete_machine_snapshot_responses.go @@ -35,7 +35,6 @@ func (o *DeleteMachineSnapshotReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteMachineSnapshotAccepted() *DeleteMachineSnapshotAccepted { return &DeleteMachineSnapshotAccepted{} } -/*DeleteMachineSnapshotAccepted handles this case with default header values. +/* DeleteMachineSnapshotAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteMachineSnapshotAccepted struct { func (o *DeleteMachineSnapshotAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/snapshots/{id1}][%d] deleteMachineSnapshotAccepted %+v", 202, o.Payload) } - func (o *DeleteMachineSnapshotAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteMachineSnapshotForbidden() *DeleteMachineSnapshotForbidden { return &DeleteMachineSnapshotForbidden{} } -/*DeleteMachineSnapshotForbidden handles this case with default header values. +/* DeleteMachineSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteMachineSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteMachineSnapshotForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/snapshots/{id1}][%d] deleteMachineSnapshotForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/snapshots/{id1}][%d] deleteMachineSnapshotForbidden %+v", 403, o.Payload) +} +func (o *DeleteMachineSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteMachineSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute/get_machine_parameters.go b/pkg/client/compute/get_machine_parameters.go index a3bb6c3d..32859bc9 100644 --- a/pkg/client/compute/get_machine_parameters.go +++ b/pkg/client/compute/get_machine_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineParams creates a new GetMachineParams object -// with the default values initialized. +// NewGetMachineParams creates a new GetMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineParams() *GetMachineParams { - var () return &GetMachineParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineParamsWithTimeout creates a new GetMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineParamsWithTimeout(timeout time.Duration) *GetMachineParams { - var () return &GetMachineParams{ - timeout: timeout, } } // NewGetMachineParamsWithContext creates a new GetMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineParamsWithContext(ctx context.Context) *GetMachineParams { - var () return &GetMachineParams{ - Context: ctx, } } // NewGetMachineParamsWithHTTPClient creates a new GetMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineParamsWithHTTPClient(client *http.Client) *GetMachineParams { - var () return &GetMachineParams{ HTTPClient: client, } } -/*GetMachineParams contains all the parameters to send to the API endpoint -for the get machine operation typically these are written to a http.Request +/* GetMachineParams contains all the parameters to send to the API endpoint + for the get machine operation. + + Typically these are written to a http.Request. */ type GetMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string @@ -76,6 +82,21 @@ type GetMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineParams) WithDefaults() *GetMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine params func (o *GetMachineParams) WithTimeout(timeout time.Duration) *GetMachineParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetMachineParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get machine params +func (o *GetMachineParams) WithDollarSelect(dollarSelect *string) *GetMachineParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get machine params +func (o *GetMachineParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get machine params func (o *GetMachineParams) WithAPIVersion(aPIVersion *string) *GetMachineParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/get_machine_responses.go b/pkg/client/compute/get_machine_responses.go index bcdfa269..545d41d0 100644 --- a/pkg/client/compute/get_machine_responses.go +++ b/pkg/client/compute/get_machine_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineOK() *GetMachineOK { return &GetMachineOK{} } -/*GetMachineOK handles this case with default header values. +/* GetMachineOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineOK struct { func (o *GetMachineOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}][%d] getMachineOK %+v", 200, o.Payload) } - func (o *GetMachineOK) GetPayload() *models.Machine { return o.Payload } @@ -85,19 +83,30 @@ func NewGetMachineForbidden() *GetMachineForbidden { return &GetMachineForbidden{} } -/*GetMachineForbidden handles this case with default header values. +/* GetMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}][%d] getMachineForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}][%d] getMachineForbidden %+v", 403, o.Payload) +} +func (o *GetMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetMachineNotFound() *GetMachineNotFound { return &GetMachineNotFound{} } -/*GetMachineNotFound handles this case with default header values. +/* GetMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetMachineNotFound struct { func (o *GetMachineNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}][%d] getMachineNotFound %+v", 404, o.Payload) } - func (o *GetMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/get_machine_snapshot_parameters.go b/pkg/client/compute/get_machine_snapshot_parameters.go index 5bd6ae7a..b2632157 100644 --- a/pkg/client/compute/get_machine_snapshot_parameters.go +++ b/pkg/client/compute/get_machine_snapshot_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineSnapshotParams creates a new GetMachineSnapshotParams object -// with the default values initialized. +// NewGetMachineSnapshotParams creates a new GetMachineSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineSnapshotParams() *GetMachineSnapshotParams { - var () return &GetMachineSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineSnapshotParamsWithTimeout creates a new GetMachineSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineSnapshotParamsWithTimeout(timeout time.Duration) *GetMachineSnapshotParams { - var () return &GetMachineSnapshotParams{ - timeout: timeout, } } // NewGetMachineSnapshotParamsWithContext creates a new GetMachineSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineSnapshotParamsWithContext(ctx context.Context) *GetMachineSnapshotParams { - var () return &GetMachineSnapshotParams{ - Context: ctx, } } // NewGetMachineSnapshotParamsWithHTTPClient creates a new GetMachineSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineSnapshotParamsWithHTTPClient(client *http.Client) *GetMachineSnapshotParams { - var () return &GetMachineSnapshotParams{ HTTPClient: client, } } -/*GetMachineSnapshotParams contains all the parameters to send to the API endpoint -for the get machine snapshot operation typically these are written to a http.Request +/* GetMachineSnapshotParams contains all the parameters to send to the API endpoint + for the get machine snapshot operation. + + Typically these are written to a http.Request. */ type GetMachineSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string - /*Id1 - The ID of the snapshot. + /* Id1. + + The ID of the snapshot. */ Id1 string @@ -81,6 +82,21 @@ type GetMachineSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineSnapshotParams) WithDefaults() *GetMachineSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine snapshot params func (o *GetMachineSnapshotParams) WithTimeout(timeout time.Duration) *GetMachineSnapshotParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetMachineSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/get_machine_snapshot_responses.go b/pkg/client/compute/get_machine_snapshot_responses.go index 00f76726..50f64bf6 100644 --- a/pkg/client/compute/get_machine_snapshot_responses.go +++ b/pkg/client/compute/get_machine_snapshot_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineSnapshotReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineSnapshotOK() *GetMachineSnapshotOK { return &GetMachineSnapshotOK{} } -/*GetMachineSnapshotOK handles this case with default header values. +/* GetMachineSnapshotOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineSnapshotOK struct { func (o *GetMachineSnapshotOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots/{id1}][%d] getMachineSnapshotOK %+v", 200, o.Payload) } - func (o *GetMachineSnapshotOK) GetPayload() *models.BlockDevice { return o.Payload } @@ -85,19 +83,30 @@ func NewGetMachineSnapshotForbidden() *GetMachineSnapshotForbidden { return &GetMachineSnapshotForbidden{} } -/*GetMachineSnapshotForbidden handles this case with default header values. +/* GetMachineSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineSnapshotForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots/{id1}][%d] getMachineSnapshotForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots/{id1}][%d] getMachineSnapshotForbidden %+v", 403, o.Payload) +} +func (o *GetMachineSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetMachineSnapshotNotFound() *GetMachineSnapshotNotFound { return &GetMachineSnapshotNotFound{} } -/*GetMachineSnapshotNotFound handles this case with default header values. +/* GetMachineSnapshotNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetMachineSnapshotNotFound struct { func (o *GetMachineSnapshotNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots/{id1}][%d] getMachineSnapshotNotFound %+v", 404, o.Payload) } - func (o *GetMachineSnapshotNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/get_machine_snapshots_parameters.go b/pkg/client/compute/get_machine_snapshots_parameters.go index 65fd578c..a1bbe9f6 100644 --- a/pkg/client/compute/get_machine_snapshots_parameters.go +++ b/pkg/client/compute/get_machine_snapshots_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineSnapshotsParams creates a new GetMachineSnapshotsParams object -// with the default values initialized. +// NewGetMachineSnapshotsParams creates a new GetMachineSnapshotsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineSnapshotsParams() *GetMachineSnapshotsParams { - var () return &GetMachineSnapshotsParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineSnapshotsParamsWithTimeout creates a new GetMachineSnapshotsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineSnapshotsParamsWithTimeout(timeout time.Duration) *GetMachineSnapshotsParams { - var () return &GetMachineSnapshotsParams{ - timeout: timeout, } } // NewGetMachineSnapshotsParamsWithContext creates a new GetMachineSnapshotsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineSnapshotsParamsWithContext(ctx context.Context) *GetMachineSnapshotsParams { - var () return &GetMachineSnapshotsParams{ - Context: ctx, } } // NewGetMachineSnapshotsParamsWithHTTPClient creates a new GetMachineSnapshotsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineSnapshotsParamsWithHTTPClient(client *http.Client) *GetMachineSnapshotsParams { - var () return &GetMachineSnapshotsParams{ HTTPClient: client, } } -/*GetMachineSnapshotsParams contains all the parameters to send to the API endpoint -for the get machine snapshots operation typically these are written to a http.Request +/* GetMachineSnapshotsParams contains all the parameters to send to the API endpoint + for the get machine snapshots operation. + + Typically these are written to a http.Request. */ type GetMachineSnapshotsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string @@ -76,6 +76,21 @@ type GetMachineSnapshotsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine snapshots params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineSnapshotsParams) WithDefaults() *GetMachineSnapshotsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine snapshots params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineSnapshotsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine snapshots params func (o *GetMachineSnapshotsParams) WithTimeout(timeout time.Duration) *GetMachineSnapshotsParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetMachineSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/get_machine_snapshots_responses.go b/pkg/client/compute/get_machine_snapshots_responses.go index 615965c0..4bcdca1f 100644 --- a/pkg/client/compute/get_machine_snapshots_responses.go +++ b/pkg/client/compute/get_machine_snapshots_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineSnapshotsReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineSnapshotsOK() *GetMachineSnapshotsOK { return &GetMachineSnapshotsOK{} } -/*GetMachineSnapshotsOK handles this case with default header values. +/* GetMachineSnapshotsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineSnapshotsOK struct { func (o *GetMachineSnapshotsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots][%d] getMachineSnapshotsOK %+v", 200, o.Payload) } - func (o *GetMachineSnapshotsOK) GetPayload() []*models.Snapshot { return o.Payload } @@ -83,19 +81,30 @@ func NewGetMachineSnapshotsForbidden() *GetMachineSnapshotsForbidden { return &GetMachineSnapshotsForbidden{} } -/*GetMachineSnapshotsForbidden handles this case with default header values. +/* GetMachineSnapshotsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineSnapshotsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineSnapshotsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots][%d] getMachineSnapshotsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots][%d] getMachineSnapshotsForbidden %+v", 403, o.Payload) +} +func (o *GetMachineSnapshotsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineSnapshotsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -104,7 +113,7 @@ func NewGetMachineSnapshotsNotFound() *GetMachineSnapshotsNotFound { return &GetMachineSnapshotsNotFound{} } -/*GetMachineSnapshotsNotFound handles this case with default header values. +/* GetMachineSnapshotsNotFound describes a response with status code 404, with default header values. Not Found */ @@ -115,7 +124,6 @@ type GetMachineSnapshotsNotFound struct { func (o *GetMachineSnapshotsNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/snapshots][%d] getMachineSnapshotsNotFound %+v", 404, o.Payload) } - func (o *GetMachineSnapshotsNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/get_machines_parameters.go b/pkg/client/compute/get_machines_parameters.go index 8f24c7ad..9630c21a 100644 --- a/pkg/client/compute/get_machines_parameters.go +++ b/pkg/client/compute/get_machines_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetMachinesParams creates a new GetMachinesParams object -// with the default values initialized. +// NewGetMachinesParams creates a new GetMachinesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachinesParams() *GetMachinesParams { - var () return &GetMachinesParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachinesParamsWithTimeout creates a new GetMachinesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachinesParamsWithTimeout(timeout time.Duration) *GetMachinesParams { - var () return &GetMachinesParams{ - timeout: timeout, } } // NewGetMachinesParamsWithContext creates a new GetMachinesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachinesParamsWithContext(ctx context.Context) *GetMachinesParams { - var () return &GetMachinesParams{ - Context: ctx, } } // NewGetMachinesParamsWithHTTPClient creates a new GetMachinesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachinesParamsWithHTTPClient(client *http.Client) *GetMachinesParams { - var () return &GetMachinesParams{ HTTPClient: client, } } -/*GetMachinesParams contains all the parameters to send to the API endpoint -for the get machines operation typically these are written to a http.Request +/* GetMachinesParams contains all the parameters to send to the API endpoint + for the get machines operation. + + Typically these are written to a http.Request. */ type GetMachinesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetMachinesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machines params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachinesParams) WithDefaults() *GetMachinesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machines params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachinesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machines params func (o *GetMachinesParams) WithTimeout(timeout time.Duration) *GetMachinesParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetMachinesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get machines params +func (o *GetMachinesParams) WithDollarCount(dollarCount *bool) *GetMachinesParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get machines params +func (o *GetMachinesParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get machines params func (o *GetMachinesParams) WithDollarFilter(dollarFilter *string) *GetMachinesParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetMachinesParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get machines params +func (o *GetMachinesParams) WithDollarSelect(dollarSelect *string) *GetMachinesParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get machines params +func (o *GetMachinesParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get machines params +func (o *GetMachinesParams) WithDollarSkip(dollarSkip *int64) *GetMachinesParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get machines params +func (o *GetMachinesParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get machines params +func (o *GetMachinesParams) WithDollarTop(dollarTop *int64) *GetMachinesParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get machines params +func (o *GetMachinesParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get machines params func (o *GetMachinesParams) WithAPIVersion(aPIVersion *string) *GetMachinesParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetMachinesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/compute/get_machines_responses.go b/pkg/client/compute/get_machines_responses.go index 2265a13b..9418790b 100644 --- a/pkg/client/compute/get_machines_responses.go +++ b/pkg/client/compute/get_machines_responses.go @@ -35,7 +35,6 @@ func (o *GetMachinesReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetMachinesOK() *GetMachinesOK { return &GetMachinesOK{} } -/*GetMachinesOK handles this case with default header values. +/* GetMachinesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetMachinesOK struct { func (o *GetMachinesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines][%d] getMachinesOK %+v", 200, o.Payload) } - func (o *GetMachinesOK) GetPayload() *models.MachineResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetMachinesForbidden() *GetMachinesForbidden { return &GetMachinesForbidden{} } -/*GetMachinesForbidden handles this case with default header values. +/* GetMachinesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachinesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachinesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines][%d] getMachinesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines][%d] getMachinesForbidden %+v", 403, o.Payload) +} +func (o *GetMachinesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachinesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute/power_off_machine_parameters.go b/pkg/client/compute/power_off_machine_parameters.go index fb609342..0effb8d5 100644 --- a/pkg/client/compute/power_off_machine_parameters.go +++ b/pkg/client/compute/power_off_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPowerOffMachineParams creates a new PowerOffMachineParams object -// with the default values initialized. +// NewPowerOffMachineParams creates a new PowerOffMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPowerOffMachineParams() *PowerOffMachineParams { - var () return &PowerOffMachineParams{ - timeout: cr.DefaultTimeout, } } // NewPowerOffMachineParamsWithTimeout creates a new PowerOffMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPowerOffMachineParamsWithTimeout(timeout time.Duration) *PowerOffMachineParams { - var () return &PowerOffMachineParams{ - timeout: timeout, } } // NewPowerOffMachineParamsWithContext creates a new PowerOffMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPowerOffMachineParamsWithContext(ctx context.Context) *PowerOffMachineParams { - var () return &PowerOffMachineParams{ - Context: ctx, } } // NewPowerOffMachineParamsWithHTTPClient creates a new PowerOffMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPowerOffMachineParamsWithHTTPClient(client *http.Client) *PowerOffMachineParams { - var () return &PowerOffMachineParams{ HTTPClient: client, } } -/*PowerOffMachineParams contains all the parameters to send to the API endpoint -for the power off machine operation typically these are written to a http.Request +/* PowerOffMachineParams contains all the parameters to send to the API endpoint + for the power off machine operation. + + Typically these are written to a http.Request. */ type PowerOffMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type PowerOffMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the power off machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PowerOffMachineParams) WithDefaults() *PowerOffMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the power off machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PowerOffMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the power off machine params func (o *PowerOffMachineParams) WithTimeout(timeout time.Duration) *PowerOffMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *PowerOffMachineParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/power_off_machine_responses.go b/pkg/client/compute/power_off_machine_responses.go index edcdd797..c3152d9b 100644 --- a/pkg/client/compute/power_off_machine_responses.go +++ b/pkg/client/compute/power_off_machine_responses.go @@ -41,7 +41,6 @@ func (o *PowerOffMachineReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewPowerOffMachineAccepted() *PowerOffMachineAccepted { return &PowerOffMachineAccepted{} } -/*PowerOffMachineAccepted handles this case with default header values. +/* PowerOffMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type PowerOffMachineAccepted struct { func (o *PowerOffMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-off][%d] powerOffMachineAccepted %+v", 202, o.Payload) } - func (o *PowerOffMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewPowerOffMachineForbidden() *PowerOffMachineForbidden { return &PowerOffMachineForbidden{} } -/*PowerOffMachineForbidden handles this case with default header values. +/* PowerOffMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type PowerOffMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *PowerOffMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-off][%d] powerOffMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-off][%d] powerOffMachineForbidden %+v", 403, o.Payload) +} +func (o *PowerOffMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *PowerOffMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewPowerOffMachineNotFound() *PowerOffMachineNotFound { return &PowerOffMachineNotFound{} } -/*PowerOffMachineNotFound handles this case with default header values. +/* PowerOffMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type PowerOffMachineNotFound struct { func (o *PowerOffMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-off][%d] powerOffMachineNotFound %+v", 404, o.Payload) } - func (o *PowerOffMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/power_on_machine_parameters.go b/pkg/client/compute/power_on_machine_parameters.go index 39800aca..ea89aaea 100644 --- a/pkg/client/compute/power_on_machine_parameters.go +++ b/pkg/client/compute/power_on_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPowerOnMachineParams creates a new PowerOnMachineParams object -// with the default values initialized. +// NewPowerOnMachineParams creates a new PowerOnMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPowerOnMachineParams() *PowerOnMachineParams { - var () return &PowerOnMachineParams{ - timeout: cr.DefaultTimeout, } } // NewPowerOnMachineParamsWithTimeout creates a new PowerOnMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPowerOnMachineParamsWithTimeout(timeout time.Duration) *PowerOnMachineParams { - var () return &PowerOnMachineParams{ - timeout: timeout, } } // NewPowerOnMachineParamsWithContext creates a new PowerOnMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPowerOnMachineParamsWithContext(ctx context.Context) *PowerOnMachineParams { - var () return &PowerOnMachineParams{ - Context: ctx, } } // NewPowerOnMachineParamsWithHTTPClient creates a new PowerOnMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPowerOnMachineParamsWithHTTPClient(client *http.Client) *PowerOnMachineParams { - var () return &PowerOnMachineParams{ HTTPClient: client, } } -/*PowerOnMachineParams contains all the parameters to send to the API endpoint -for the power on machine operation typically these are written to a http.Request +/* PowerOnMachineParams contains all the parameters to send to the API endpoint + for the power on machine operation. + + Typically these are written to a http.Request. */ type PowerOnMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type PowerOnMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the power on machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PowerOnMachineParams) WithDefaults() *PowerOnMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the power on machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PowerOnMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the power on machine params func (o *PowerOnMachineParams) WithTimeout(timeout time.Duration) *PowerOnMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *PowerOnMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/power_on_machine_responses.go b/pkg/client/compute/power_on_machine_responses.go index 03d42936..97481591 100644 --- a/pkg/client/compute/power_on_machine_responses.go +++ b/pkg/client/compute/power_on_machine_responses.go @@ -41,7 +41,6 @@ func (o *PowerOnMachineReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewPowerOnMachineAccepted() *PowerOnMachineAccepted { return &PowerOnMachineAccepted{} } -/*PowerOnMachineAccepted handles this case with default header values. +/* PowerOnMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type PowerOnMachineAccepted struct { func (o *PowerOnMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-on][%d] powerOnMachineAccepted %+v", 202, o.Payload) } - func (o *PowerOnMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewPowerOnMachineForbidden() *PowerOnMachineForbidden { return &PowerOnMachineForbidden{} } -/*PowerOnMachineForbidden handles this case with default header values. +/* PowerOnMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type PowerOnMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *PowerOnMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-on][%d] powerOnMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-on][%d] powerOnMachineForbidden %+v", 403, o.Payload) +} +func (o *PowerOnMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *PowerOnMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewPowerOnMachineNotFound() *PowerOnMachineNotFound { return &PowerOnMachineNotFound{} } -/*PowerOnMachineNotFound handles this case with default header values. +/* PowerOnMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type PowerOnMachineNotFound struct { func (o *PowerOnMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/power-on][%d] powerOnMachineNotFound %+v", 404, o.Payload) } - func (o *PowerOnMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/reboot_machine_parameters.go b/pkg/client/compute/reboot_machine_parameters.go index 9f4eb866..a460dd6d 100644 --- a/pkg/client/compute/reboot_machine_parameters.go +++ b/pkg/client/compute/reboot_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRebootMachineParams creates a new RebootMachineParams object -// with the default values initialized. +// NewRebootMachineParams creates a new RebootMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRebootMachineParams() *RebootMachineParams { - var () return &RebootMachineParams{ - timeout: cr.DefaultTimeout, } } // NewRebootMachineParamsWithTimeout creates a new RebootMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRebootMachineParamsWithTimeout(timeout time.Duration) *RebootMachineParams { - var () return &RebootMachineParams{ - timeout: timeout, } } // NewRebootMachineParamsWithContext creates a new RebootMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRebootMachineParamsWithContext(ctx context.Context) *RebootMachineParams { - var () return &RebootMachineParams{ - Context: ctx, } } // NewRebootMachineParamsWithHTTPClient creates a new RebootMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRebootMachineParamsWithHTTPClient(client *http.Client) *RebootMachineParams { - var () return &RebootMachineParams{ HTTPClient: client, } } -/*RebootMachineParams contains all the parameters to send to the API endpoint -for the reboot machine operation typically these are written to a http.Request +/* RebootMachineParams contains all the parameters to send to the API endpoint + for the reboot machine operation. + + Typically these are written to a http.Request. */ type RebootMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type RebootMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the reboot machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebootMachineParams) WithDefaults() *RebootMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reboot machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebootMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the reboot machine params func (o *RebootMachineParams) WithTimeout(timeout time.Duration) *RebootMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *RebootMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/reboot_machine_responses.go b/pkg/client/compute/reboot_machine_responses.go index a537c1ba..2f6ba2b0 100644 --- a/pkg/client/compute/reboot_machine_responses.go +++ b/pkg/client/compute/reboot_machine_responses.go @@ -41,7 +41,6 @@ func (o *RebootMachineReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewRebootMachineAccepted() *RebootMachineAccepted { return &RebootMachineAccepted{} } -/*RebootMachineAccepted handles this case with default header values. +/* RebootMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type RebootMachineAccepted struct { func (o *RebootMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reboot][%d] rebootMachineAccepted %+v", 202, o.Payload) } - func (o *RebootMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewRebootMachineForbidden() *RebootMachineForbidden { return &RebootMachineForbidden{} } -/*RebootMachineForbidden handles this case with default header values. +/* RebootMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type RebootMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *RebootMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reboot][%d] rebootMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reboot][%d] rebootMachineForbidden %+v", 403, o.Payload) +} +func (o *RebootMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *RebootMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewRebootMachineNotFound() *RebootMachineNotFound { return &RebootMachineNotFound{} } -/*RebootMachineNotFound handles this case with default header values. +/* RebootMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type RebootMachineNotFound struct { func (o *RebootMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reboot][%d] rebootMachineNotFound %+v", 404, o.Payload) } - func (o *RebootMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/reset_machine_parameters.go b/pkg/client/compute/reset_machine_parameters.go index bbbfdcc6..04d6f095 100644 --- a/pkg/client/compute/reset_machine_parameters.go +++ b/pkg/client/compute/reset_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewResetMachineParams creates a new ResetMachineParams object -// with the default values initialized. +// NewResetMachineParams creates a new ResetMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewResetMachineParams() *ResetMachineParams { - var () return &ResetMachineParams{ - timeout: cr.DefaultTimeout, } } // NewResetMachineParamsWithTimeout creates a new ResetMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewResetMachineParamsWithTimeout(timeout time.Duration) *ResetMachineParams { - var () return &ResetMachineParams{ - timeout: timeout, } } // NewResetMachineParamsWithContext creates a new ResetMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewResetMachineParamsWithContext(ctx context.Context) *ResetMachineParams { - var () return &ResetMachineParams{ - Context: ctx, } } // NewResetMachineParamsWithHTTPClient creates a new ResetMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewResetMachineParamsWithHTTPClient(client *http.Client) *ResetMachineParams { - var () return &ResetMachineParams{ HTTPClient: client, } } -/*ResetMachineParams contains all the parameters to send to the API endpoint -for the reset machine operation typically these are written to a http.Request +/* ResetMachineParams contains all the parameters to send to the API endpoint + for the reset machine operation. + + Typically these are written to a http.Request. */ type ResetMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type ResetMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the reset machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetMachineParams) WithDefaults() *ResetMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reset machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the reset machine params func (o *ResetMachineParams) WithTimeout(timeout time.Duration) *ResetMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *ResetMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/reset_machine_responses.go b/pkg/client/compute/reset_machine_responses.go index 793cb7c1..5793e8a8 100644 --- a/pkg/client/compute/reset_machine_responses.go +++ b/pkg/client/compute/reset_machine_responses.go @@ -41,7 +41,6 @@ func (o *ResetMachineReader) ReadResponse(response runtime.ClientResponse, consu return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewResetMachineAccepted() *ResetMachineAccepted { return &ResetMachineAccepted{} } -/*ResetMachineAccepted handles this case with default header values. +/* ResetMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ResetMachineAccepted struct { func (o *ResetMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reset][%d] resetMachineAccepted %+v", 202, o.Payload) } - func (o *ResetMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewResetMachineForbidden() *ResetMachineForbidden { return &ResetMachineForbidden{} } -/*ResetMachineForbidden handles this case with default header values. +/* ResetMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type ResetMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ResetMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reset][%d] resetMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reset][%d] resetMachineForbidden %+v", 403, o.Payload) +} +func (o *ResetMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ResetMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewResetMachineNotFound() *ResetMachineNotFound { return &ResetMachineNotFound{} } -/*ResetMachineNotFound handles this case with default header values. +/* ResetMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type ResetMachineNotFound struct { func (o *ResetMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/reset][%d] resetMachineNotFound %+v", 404, o.Payload) } - func (o *ResetMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/resize_machine_parameters.go b/pkg/client/compute/resize_machine_parameters.go index 671b2541..30c4b2e9 100644 --- a/pkg/client/compute/resize_machine_parameters.go +++ b/pkg/client/compute/resize_machine_parameters.go @@ -17,83 +17,88 @@ import ( "github.com/go-openapi/swag" ) -// NewResizeMachineParams creates a new ResizeMachineParams object -// with the default values initialized. +// NewResizeMachineParams creates a new ResizeMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewResizeMachineParams() *ResizeMachineParams { - var () return &ResizeMachineParams{ - timeout: cr.DefaultTimeout, } } // NewResizeMachineParamsWithTimeout creates a new ResizeMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewResizeMachineParamsWithTimeout(timeout time.Duration) *ResizeMachineParams { - var () return &ResizeMachineParams{ - timeout: timeout, } } // NewResizeMachineParamsWithContext creates a new ResizeMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewResizeMachineParamsWithContext(ctx context.Context) *ResizeMachineParams { - var () return &ResizeMachineParams{ - Context: ctx, } } // NewResizeMachineParamsWithHTTPClient creates a new ResizeMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewResizeMachineParamsWithHTTPClient(client *http.Client) *ResizeMachineParams { - var () return &ResizeMachineParams{ HTTPClient: client, } } -/*ResizeMachineParams contains all the parameters to send to the API endpoint -for the resize machine operation typically these are written to a http.Request +/* ResizeMachineParams contains all the parameters to send to the API endpoint + for the resize machine operation. + + Typically these are written to a http.Request. */ type ResizeMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*CoreCount - The desired number of cores per socket to resize the Machine + /* CoreCount. + + The desired number of cores per socket to resize the Machine */ CoreCount *string - /*CPUCount - The desired number of CPUs to resize the Machine + /* CPUCount. + + The desired number of CPUs to resize the Machine */ CPUCount *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string - /*MemoryInMB - The desired memory in MBs to resize the Machine + /* MemoryInMB. + + The desired memory in MBs to resize the Machine */ MemoryInMB *string - /*Name - The desired flavor to resize the Machine. + /* Name. + + The desired flavor to resize the Machine. */ Name *string - /*RebootMachine - Only applicable for vSphere VMs with the Hot Add option enabled. If set to false, VM is resized without reboot. + /* RebootMachine. + + Only applicable for vSphere VMs with the Hot Add option enabled. If set to false, VM is resized without reboot. */ RebootMachine *bool @@ -102,6 +107,21 @@ type ResizeMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the resize machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResizeMachineParams) WithDefaults() *ResizeMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resize machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResizeMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the resize machine params func (o *ResizeMachineParams) WithTimeout(timeout time.Duration) *ResizeMachineParams { o.SetTimeout(timeout) @@ -224,48 +244,51 @@ func (o *ResizeMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.CoreCount != nil { // query param coreCount var qrCoreCount string + if o.CoreCount != nil { qrCoreCount = *o.CoreCount } qCoreCount := qrCoreCount if qCoreCount != "" { + if err := r.SetQueryParam("coreCount", qCoreCount); err != nil { return err } } - } if o.CPUCount != nil { // query param cpuCount var qrCPUCount string + if o.CPUCount != nil { qrCPUCount = *o.CPUCount } qCPUCount := qrCPUCount if qCPUCount != "" { + if err := r.SetQueryParam("cpuCount", qCPUCount); err != nil { return err } } - } // path param id @@ -277,48 +300,51 @@ func (o *ResizeMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param memoryInMB var qrMemoryInMB string + if o.MemoryInMB != nil { qrMemoryInMB = *o.MemoryInMB } qMemoryInMB := qrMemoryInMB if qMemoryInMB != "" { + if err := r.SetQueryParam("memoryInMB", qMemoryInMB); 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.RebootMachine != nil { // query param rebootMachine var qrRebootMachine bool + if o.RebootMachine != nil { qrRebootMachine = *o.RebootMachine } qRebootMachine := swag.FormatBool(qrRebootMachine) if qRebootMachine != "" { + if err := r.SetQueryParam("rebootMachine", qRebootMachine); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/compute/resize_machine_responses.go b/pkg/client/compute/resize_machine_responses.go index b8f0ac80..b13f05c9 100644 --- a/pkg/client/compute/resize_machine_responses.go +++ b/pkg/client/compute/resize_machine_responses.go @@ -41,7 +41,6 @@ func (o *ResizeMachineReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewResizeMachineAccepted() *ResizeMachineAccepted { return &ResizeMachineAccepted{} } -/*ResizeMachineAccepted handles this case with default header values. +/* ResizeMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ResizeMachineAccepted struct { func (o *ResizeMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/resize][%d] resizeMachineAccepted %+v", 202, o.Payload) } - func (o *ResizeMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewResizeMachineForbidden() *ResizeMachineForbidden { return &ResizeMachineForbidden{} } -/*ResizeMachineForbidden handles this case with default header values. +/* ResizeMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type ResizeMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ResizeMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/resize][%d] resizeMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/resize][%d] resizeMachineForbidden %+v", 403, o.Payload) +} +func (o *ResizeMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ResizeMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewResizeMachineNotFound() *ResizeMachineNotFound { return &ResizeMachineNotFound{} } -/*ResizeMachineNotFound handles this case with default header values. +/* ResizeMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type ResizeMachineNotFound struct { func (o *ResizeMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/resize][%d] resizeMachineNotFound %+v", 404, o.Payload) } - func (o *ResizeMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/restart_machine_parameters.go b/pkg/client/compute/restart_machine_parameters.go index f52aab03..2db4f0f4 100644 --- a/pkg/client/compute/restart_machine_parameters.go +++ b/pkg/client/compute/restart_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRestartMachineParams creates a new RestartMachineParams object -// with the default values initialized. +// NewRestartMachineParams creates a new RestartMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRestartMachineParams() *RestartMachineParams { - var () return &RestartMachineParams{ - timeout: cr.DefaultTimeout, } } // NewRestartMachineParamsWithTimeout creates a new RestartMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRestartMachineParamsWithTimeout(timeout time.Duration) *RestartMachineParams { - var () return &RestartMachineParams{ - timeout: timeout, } } // NewRestartMachineParamsWithContext creates a new RestartMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRestartMachineParamsWithContext(ctx context.Context) *RestartMachineParams { - var () return &RestartMachineParams{ - Context: ctx, } } // NewRestartMachineParamsWithHTTPClient creates a new RestartMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRestartMachineParamsWithHTTPClient(client *http.Client) *RestartMachineParams { - var () return &RestartMachineParams{ HTTPClient: client, } } -/*RestartMachineParams contains all the parameters to send to the API endpoint -for the restart machine operation typically these are written to a http.Request +/* RestartMachineParams contains all the parameters to send to the API endpoint + for the restart machine operation. + + Typically these are written to a http.Request. */ type RestartMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type RestartMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the restart machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartMachineParams) WithDefaults() *RestartMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the restart machine params func (o *RestartMachineParams) WithTimeout(timeout time.Duration) *RestartMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *RestartMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/restart_machine_responses.go b/pkg/client/compute/restart_machine_responses.go index c7146039..0b1efe25 100644 --- a/pkg/client/compute/restart_machine_responses.go +++ b/pkg/client/compute/restart_machine_responses.go @@ -41,7 +41,6 @@ func (o *RestartMachineReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewRestartMachineAccepted() *RestartMachineAccepted { return &RestartMachineAccepted{} } -/*RestartMachineAccepted handles this case with default header values. +/* RestartMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type RestartMachineAccepted struct { func (o *RestartMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/restart][%d] restartMachineAccepted %+v", 202, o.Payload) } - func (o *RestartMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewRestartMachineForbidden() *RestartMachineForbidden { return &RestartMachineForbidden{} } -/*RestartMachineForbidden handles this case with default header values. +/* RestartMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type RestartMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *RestartMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/restart][%d] restartMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/restart][%d] restartMachineForbidden %+v", 403, o.Payload) +} +func (o *RestartMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *RestartMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewRestartMachineNotFound() *RestartMachineNotFound { return &RestartMachineNotFound{} } -/*RestartMachineNotFound handles this case with default header values. +/* RestartMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type RestartMachineNotFound struct { func (o *RestartMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/restart][%d] restartMachineNotFound %+v", 404, o.Payload) } - func (o *RestartMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/revert_machine_snapshot_parameters.go b/pkg/client/compute/revert_machine_snapshot_parameters.go index 145bca31..27352596 100644 --- a/pkg/client/compute/revert_machine_snapshot_parameters.go +++ b/pkg/client/compute/revert_machine_snapshot_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevertMachineSnapshotParams creates a new RevertMachineSnapshotParams object -// with the default values initialized. +// NewRevertMachineSnapshotParams creates a new RevertMachineSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRevertMachineSnapshotParams() *RevertMachineSnapshotParams { - var () return &RevertMachineSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewRevertMachineSnapshotParamsWithTimeout creates a new RevertMachineSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRevertMachineSnapshotParamsWithTimeout(timeout time.Duration) *RevertMachineSnapshotParams { - var () return &RevertMachineSnapshotParams{ - timeout: timeout, } } // NewRevertMachineSnapshotParamsWithContext creates a new RevertMachineSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRevertMachineSnapshotParamsWithContext(ctx context.Context) *RevertMachineSnapshotParams { - var () return &RevertMachineSnapshotParams{ - Context: ctx, } } // NewRevertMachineSnapshotParamsWithHTTPClient creates a new RevertMachineSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRevertMachineSnapshotParamsWithHTTPClient(client *http.Client) *RevertMachineSnapshotParams { - var () return &RevertMachineSnapshotParams{ HTTPClient: client, } } -/*RevertMachineSnapshotParams contains all the parameters to send to the API endpoint -for the revert machine snapshot operation typically these are written to a http.Request +/* RevertMachineSnapshotParams contains all the parameters to send to the API endpoint + for the revert machine snapshot operation. + + Typically these are written to a http.Request. */ type RevertMachineSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ PathID string - /*ID - Snapshot id to revert. + /* ID. + + Snapshot id to revert. */ QueryID string @@ -81,6 +82,21 @@ type RevertMachineSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the revert machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertMachineSnapshotParams) WithDefaults() *RevertMachineSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revert machine snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertMachineSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the revert machine snapshot params func (o *RevertMachineSnapshotParams) WithTimeout(timeout time.Duration) *RevertMachineSnapshotParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *RevertMachineSnapshotParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id @@ -180,6 +197,7 @@ func (o *RevertMachineSnapshotParams) WriteToRequest(r runtime.ClientRequest, re qrID := o.QueryID qID := qrID if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/pkg/client/compute/revert_machine_snapshot_responses.go b/pkg/client/compute/revert_machine_snapshot_responses.go index fd6bad95..2433ac59 100644 --- a/pkg/client/compute/revert_machine_snapshot_responses.go +++ b/pkg/client/compute/revert_machine_snapshot_responses.go @@ -41,7 +41,6 @@ func (o *RevertMachineSnapshotReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewRevertMachineSnapshotAccepted() *RevertMachineSnapshotAccepted { return &RevertMachineSnapshotAccepted{} } -/*RevertMachineSnapshotAccepted handles this case with default header values. +/* RevertMachineSnapshotAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type RevertMachineSnapshotAccepted struct { func (o *RevertMachineSnapshotAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/revert][%d] revertMachineSnapshotAccepted %+v", 202, o.Payload) } - func (o *RevertMachineSnapshotAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewRevertMachineSnapshotForbidden() *RevertMachineSnapshotForbidden { return &RevertMachineSnapshotForbidden{} } -/*RevertMachineSnapshotForbidden handles this case with default header values. +/* RevertMachineSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type RevertMachineSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *RevertMachineSnapshotForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/revert][%d] revertMachineSnapshotForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/revert][%d] revertMachineSnapshotForbidden %+v", 403, o.Payload) +} +func (o *RevertMachineSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *RevertMachineSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewRevertMachineSnapshotNotFound() *RevertMachineSnapshotNotFound { return &RevertMachineSnapshotNotFound{} } -/*RevertMachineSnapshotNotFound handles this case with default header values. +/* RevertMachineSnapshotNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type RevertMachineSnapshotNotFound struct { func (o *RevertMachineSnapshotNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/revert][%d] revertMachineSnapshotNotFound %+v", 404, o.Payload) } - func (o *RevertMachineSnapshotNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/shutdown_machine_parameters.go b/pkg/client/compute/shutdown_machine_parameters.go index 1d0747ea..89762d97 100644 --- a/pkg/client/compute/shutdown_machine_parameters.go +++ b/pkg/client/compute/shutdown_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewShutdownMachineParams creates a new ShutdownMachineParams object -// with the default values initialized. +// NewShutdownMachineParams creates a new ShutdownMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewShutdownMachineParams() *ShutdownMachineParams { - var () return &ShutdownMachineParams{ - timeout: cr.DefaultTimeout, } } // NewShutdownMachineParamsWithTimeout creates a new ShutdownMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewShutdownMachineParamsWithTimeout(timeout time.Duration) *ShutdownMachineParams { - var () return &ShutdownMachineParams{ - timeout: timeout, } } // NewShutdownMachineParamsWithContext creates a new ShutdownMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewShutdownMachineParamsWithContext(ctx context.Context) *ShutdownMachineParams { - var () return &ShutdownMachineParams{ - Context: ctx, } } // NewShutdownMachineParamsWithHTTPClient creates a new ShutdownMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewShutdownMachineParamsWithHTTPClient(client *http.Client) *ShutdownMachineParams { - var () return &ShutdownMachineParams{ HTTPClient: client, } } -/*ShutdownMachineParams contains all the parameters to send to the API endpoint -for the shutdown machine operation typically these are written to a http.Request +/* ShutdownMachineParams contains all the parameters to send to the API endpoint + for the shutdown machine operation. + + Typically these are written to a http.Request. */ type ShutdownMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type ShutdownMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the shutdown machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShutdownMachineParams) WithDefaults() *ShutdownMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the shutdown machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShutdownMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the shutdown machine params func (o *ShutdownMachineParams) WithTimeout(timeout time.Duration) *ShutdownMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *ShutdownMachineParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/shutdown_machine_responses.go b/pkg/client/compute/shutdown_machine_responses.go index 745c34eb..9842ea05 100644 --- a/pkg/client/compute/shutdown_machine_responses.go +++ b/pkg/client/compute/shutdown_machine_responses.go @@ -41,7 +41,6 @@ func (o *ShutdownMachineReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewShutdownMachineAccepted() *ShutdownMachineAccepted { return &ShutdownMachineAccepted{} } -/*ShutdownMachineAccepted handles this case with default header values. +/* ShutdownMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ShutdownMachineAccepted struct { func (o *ShutdownMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/shutdown][%d] shutdownMachineAccepted %+v", 202, o.Payload) } - func (o *ShutdownMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewShutdownMachineForbidden() *ShutdownMachineForbidden { return &ShutdownMachineForbidden{} } -/*ShutdownMachineForbidden handles this case with default header values. +/* ShutdownMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type ShutdownMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ShutdownMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/shutdown][%d] shutdownMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/shutdown][%d] shutdownMachineForbidden %+v", 403, o.Payload) +} +func (o *ShutdownMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ShutdownMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewShutdownMachineNotFound() *ShutdownMachineNotFound { return &ShutdownMachineNotFound{} } -/*ShutdownMachineNotFound handles this case with default header values. +/* ShutdownMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type ShutdownMachineNotFound struct { func (o *ShutdownMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/shutdown][%d] shutdownMachineNotFound %+v", 404, o.Payload) } - func (o *ShutdownMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/suspend_machine_parameters.go b/pkg/client/compute/suspend_machine_parameters.go index 34b3dc61..69f23a53 100644 --- a/pkg/client/compute/suspend_machine_parameters.go +++ b/pkg/client/compute/suspend_machine_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewSuspendMachineParams creates a new SuspendMachineParams object -// with the default values initialized. +// NewSuspendMachineParams creates a new SuspendMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSuspendMachineParams() *SuspendMachineParams { - var () return &SuspendMachineParams{ - timeout: cr.DefaultTimeout, } } // NewSuspendMachineParamsWithTimeout creates a new SuspendMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSuspendMachineParamsWithTimeout(timeout time.Duration) *SuspendMachineParams { - var () return &SuspendMachineParams{ - timeout: timeout, } } // NewSuspendMachineParamsWithContext creates a new SuspendMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSuspendMachineParamsWithContext(ctx context.Context) *SuspendMachineParams { - var () return &SuspendMachineParams{ - Context: ctx, } } // NewSuspendMachineParamsWithHTTPClient creates a new SuspendMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSuspendMachineParamsWithHTTPClient(client *http.Client) *SuspendMachineParams { - var () return &SuspendMachineParams{ HTTPClient: client, } } -/*SuspendMachineParams contains all the parameters to send to the API endpoint -for the suspend machine operation typically these are written to a http.Request +/* SuspendMachineParams contains all the parameters to send to the API endpoint + for the suspend machine operation. + + Typically these are written to a http.Request. */ type SuspendMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Machine. + /* ID. + + The id of the Machine. */ ID string @@ -76,6 +76,21 @@ type SuspendMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the suspend machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SuspendMachineParams) WithDefaults() *SuspendMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the suspend machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SuspendMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the suspend machine params func (o *SuspendMachineParams) WithTimeout(timeout time.Duration) *SuspendMachineParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *SuspendMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute/suspend_machine_responses.go b/pkg/client/compute/suspend_machine_responses.go index 61bdc75d..cc3aa7a8 100644 --- a/pkg/client/compute/suspend_machine_responses.go +++ b/pkg/client/compute/suspend_machine_responses.go @@ -41,7 +41,6 @@ func (o *SuspendMachineReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewSuspendMachineAccepted() *SuspendMachineAccepted { return &SuspendMachineAccepted{} } -/*SuspendMachineAccepted handles this case with default header values. +/* SuspendMachineAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type SuspendMachineAccepted struct { func (o *SuspendMachineAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/suspend][%d] suspendMachineAccepted %+v", 202, o.Payload) } - func (o *SuspendMachineAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewSuspendMachineForbidden() *SuspendMachineForbidden { return &SuspendMachineForbidden{} } -/*SuspendMachineForbidden handles this case with default header values. +/* SuspendMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type SuspendMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *SuspendMachineForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/suspend][%d] suspendMachineForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/suspend][%d] suspendMachineForbidden %+v", 403, o.Payload) +} +func (o *SuspendMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *SuspendMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewSuspendMachineNotFound() *SuspendMachineNotFound { return &SuspendMachineNotFound{} } -/*SuspendMachineNotFound handles this case with default header values. +/* SuspendMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type SuspendMachineNotFound struct { func (o *SuspendMachineNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/suspend][%d] suspendMachineNotFound %+v", 404, o.Payload) } - func (o *SuspendMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute/update_machine_parameters.go b/pkg/client/compute/update_machine_parameters.go index 3b55e153..7a5756b7 100644 --- a/pkg/client/compute/update_machine_parameters.go +++ b/pkg/client/compute/update_machine_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateMachineParams creates a new UpdateMachineParams object -// with the default values initialized. +// NewUpdateMachineParams creates a new UpdateMachineParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateMachineParams() *UpdateMachineParams { - var () return &UpdateMachineParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateMachineParamsWithTimeout creates a new UpdateMachineParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateMachineParamsWithTimeout(timeout time.Duration) *UpdateMachineParams { - var () return &UpdateMachineParams{ - timeout: timeout, } } // NewUpdateMachineParamsWithContext creates a new UpdateMachineParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateMachineParamsWithContext(ctx context.Context) *UpdateMachineParams { - var () return &UpdateMachineParams{ - Context: ctx, } } // NewUpdateMachineParamsWithHTTPClient creates a new UpdateMachineParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateMachineParamsWithHTTPClient(client *http.Client) *UpdateMachineParams { - var () return &UpdateMachineParams{ HTTPClient: client, } } -/*UpdateMachineParams contains all the parameters to send to the API endpoint -for the update machine operation typically these are written to a http.Request +/* UpdateMachineParams contains all the parameters to send to the API endpoint + for the update machine operation. + + Typically these are written to a http.Request. */ type UpdateMachineParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Machine Specification + /* Body. + + Machine Specification */ Body *models.UpdateMachineSpecification - /*ID - The ID of the Machine. + /* ID. + + The ID of the Machine. */ ID string @@ -83,6 +84,21 @@ type UpdateMachineParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMachineParams) WithDefaults() *UpdateMachineParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update machine params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMachineParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update machine params func (o *UpdateMachineParams) WithTimeout(timeout time.Duration) *UpdateMachineParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateMachineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/compute/update_machine_responses.go b/pkg/client/compute/update_machine_responses.go index 00277325..3e2b4a81 100644 --- a/pkg/client/compute/update_machine_responses.go +++ b/pkg/client/compute/update_machine_responses.go @@ -41,7 +41,6 @@ func (o *UpdateMachineReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateMachineOK() *UpdateMachineOK { return &UpdateMachineOK{} } -/*UpdateMachineOK handles this case with default header values. +/* UpdateMachineOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateMachineOK struct { func (o *UpdateMachineOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/machines/{id}][%d] updateMachineOK %+v", 200, o.Payload) } - func (o *UpdateMachineOK) GetPayload() *models.Machine { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateMachineForbidden() *UpdateMachineForbidden { return &UpdateMachineForbidden{} } -/*UpdateMachineForbidden handles this case with default header values. +/* UpdateMachineForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateMachineForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateMachineForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/machines/{id}][%d] updateMachineForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/machines/{id}][%d] updateMachineForbidden %+v", 403, o.Payload) +} +func (o *UpdateMachineForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateMachineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateMachineNotFound() *UpdateMachineNotFound { return &UpdateMachineNotFound{} } -/*UpdateMachineNotFound handles this case with default header values. +/* UpdateMachineNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateMachineNotFound struct { func (o *UpdateMachineNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/machines/{id}][%d] updateMachineNotFound %+v", 404, o.Payload) } - func (o *UpdateMachineNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute_gateway/compute_gateway_client.go b/pkg/client/compute_gateway/compute_gateway_client.go index 8dd8b79d..fd511b05 100644 --- a/pkg/client/compute_gateway/compute_gateway_client.go +++ b/pkg/client/compute_gateway/compute_gateway_client.go @@ -25,15 +25,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateComputeGateway(params *CreateComputeGatewayParams) (*CreateComputeGatewayAccepted, error) + CreateComputeGateway(params *CreateComputeGatewayParams, opts ...ClientOption) (*CreateComputeGatewayAccepted, error) + + DeleteComputeGateway(params *DeleteComputeGatewayParams, opts ...ClientOption) (*DeleteComputeGatewayAccepted, error) - DeleteComputeGateway(params *DeleteComputeGatewayParams) (*DeleteComputeGatewayAccepted, error) + GetComputeGateway(params *GetComputeGatewayParams, opts ...ClientOption) (*GetComputeGatewayOK, error) - GetComputeGateway(params *GetComputeGatewayParams) (*GetComputeGatewayOK, error) + GetComputeGateways(params *GetComputeGatewaysParams, opts ...ClientOption) (*GetComputeGatewaysOK, error) - GetComputeGateways(params *GetComputeGatewaysParams) (*GetComputeGatewaysOK, error) + ReconfigureComputeGateway(params *ReconfigureComputeGatewayParams, opts ...ClientOption) (*ReconfigureComputeGatewayAccepted, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +48,12 @@ type ClientService interface { Create a new compute gateway. */ -func (a *Client) CreateComputeGateway(params *CreateComputeGatewayParams) (*CreateComputeGatewayAccepted, error) { +func (a *Client) CreateComputeGateway(params *CreateComputeGatewayParams, opts ...ClientOption) (*CreateComputeGatewayAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateComputeGatewayParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createComputeGateway", Method: "POST", PathPattern: "/iaas/api/compute-gateways", @@ -60,7 +64,12 @@ func (a *Client) CreateComputeGateway(params *CreateComputeGatewayParams) (*Crea Reader: &CreateComputeGatewayReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +88,12 @@ func (a *Client) CreateComputeGateway(params *CreateComputeGatewayParams) (*Crea Delete compute gateway with a given id */ -func (a *Client) DeleteComputeGateway(params *DeleteComputeGatewayParams) (*DeleteComputeGatewayAccepted, error) { +func (a *Client) DeleteComputeGateway(params *DeleteComputeGatewayParams, opts ...ClientOption) (*DeleteComputeGatewayAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteComputeGatewayParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteComputeGateway", Method: "DELETE", PathPattern: "/iaas/api/compute-gateways/{id}", @@ -96,7 +104,12 @@ func (a *Client) DeleteComputeGateway(params *DeleteComputeGatewayParams) (*Dele Reader: &DeleteComputeGatewayReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +128,12 @@ func (a *Client) DeleteComputeGateway(params *DeleteComputeGatewayParams) (*Dele Get compute gateway with a given id */ -func (a *Client) GetComputeGateway(params *GetComputeGatewayParams) (*GetComputeGatewayOK, error) { +func (a *Client) GetComputeGateway(params *GetComputeGatewayParams, opts ...ClientOption) (*GetComputeGatewayOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetComputeGatewayParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getComputeGateway", Method: "GET", PathPattern: "/iaas/api/compute-gateways/{id}", @@ -132,7 +144,12 @@ func (a *Client) GetComputeGateway(params *GetComputeGatewayParams) (*GetCompute Reader: &GetComputeGatewayReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -151,13 +168,12 @@ func (a *Client) GetComputeGateway(params *GetComputeGatewayParams) (*GetCompute Get all compute gateways */ -func (a *Client) GetComputeGateways(params *GetComputeGatewaysParams) (*GetComputeGatewaysOK, error) { +func (a *Client) GetComputeGateways(params *GetComputeGatewaysParams, opts ...ClientOption) (*GetComputeGatewaysOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetComputeGatewaysParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getComputeGateways", Method: "GET", PathPattern: "/iaas/api/compute-gateways", @@ -168,7 +184,12 @@ func (a *Client) GetComputeGateways(params *GetComputeGatewaysParams) (*GetCompu Reader: &GetComputeGatewaysReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -182,6 +203,46 @@ func (a *Client) GetComputeGateways(params *GetComputeGatewaysParams) (*GetCompu panic(msg) } +/* + ReconfigureComputeGateway deprecateds reconfigure operation for compute gateway + + Deprecated: Day-2 reconfigure operation for compute gateway. Use Day-2 reconfigure operation on compute nat resource instead. +*/ +func (a *Client) ReconfigureComputeGateway(params *ReconfigureComputeGatewayParams, opts ...ClientOption) (*ReconfigureComputeGatewayAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReconfigureComputeGatewayParams() + } + op := &runtime.ClientOperation{ + ID: "reconfigureComputeGateway", + Method: "POST", + PathPattern: "/iaas/api/compute-gateways/{id}/operations/reconfigure", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReconfigureComputeGatewayReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReconfigureComputeGatewayAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reconfigureComputeGateway: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/pkg/client/compute_gateway/create_compute_gateway_parameters.go b/pkg/client/compute_gateway/create_compute_gateway_parameters.go index c4190ce7..daf07133 100644 --- a/pkg/client/compute_gateway/create_compute_gateway_parameters.go +++ b/pkg/client/compute_gateway/create_compute_gateway_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateComputeGatewayParams creates a new CreateComputeGatewayParams object -// with the default values initialized. +// NewCreateComputeGatewayParams creates a new CreateComputeGatewayParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateComputeGatewayParams() *CreateComputeGatewayParams { - var () return &CreateComputeGatewayParams{ - timeout: cr.DefaultTimeout, } } // NewCreateComputeGatewayParamsWithTimeout creates a new CreateComputeGatewayParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateComputeGatewayParamsWithTimeout(timeout time.Duration) *CreateComputeGatewayParams { - var () return &CreateComputeGatewayParams{ - timeout: timeout, } } // NewCreateComputeGatewayParamsWithContext creates a new CreateComputeGatewayParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateComputeGatewayParamsWithContext(ctx context.Context) *CreateComputeGatewayParams { - var () return &CreateComputeGatewayParams{ - Context: ctx, } } // NewCreateComputeGatewayParamsWithHTTPClient creates a new CreateComputeGatewayParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateComputeGatewayParamsWithHTTPClient(client *http.Client) *CreateComputeGatewayParams { - var () return &CreateComputeGatewayParams{ HTTPClient: client, } } -/*CreateComputeGatewayParams contains all the parameters to send to the API endpoint -for the create compute gateway operation typically these are written to a http.Request +/* CreateComputeGatewayParams contains all the parameters to send to the API endpoint + for the create compute gateway operation. + + Typically these are written to a http.Request. */ type CreateComputeGatewayParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Compute Gateway Specification instance + /* Body. + + Compute Gateway Specification instance */ Body *models.ComputeGatewaySpecification @@ -78,6 +78,21 @@ type CreateComputeGatewayParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateComputeGatewayParams) WithDefaults() *CreateComputeGatewayParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateComputeGatewayParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create compute gateway params func (o *CreateComputeGatewayParams) WithTimeout(timeout time.Duration) *CreateComputeGatewayParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateComputeGatewayParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/compute_gateway/create_compute_gateway_responses.go b/pkg/client/compute_gateway/create_compute_gateway_responses.go index a6f7cdc0..b3437535 100644 --- a/pkg/client/compute_gateway/create_compute_gateway_responses.go +++ b/pkg/client/compute_gateway/create_compute_gateway_responses.go @@ -41,7 +41,6 @@ func (o *CreateComputeGatewayReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateComputeGatewayAccepted() *CreateComputeGatewayAccepted { return &CreateComputeGatewayAccepted{} } -/*CreateComputeGatewayAccepted handles this case with default header values. +/* CreateComputeGatewayAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateComputeGatewayAccepted struct { func (o *CreateComputeGatewayAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/compute-gateways][%d] createComputeGatewayAccepted %+v", 202, o.Payload) } - func (o *CreateComputeGatewayAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateComputeGatewayBadRequest() *CreateComputeGatewayBadRequest { return &CreateComputeGatewayBadRequest{} } -/*CreateComputeGatewayBadRequest handles this case with default header values. +/* CreateComputeGatewayBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateComputeGatewayBadRequest struct { func (o *CreateComputeGatewayBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/compute-gateways][%d] createComputeGatewayBadRequest %+v", 400, o.Payload) } - func (o *CreateComputeGatewayBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateComputeGatewayForbidden() *CreateComputeGatewayForbidden { return &CreateComputeGatewayForbidden{} } -/*CreateComputeGatewayForbidden handles this case with default header values. +/* CreateComputeGatewayForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateComputeGatewayForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateComputeGatewayForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/compute-gateways][%d] createComputeGatewayForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/compute-gateways][%d] createComputeGatewayForbidden %+v", 403, o.Payload) +} +func (o *CreateComputeGatewayForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateComputeGatewayForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute_gateway/delete_compute_gateway_parameters.go b/pkg/client/compute_gateway/delete_compute_gateway_parameters.go index 2f9448e6..dbe67642 100644 --- a/pkg/client/compute_gateway/delete_compute_gateway_parameters.go +++ b/pkg/client/compute_gateway/delete_compute_gateway_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteComputeGatewayParams creates a new DeleteComputeGatewayParams object -// with the default values initialized. +// NewDeleteComputeGatewayParams creates a new DeleteComputeGatewayParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteComputeGatewayParams() *DeleteComputeGatewayParams { - var () return &DeleteComputeGatewayParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteComputeGatewayParamsWithTimeout creates a new DeleteComputeGatewayParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteComputeGatewayParamsWithTimeout(timeout time.Duration) *DeleteComputeGatewayParams { - var () return &DeleteComputeGatewayParams{ - timeout: timeout, } } // NewDeleteComputeGatewayParamsWithContext creates a new DeleteComputeGatewayParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteComputeGatewayParamsWithContext(ctx context.Context) *DeleteComputeGatewayParams { - var () return &DeleteComputeGatewayParams{ - Context: ctx, } } // NewDeleteComputeGatewayParamsWithHTTPClient creates a new DeleteComputeGatewayParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteComputeGatewayParamsWithHTTPClient(client *http.Client) *DeleteComputeGatewayParams { - var () return &DeleteComputeGatewayParams{ HTTPClient: client, } } -/*DeleteComputeGatewayParams contains all the parameters to send to the API endpoint -for the delete compute gateway operation typically these are written to a http.Request +/* DeleteComputeGatewayParams contains all the parameters to send to the API endpoint + for the delete compute gateway operation. + + Typically these are written to a http.Request. */ type DeleteComputeGatewayParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this compute gateway. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this compute gateway. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the compute gateway. + /* ID. + + The ID of the compute gateway. */ ID string @@ -82,6 +83,21 @@ type DeleteComputeGatewayParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteComputeGatewayParams) WithDefaults() *DeleteComputeGatewayParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteComputeGatewayParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete compute gateway params func (o *DeleteComputeGatewayParams) WithTimeout(timeout time.Duration) *DeleteComputeGatewayParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteComputeGatewayParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute_gateway/delete_compute_gateway_responses.go b/pkg/client/compute_gateway/delete_compute_gateway_responses.go index 617d0254..4e743123 100644 --- a/pkg/client/compute_gateway/delete_compute_gateway_responses.go +++ b/pkg/client/compute_gateway/delete_compute_gateway_responses.go @@ -35,7 +35,6 @@ func (o *DeleteComputeGatewayReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteComputeGatewayAccepted() *DeleteComputeGatewayAccepted { return &DeleteComputeGatewayAccepted{} } -/*DeleteComputeGatewayAccepted handles this case with default header values. +/* DeleteComputeGatewayAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteComputeGatewayAccepted struct { func (o *DeleteComputeGatewayAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/compute-gateways/{id}][%d] deleteComputeGatewayAccepted %+v", 202, o.Payload) } - func (o *DeleteComputeGatewayAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteComputeGatewayForbidden() *DeleteComputeGatewayForbidden { return &DeleteComputeGatewayForbidden{} } -/*DeleteComputeGatewayForbidden handles this case with default header values. +/* DeleteComputeGatewayForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteComputeGatewayForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteComputeGatewayForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/compute-gateways/{id}][%d] deleteComputeGatewayForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/compute-gateways/{id}][%d] deleteComputeGatewayForbidden %+v", 403, o.Payload) +} +func (o *DeleteComputeGatewayForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteComputeGatewayForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute_gateway/get_compute_gateway_parameters.go b/pkg/client/compute_gateway/get_compute_gateway_parameters.go index 54a8fce0..a246bc09 100644 --- a/pkg/client/compute_gateway/get_compute_gateway_parameters.go +++ b/pkg/client/compute_gateway/get_compute_gateway_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetComputeGatewayParams creates a new GetComputeGatewayParams object -// with the default values initialized. +// NewGetComputeGatewayParams creates a new GetComputeGatewayParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetComputeGatewayParams() *GetComputeGatewayParams { - var () return &GetComputeGatewayParams{ - timeout: cr.DefaultTimeout, } } // NewGetComputeGatewayParamsWithTimeout creates a new GetComputeGatewayParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetComputeGatewayParamsWithTimeout(timeout time.Duration) *GetComputeGatewayParams { - var () return &GetComputeGatewayParams{ - timeout: timeout, } } // NewGetComputeGatewayParamsWithContext creates a new GetComputeGatewayParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetComputeGatewayParamsWithContext(ctx context.Context) *GetComputeGatewayParams { - var () return &GetComputeGatewayParams{ - Context: ctx, } } // NewGetComputeGatewayParamsWithHTTPClient creates a new GetComputeGatewayParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetComputeGatewayParamsWithHTTPClient(client *http.Client) *GetComputeGatewayParams { - var () return &GetComputeGatewayParams{ HTTPClient: client, } } -/*GetComputeGatewayParams contains all the parameters to send to the API endpoint -for the get compute gateway operation typically these are written to a http.Request +/* GetComputeGatewayParams contains all the parameters to send to the API endpoint + for the get compute gateway operation. + + Typically these are written to a http.Request. */ type GetComputeGatewayParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the gateway. + /* ID. + + The ID of the gateway. */ ID string @@ -76,6 +76,21 @@ type GetComputeGatewayParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeGatewayParams) WithDefaults() *GetComputeGatewayParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeGatewayParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get compute gateway params func (o *GetComputeGatewayParams) WithTimeout(timeout time.Duration) *GetComputeGatewayParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetComputeGatewayParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/compute_gateway/get_compute_gateway_responses.go b/pkg/client/compute_gateway/get_compute_gateway_responses.go index f97b5f7a..d67a7769 100644 --- a/pkg/client/compute_gateway/get_compute_gateway_responses.go +++ b/pkg/client/compute_gateway/get_compute_gateway_responses.go @@ -41,7 +41,6 @@ func (o *GetComputeGatewayReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetComputeGatewayOK() *GetComputeGatewayOK { return &GetComputeGatewayOK{} } -/*GetComputeGatewayOK handles this case with default header values. +/* GetComputeGatewayOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetComputeGatewayOK struct { func (o *GetComputeGatewayOK) Error() string { return fmt.Sprintf("[GET /iaas/api/compute-gateways/{id}][%d] getComputeGatewayOK %+v", 200, o.Payload) } - func (o *GetComputeGatewayOK) GetPayload() *models.ComputeGateway { return o.Payload } @@ -85,19 +83,30 @@ func NewGetComputeGatewayForbidden() *GetComputeGatewayForbidden { return &GetComputeGatewayForbidden{} } -/*GetComputeGatewayForbidden handles this case with default header values. +/* GetComputeGatewayForbidden describes a response with status code 403, with default header values. Forbidden */ type GetComputeGatewayForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetComputeGatewayForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/compute-gateways/{id}][%d] getComputeGatewayForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/compute-gateways/{id}][%d] getComputeGatewayForbidden %+v", 403, o.Payload) +} +func (o *GetComputeGatewayForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetComputeGatewayForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetComputeGatewayNotFound() *GetComputeGatewayNotFound { return &GetComputeGatewayNotFound{} } -/*GetComputeGatewayNotFound handles this case with default header values. +/* GetComputeGatewayNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetComputeGatewayNotFound struct { func (o *GetComputeGatewayNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/compute-gateways/{id}][%d] getComputeGatewayNotFound %+v", 404, o.Payload) } - func (o *GetComputeGatewayNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/compute_gateway/get_compute_gateways_parameters.go b/pkg/client/compute_gateway/get_compute_gateways_parameters.go index 019ff016..e7981db4 100644 --- a/pkg/client/compute_gateway/get_compute_gateways_parameters.go +++ b/pkg/client/compute_gateway/get_compute_gateways_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetComputeGatewaysParams creates a new GetComputeGatewaysParams object -// with the default values initialized. +// NewGetComputeGatewaysParams creates a new GetComputeGatewaysParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetComputeGatewaysParams() *GetComputeGatewaysParams { - var () return &GetComputeGatewaysParams{ - timeout: cr.DefaultTimeout, } } // NewGetComputeGatewaysParamsWithTimeout creates a new GetComputeGatewaysParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetComputeGatewaysParamsWithTimeout(timeout time.Duration) *GetComputeGatewaysParams { - var () return &GetComputeGatewaysParams{ - timeout: timeout, } } // NewGetComputeGatewaysParamsWithContext creates a new GetComputeGatewaysParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetComputeGatewaysParamsWithContext(ctx context.Context) *GetComputeGatewaysParams { - var () return &GetComputeGatewaysParams{ - Context: ctx, } } // NewGetComputeGatewaysParamsWithHTTPClient creates a new GetComputeGatewaysParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetComputeGatewaysParamsWithHTTPClient(client *http.Client) *GetComputeGatewaysParams { - var () return &GetComputeGatewaysParams{ HTTPClient: client, } } -/*GetComputeGatewaysParams contains all the parameters to send to the API endpoint -for the get compute gateways operation typically these are written to a http.Request +/* GetComputeGatewaysParams contains all the parameters to send to the API endpoint + for the get compute gateways operation. + + Typically these are written to a http.Request. */ type GetComputeGatewaysParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetComputeGatewaysParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get compute gateways params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeGatewaysParams) WithDefaults() *GetComputeGatewaysParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get compute gateways params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeGatewaysParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get compute gateways params func (o *GetComputeGatewaysParams) WithTimeout(timeout time.Duration) *GetComputeGatewaysParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetComputeGatewaysParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/compute_gateway/get_compute_gateways_responses.go b/pkg/client/compute_gateway/get_compute_gateways_responses.go index 0e94e0c0..5afe4439 100644 --- a/pkg/client/compute_gateway/get_compute_gateways_responses.go +++ b/pkg/client/compute_gateway/get_compute_gateways_responses.go @@ -35,7 +35,6 @@ func (o *GetComputeGatewaysReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetComputeGatewaysOK() *GetComputeGatewaysOK { return &GetComputeGatewaysOK{} } -/*GetComputeGatewaysOK handles this case with default header values. +/* GetComputeGatewaysOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetComputeGatewaysOK struct { func (o *GetComputeGatewaysOK) Error() string { return fmt.Sprintf("[GET /iaas/api/compute-gateways][%d] getComputeGatewaysOK %+v", 200, o.Payload) } - func (o *GetComputeGatewaysOK) GetPayload() *models.ComputeGatewayResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetComputeGatewaysForbidden() *GetComputeGatewaysForbidden { return &GetComputeGatewaysForbidden{} } -/*GetComputeGatewaysForbidden handles this case with default header values. +/* GetComputeGatewaysForbidden describes a response with status code 403, with default header values. Forbidden */ type GetComputeGatewaysForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetComputeGatewaysForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/compute-gateways][%d] getComputeGatewaysForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/compute-gateways][%d] getComputeGatewaysForbidden %+v", 403, o.Payload) +} +func (o *GetComputeGatewaysForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetComputeGatewaysForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/compute_gateway/reconfigure_compute_gateway_parameters.go b/pkg/client/compute_gateway/reconfigure_compute_gateway_parameters.go new file mode 100644 index 00000000..ffea07d7 --- /dev/null +++ b/pkg/client/compute_gateway/reconfigure_compute_gateway_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_gateway + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// NewReconfigureComputeGatewayParams creates a new ReconfigureComputeGatewayParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReconfigureComputeGatewayParams() *ReconfigureComputeGatewayParams { + return &ReconfigureComputeGatewayParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReconfigureComputeGatewayParamsWithTimeout creates a new ReconfigureComputeGatewayParams object +// with the ability to set a timeout on a request. +func NewReconfigureComputeGatewayParamsWithTimeout(timeout time.Duration) *ReconfigureComputeGatewayParams { + return &ReconfigureComputeGatewayParams{ + timeout: timeout, + } +} + +// NewReconfigureComputeGatewayParamsWithContext creates a new ReconfigureComputeGatewayParams object +// with the ability to set a context for a request. +func NewReconfigureComputeGatewayParamsWithContext(ctx context.Context) *ReconfigureComputeGatewayParams { + return &ReconfigureComputeGatewayParams{ + Context: ctx, + } +} + +// NewReconfigureComputeGatewayParamsWithHTTPClient creates a new ReconfigureComputeGatewayParams object +// with the ability to set a custom HTTPClient for a request. +func NewReconfigureComputeGatewayParamsWithHTTPClient(client *http.Client) *ReconfigureComputeGatewayParams { + return &ReconfigureComputeGatewayParams{ + HTTPClient: client, + } +} + +/* ReconfigureComputeGatewayParams contains all the parameters to send to the API endpoint + for the reconfigure compute gateway operation. + + Typically these are written to a http.Request. +*/ +type ReconfigureComputeGatewayParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* Body. + + Reconfigure Compute Gateway Specification instance + */ + Body *models.ReconfigureComputeGatewaySpecification + + /* ID. + + The ID of the Compute Gateway + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reconfigure compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureComputeGatewayParams) WithDefaults() *ReconfigureComputeGatewayParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reconfigure compute gateway params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureComputeGatewayParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithTimeout(timeout time.Duration) *ReconfigureComputeGatewayParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithContext(ctx context.Context) *ReconfigureComputeGatewayParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithHTTPClient(client *http.Client) *ReconfigureComputeGatewayParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithAPIVersion(aPIVersion *string) *ReconfigureComputeGatewayParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithBody adds the body to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithBody(body *models.ReconfigureComputeGatewaySpecification) *ReconfigureComputeGatewayParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetBody(body *models.ReconfigureComputeGatewaySpecification) { + o.Body = body +} + +// WithID adds the id to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) WithID(id string) *ReconfigureComputeGatewayParams { + o.SetID(id) + return o +} + +// SetID adds the id to the reconfigure compute gateway params +func (o *ReconfigureComputeGatewayParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ReconfigureComputeGatewayParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // 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/pkg/client/compute_gateway/reconfigure_compute_gateway_responses.go b/pkg/client/compute_gateway/reconfigure_compute_gateway_responses.go new file mode 100644 index 00000000..1ff84e67 --- /dev/null +++ b/pkg/client/compute_gateway/reconfigure_compute_gateway_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_gateway + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// ReconfigureComputeGatewayReader is a Reader for the ReconfigureComputeGateway structure. +type ReconfigureComputeGatewayReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReconfigureComputeGatewayReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewReconfigureComputeGatewayAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReconfigureComputeGatewayBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReconfigureComputeGatewayForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReconfigureComputeGatewayAccepted creates a ReconfigureComputeGatewayAccepted with default headers values +func NewReconfigureComputeGatewayAccepted() *ReconfigureComputeGatewayAccepted { + return &ReconfigureComputeGatewayAccepted{} +} + +/* ReconfigureComputeGatewayAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type ReconfigureComputeGatewayAccepted struct { + Payload *models.RequestTracker +} + +func (o *ReconfigureComputeGatewayAccepted) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-gateways/{id}/operations/reconfigure][%d] reconfigureComputeGatewayAccepted %+v", 202, o.Payload) +} +func (o *ReconfigureComputeGatewayAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *ReconfigureComputeGatewayAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureComputeGatewayBadRequest creates a ReconfigureComputeGatewayBadRequest with default headers values +func NewReconfigureComputeGatewayBadRequest() *ReconfigureComputeGatewayBadRequest { + return &ReconfigureComputeGatewayBadRequest{} +} + +/* ReconfigureComputeGatewayBadRequest describes a response with status code 400, with default header values. + +NAT rules cannot be null +*/ +type ReconfigureComputeGatewayBadRequest struct { + Payload *models.Error +} + +func (o *ReconfigureComputeGatewayBadRequest) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-gateways/{id}/operations/reconfigure][%d] reconfigureComputeGatewayBadRequest %+v", 400, o.Payload) +} +func (o *ReconfigureComputeGatewayBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *ReconfigureComputeGatewayBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureComputeGatewayForbidden creates a ReconfigureComputeGatewayForbidden with default headers values +func NewReconfigureComputeGatewayForbidden() *ReconfigureComputeGatewayForbidden { + return &ReconfigureComputeGatewayForbidden{} +} + +/* ReconfigureComputeGatewayForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReconfigureComputeGatewayForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *ReconfigureComputeGatewayForbidden) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-gateways/{id}/operations/reconfigure][%d] reconfigureComputeGatewayForbidden %+v", 403, o.Payload) +} +func (o *ReconfigureComputeGatewayForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *ReconfigureComputeGatewayForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/compute_nat/compute_nat_client.go b/pkg/client/compute_nat/compute_nat_client.go new file mode 100644 index 00000000..f8099038 --- /dev/null +++ b/pkg/client/compute_nat/compute_nat_client.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new compute nat API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for compute nat API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateComputeNat(params *CreateComputeNatParams, opts ...ClientOption) (*CreateComputeNatAccepted, error) + + DeleteComputeNat(params *DeleteComputeNatParams, opts ...ClientOption) (*DeleteComputeNatAccepted, error) + + GetComputeNat(params *GetComputeNatParams, opts ...ClientOption) (*GetComputeNatOK, error) + + GetComputeNats(params *GetComputeNatsParams, opts ...ClientOption) (*GetComputeNatsOK, error) + + ReconfigureNat(params *ReconfigureNatParams, opts ...ClientOption) (*ReconfigureNatAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateComputeNat creates a compute nat + + Create a new Compute Nat. +*/ +func (a *Client) CreateComputeNat(params *CreateComputeNatParams, opts ...ClientOption) (*CreateComputeNatAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateComputeNatParams() + } + op := &runtime.ClientOperation{ + ID: "createComputeNat", + Method: "POST", + PathPattern: "/iaas/api/compute-nats", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateComputeNatReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateComputeNatAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createComputeNat: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteComputeNat deletes a compute nat + + Delete compute nat with a given id +*/ +func (a *Client) DeleteComputeNat(params *DeleteComputeNatParams, opts ...ClientOption) (*DeleteComputeNatAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteComputeNatParams() + } + op := &runtime.ClientOperation{ + ID: "deleteComputeNat", + Method: "DELETE", + PathPattern: "/iaas/api/compute-nats/{id}", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteComputeNatReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteComputeNatAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteComputeNat: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetComputeNat gets a compute nat + + Get Compute Nat with a given id +*/ +func (a *Client) GetComputeNat(params *GetComputeNatParams, opts ...ClientOption) (*GetComputeNatOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetComputeNatParams() + } + op := &runtime.ClientOperation{ + ID: "getComputeNat", + Method: "GET", + PathPattern: "/iaas/api/compute-nats/{id}", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetComputeNatReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetComputeNatOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getComputeNat: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetComputeNats gets compute nats + + Get all Compute Nats +*/ +func (a *Client) GetComputeNats(params *GetComputeNatsParams, opts ...ClientOption) (*GetComputeNatsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetComputeNatsParams() + } + op := &runtime.ClientOperation{ + ID: "getComputeNats", + Method: "GET", + PathPattern: "/iaas/api/compute-nats", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetComputeNatsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetComputeNatsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getComputeNats: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReconfigureNat reconfigures operation for nat + + Day-2 reconfigure operation for nat +*/ +func (a *Client) ReconfigureNat(params *ReconfigureNatParams, opts ...ClientOption) (*ReconfigureNatAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReconfigureNatParams() + } + op := &runtime.ClientOperation{ + ID: "reconfigureNat", + Method: "POST", + PathPattern: "/iaas/api/compute-nats/{id}/operations/reconfigure", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReconfigureNatReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReconfigureNatAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reconfigureNat: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/client/compute_nat/create_compute_nat_parameters.go b/pkg/client/compute_nat/create_compute_nat_parameters.go new file mode 100644 index 00000000..08f52119 --- /dev/null +++ b/pkg/client/compute_nat/create_compute_nat_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// NewCreateComputeNatParams creates a new CreateComputeNatParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateComputeNatParams() *CreateComputeNatParams { + return &CreateComputeNatParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateComputeNatParamsWithTimeout creates a new CreateComputeNatParams object +// with the ability to set a timeout on a request. +func NewCreateComputeNatParamsWithTimeout(timeout time.Duration) *CreateComputeNatParams { + return &CreateComputeNatParams{ + timeout: timeout, + } +} + +// NewCreateComputeNatParamsWithContext creates a new CreateComputeNatParams object +// with the ability to set a context for a request. +func NewCreateComputeNatParamsWithContext(ctx context.Context) *CreateComputeNatParams { + return &CreateComputeNatParams{ + Context: ctx, + } +} + +// NewCreateComputeNatParamsWithHTTPClient creates a new CreateComputeNatParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateComputeNatParamsWithHTTPClient(client *http.Client) *CreateComputeNatParams { + return &CreateComputeNatParams{ + HTTPClient: client, + } +} + +/* CreateComputeNatParams contains all the parameters to send to the API endpoint + for the create compute nat operation. + + Typically these are written to a http.Request. +*/ +type CreateComputeNatParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* Body. + + Compute Nat Specification instance + */ + Body *models.ComputeNatSpecification + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateComputeNatParams) WithDefaults() *CreateComputeNatParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateComputeNatParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create compute nat params +func (o *CreateComputeNatParams) WithTimeout(timeout time.Duration) *CreateComputeNatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create compute nat params +func (o *CreateComputeNatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create compute nat params +func (o *CreateComputeNatParams) WithContext(ctx context.Context) *CreateComputeNatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create compute nat params +func (o *CreateComputeNatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create compute nat params +func (o *CreateComputeNatParams) WithHTTPClient(client *http.Client) *CreateComputeNatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create compute nat params +func (o *CreateComputeNatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the create compute nat params +func (o *CreateComputeNatParams) WithAPIVersion(aPIVersion *string) *CreateComputeNatParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the create compute nat params +func (o *CreateComputeNatParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithBody adds the body to the create compute nat params +func (o *CreateComputeNatParams) WithBody(body *models.ComputeNatSpecification) *CreateComputeNatParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create compute nat params +func (o *CreateComputeNatParams) SetBody(body *models.ComputeNatSpecification) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateComputeNatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/client/compute_nat/create_compute_nat_responses.go b/pkg/client/compute_nat/create_compute_nat_responses.go new file mode 100644 index 00000000..d2e04c44 --- /dev/null +++ b/pkg/client/compute_nat/create_compute_nat_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// CreateComputeNatReader is a Reader for the CreateComputeNat structure. +type CreateComputeNatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateComputeNatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewCreateComputeNatAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateComputeNatBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateComputeNatForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateComputeNatAccepted creates a CreateComputeNatAccepted with default headers values +func NewCreateComputeNatAccepted() *CreateComputeNatAccepted { + return &CreateComputeNatAccepted{} +} + +/* CreateComputeNatAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type CreateComputeNatAccepted struct { + Payload *models.RequestTracker +} + +func (o *CreateComputeNatAccepted) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats][%d] createComputeNatAccepted %+v", 202, o.Payload) +} +func (o *CreateComputeNatAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *CreateComputeNatAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateComputeNatBadRequest creates a CreateComputeNatBadRequest with default headers values +func NewCreateComputeNatBadRequest() *CreateComputeNatBadRequest { + return &CreateComputeNatBadRequest{} +} + +/* CreateComputeNatBadRequest describes a response with status code 400, with default header values. + +Invalid Request - bad data +*/ +type CreateComputeNatBadRequest struct { + Payload *models.Error +} + +func (o *CreateComputeNatBadRequest) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats][%d] createComputeNatBadRequest %+v", 400, o.Payload) +} +func (o *CreateComputeNatBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateComputeNatBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateComputeNatForbidden creates a CreateComputeNatForbidden with default headers values +func NewCreateComputeNatForbidden() *CreateComputeNatForbidden { + return &CreateComputeNatForbidden{} +} + +/* CreateComputeNatForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CreateComputeNatForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *CreateComputeNatForbidden) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats][%d] createComputeNatForbidden %+v", 403, o.Payload) +} +func (o *CreateComputeNatForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *CreateComputeNatForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/compute_nat/delete_compute_nat_parameters.go b/pkg/client/compute_nat/delete_compute_nat_parameters.go new file mode 100644 index 00000000..caa667bf --- /dev/null +++ b/pkg/client/compute_nat/delete_compute_nat_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteComputeNatParams creates a new DeleteComputeNatParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteComputeNatParams() *DeleteComputeNatParams { + return &DeleteComputeNatParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteComputeNatParamsWithTimeout creates a new DeleteComputeNatParams object +// with the ability to set a timeout on a request. +func NewDeleteComputeNatParamsWithTimeout(timeout time.Duration) *DeleteComputeNatParams { + return &DeleteComputeNatParams{ + timeout: timeout, + } +} + +// NewDeleteComputeNatParamsWithContext creates a new DeleteComputeNatParams object +// with the ability to set a context for a request. +func NewDeleteComputeNatParamsWithContext(ctx context.Context) *DeleteComputeNatParams { + return &DeleteComputeNatParams{ + Context: ctx, + } +} + +// NewDeleteComputeNatParamsWithHTTPClient creates a new DeleteComputeNatParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteComputeNatParamsWithHTTPClient(client *http.Client) *DeleteComputeNatParams { + return &DeleteComputeNatParams{ + HTTPClient: client, + } +} + +/* DeleteComputeNatParams contains all the parameters to send to the API endpoint + for the delete compute nat operation. + + Typically these are written to a http.Request. +*/ +type DeleteComputeNatParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this nat. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + */ + ForceDelete *bool + + /* ID. + + The ID of the compute nat resource. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteComputeNatParams) WithDefaults() *DeleteComputeNatParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteComputeNatParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete compute nat params +func (o *DeleteComputeNatParams) WithTimeout(timeout time.Duration) *DeleteComputeNatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete compute nat params +func (o *DeleteComputeNatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete compute nat params +func (o *DeleteComputeNatParams) WithContext(ctx context.Context) *DeleteComputeNatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete compute nat params +func (o *DeleteComputeNatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete compute nat params +func (o *DeleteComputeNatParams) WithHTTPClient(client *http.Client) *DeleteComputeNatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete compute nat params +func (o *DeleteComputeNatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the delete compute nat params +func (o *DeleteComputeNatParams) WithAPIVersion(aPIVersion *string) *DeleteComputeNatParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the delete compute nat params +func (o *DeleteComputeNatParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithForceDelete adds the forceDelete to the delete compute nat params +func (o *DeleteComputeNatParams) WithForceDelete(forceDelete *bool) *DeleteComputeNatParams { + o.SetForceDelete(forceDelete) + return o +} + +// SetForceDelete adds the forceDelete to the delete compute nat params +func (o *DeleteComputeNatParams) SetForceDelete(forceDelete *bool) { + o.ForceDelete = forceDelete +} + +// WithID adds the id to the delete compute nat params +func (o *DeleteComputeNatParams) WithID(id string) *DeleteComputeNatParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete compute nat params +func (o *DeleteComputeNatParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteComputeNatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + + if o.ForceDelete != nil { + + // query param forceDelete + var qrForceDelete bool + + if o.ForceDelete != nil { + qrForceDelete = *o.ForceDelete + } + qForceDelete := swag.FormatBool(qrForceDelete) + if qForceDelete != "" { + + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { + return err + } + } + } + + // 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/pkg/client/compute_nat/delete_compute_nat_responses.go b/pkg/client/compute_nat/delete_compute_nat_responses.go new file mode 100644 index 00000000..d6c33efa --- /dev/null +++ b/pkg/client/compute_nat/delete_compute_nat_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// DeleteComputeNatReader is a Reader for the DeleteComputeNat structure. +type DeleteComputeNatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteComputeNatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewDeleteComputeNatAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewDeleteComputeNatForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteComputeNatAccepted creates a DeleteComputeNatAccepted with default headers values +func NewDeleteComputeNatAccepted() *DeleteComputeNatAccepted { + return &DeleteComputeNatAccepted{} +} + +/* DeleteComputeNatAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type DeleteComputeNatAccepted struct { + Payload *models.RequestTracker +} + +func (o *DeleteComputeNatAccepted) Error() string { + return fmt.Sprintf("[DELETE /iaas/api/compute-nats/{id}][%d] deleteComputeNatAccepted %+v", 202, o.Payload) +} +func (o *DeleteComputeNatAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *DeleteComputeNatAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteComputeNatForbidden creates a DeleteComputeNatForbidden with default headers values +func NewDeleteComputeNatForbidden() *DeleteComputeNatForbidden { + return &DeleteComputeNatForbidden{} +} + +/* DeleteComputeNatForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteComputeNatForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *DeleteComputeNatForbidden) Error() string { + return fmt.Sprintf("[DELETE /iaas/api/compute-nats/{id}][%d] deleteComputeNatForbidden %+v", 403, o.Payload) +} +func (o *DeleteComputeNatForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *DeleteComputeNatForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/compute_nat/get_compute_nat_parameters.go b/pkg/client/compute_nat/get_compute_nat_parameters.go new file mode 100644 index 00000000..d84aee53 --- /dev/null +++ b/pkg/client/compute_nat/get_compute_nat_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetComputeNatParams creates a new GetComputeNatParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetComputeNatParams() *GetComputeNatParams { + return &GetComputeNatParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetComputeNatParamsWithTimeout creates a new GetComputeNatParams object +// with the ability to set a timeout on a request. +func NewGetComputeNatParamsWithTimeout(timeout time.Duration) *GetComputeNatParams { + return &GetComputeNatParams{ + timeout: timeout, + } +} + +// NewGetComputeNatParamsWithContext creates a new GetComputeNatParams object +// with the ability to set a context for a request. +func NewGetComputeNatParamsWithContext(ctx context.Context) *GetComputeNatParams { + return &GetComputeNatParams{ + Context: ctx, + } +} + +// NewGetComputeNatParamsWithHTTPClient creates a new GetComputeNatParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetComputeNatParamsWithHTTPClient(client *http.Client) *GetComputeNatParams { + return &GetComputeNatParams{ + HTTPClient: client, + } +} + +/* GetComputeNatParams contains all the parameters to send to the API endpoint + for the get compute nat operation. + + Typically these are written to a http.Request. +*/ +type GetComputeNatParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* ID. + + The ID of the Compute Nat resource. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeNatParams) WithDefaults() *GetComputeNatParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get compute nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeNatParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get compute nat params +func (o *GetComputeNatParams) WithTimeout(timeout time.Duration) *GetComputeNatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get compute nat params +func (o *GetComputeNatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get compute nat params +func (o *GetComputeNatParams) WithContext(ctx context.Context) *GetComputeNatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get compute nat params +func (o *GetComputeNatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get compute nat params +func (o *GetComputeNatParams) WithHTTPClient(client *http.Client) *GetComputeNatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get compute nat params +func (o *GetComputeNatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the get compute nat params +func (o *GetComputeNatParams) WithAPIVersion(aPIVersion *string) *GetComputeNatParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the get compute nat params +func (o *GetComputeNatParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithID adds the id to the get compute nat params +func (o *GetComputeNatParams) WithID(id string) *GetComputeNatParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get compute nat params +func (o *GetComputeNatParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetComputeNatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + + // 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/pkg/client/compute_nat/get_compute_nat_responses.go b/pkg/client/compute_nat/get_compute_nat_responses.go new file mode 100644 index 00000000..c7171efc --- /dev/null +++ b/pkg/client/compute_nat/get_compute_nat_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// GetComputeNatReader is a Reader for the GetComputeNat structure. +type GetComputeNatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetComputeNatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetComputeNatOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetComputeNatForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetComputeNatNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetComputeNatOK creates a GetComputeNatOK with default headers values +func NewGetComputeNatOK() *GetComputeNatOK { + return &GetComputeNatOK{} +} + +/* GetComputeNatOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetComputeNatOK struct { + Payload *models.ComputeNat +} + +func (o *GetComputeNatOK) Error() string { + return fmt.Sprintf("[GET /iaas/api/compute-nats/{id}][%d] getComputeNatOK %+v", 200, o.Payload) +} +func (o *GetComputeNatOK) GetPayload() *models.ComputeNat { + return o.Payload +} + +func (o *GetComputeNatOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ComputeNat) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetComputeNatForbidden creates a GetComputeNatForbidden with default headers values +func NewGetComputeNatForbidden() *GetComputeNatForbidden { + return &GetComputeNatForbidden{} +} + +/* GetComputeNatForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetComputeNatForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *GetComputeNatForbidden) Error() string { + return fmt.Sprintf("[GET /iaas/api/compute-nats/{id}][%d] getComputeNatForbidden %+v", 403, o.Payload) +} +func (o *GetComputeNatForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *GetComputeNatForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetComputeNatNotFound creates a GetComputeNatNotFound with default headers values +func NewGetComputeNatNotFound() *GetComputeNatNotFound { + return &GetComputeNatNotFound{} +} + +/* GetComputeNatNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetComputeNatNotFound struct { + Payload *models.Error +} + +func (o *GetComputeNatNotFound) Error() string { + return fmt.Sprintf("[GET /iaas/api/compute-nats/{id}][%d] getComputeNatNotFound %+v", 404, o.Payload) +} +func (o *GetComputeNatNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetComputeNatNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/compute_nat/get_compute_nats_parameters.go b/pkg/client/compute_nat/get_compute_nats_parameters.go new file mode 100644 index 00000000..c165eb76 --- /dev/null +++ b/pkg/client/compute_nat/get_compute_nats_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetComputeNatsParams creates a new GetComputeNatsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetComputeNatsParams() *GetComputeNatsParams { + return &GetComputeNatsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetComputeNatsParamsWithTimeout creates a new GetComputeNatsParams object +// with the ability to set a timeout on a request. +func NewGetComputeNatsParamsWithTimeout(timeout time.Duration) *GetComputeNatsParams { + return &GetComputeNatsParams{ + timeout: timeout, + } +} + +// NewGetComputeNatsParamsWithContext creates a new GetComputeNatsParams object +// with the ability to set a context for a request. +func NewGetComputeNatsParamsWithContext(ctx context.Context) *GetComputeNatsParams { + return &GetComputeNatsParams{ + Context: ctx, + } +} + +// NewGetComputeNatsParamsWithHTTPClient creates a new GetComputeNatsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetComputeNatsParamsWithHTTPClient(client *http.Client) *GetComputeNatsParams { + return &GetComputeNatsParams{ + HTTPClient: client, + } +} + +/* GetComputeNatsParams contains all the parameters to send to the API endpoint + for the get compute nats operation. + + Typically these are written to a http.Request. +*/ +type GetComputeNatsParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get compute nats params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeNatsParams) WithDefaults() *GetComputeNatsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get compute nats params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputeNatsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get compute nats params +func (o *GetComputeNatsParams) WithTimeout(timeout time.Duration) *GetComputeNatsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get compute nats params +func (o *GetComputeNatsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get compute nats params +func (o *GetComputeNatsParams) WithContext(ctx context.Context) *GetComputeNatsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get compute nats params +func (o *GetComputeNatsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get compute nats params +func (o *GetComputeNatsParams) WithHTTPClient(client *http.Client) *GetComputeNatsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get compute nats params +func (o *GetComputeNatsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the get compute nats params +func (o *GetComputeNatsParams) WithAPIVersion(aPIVersion *string) *GetComputeNatsParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the get compute nats params +func (o *GetComputeNatsParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetComputeNatsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/client/compute_nat/get_compute_nats_responses.go b/pkg/client/compute_nat/get_compute_nats_responses.go new file mode 100644 index 00000000..4de7605d --- /dev/null +++ b/pkg/client/compute_nat/get_compute_nats_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// GetComputeNatsReader is a Reader for the GetComputeNats structure. +type GetComputeNatsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetComputeNatsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetComputeNatsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetComputeNatsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetComputeNatsOK creates a GetComputeNatsOK with default headers values +func NewGetComputeNatsOK() *GetComputeNatsOK { + return &GetComputeNatsOK{} +} + +/* GetComputeNatsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetComputeNatsOK struct { + Payload *models.ComputeNatResult +} + +func (o *GetComputeNatsOK) Error() string { + return fmt.Sprintf("[GET /iaas/api/compute-nats][%d] getComputeNatsOK %+v", 200, o.Payload) +} +func (o *GetComputeNatsOK) GetPayload() *models.ComputeNatResult { + return o.Payload +} + +func (o *GetComputeNatsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ComputeNatResult) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetComputeNatsForbidden creates a GetComputeNatsForbidden with default headers values +func NewGetComputeNatsForbidden() *GetComputeNatsForbidden { + return &GetComputeNatsForbidden{} +} + +/* GetComputeNatsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetComputeNatsForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *GetComputeNatsForbidden) Error() string { + return fmt.Sprintf("[GET /iaas/api/compute-nats][%d] getComputeNatsForbidden %+v", 403, o.Payload) +} +func (o *GetComputeNatsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *GetComputeNatsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/compute_nat/reconfigure_nat_parameters.go b/pkg/client/compute_nat/reconfigure_nat_parameters.go new file mode 100644 index 00000000..c44d16b8 --- /dev/null +++ b/pkg/client/compute_nat/reconfigure_nat_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// NewReconfigureNatParams creates a new ReconfigureNatParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReconfigureNatParams() *ReconfigureNatParams { + return &ReconfigureNatParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReconfigureNatParamsWithTimeout creates a new ReconfigureNatParams object +// with the ability to set a timeout on a request. +func NewReconfigureNatParamsWithTimeout(timeout time.Duration) *ReconfigureNatParams { + return &ReconfigureNatParams{ + timeout: timeout, + } +} + +// NewReconfigureNatParamsWithContext creates a new ReconfigureNatParams object +// with the ability to set a context for a request. +func NewReconfigureNatParamsWithContext(ctx context.Context) *ReconfigureNatParams { + return &ReconfigureNatParams{ + Context: ctx, + } +} + +// NewReconfigureNatParamsWithHTTPClient creates a new ReconfigureNatParams object +// with the ability to set a custom HTTPClient for a request. +func NewReconfigureNatParamsWithHTTPClient(client *http.Client) *ReconfigureNatParams { + return &ReconfigureNatParams{ + HTTPClient: client, + } +} + +/* ReconfigureNatParams contains all the parameters to send to the API endpoint + for the reconfigure nat operation. + + Typically these are written to a http.Request. +*/ +type ReconfigureNatParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* Body. + + Reconfigure compute nat specification instance + */ + Body *models.ReconfigureComputeNatSpecification + + /* ID. + + The ID of the Compute Nat + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reconfigure nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureNatParams) WithDefaults() *ReconfigureNatParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reconfigure nat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureNatParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reconfigure nat params +func (o *ReconfigureNatParams) WithTimeout(timeout time.Duration) *ReconfigureNatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reconfigure nat params +func (o *ReconfigureNatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reconfigure nat params +func (o *ReconfigureNatParams) WithContext(ctx context.Context) *ReconfigureNatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reconfigure nat params +func (o *ReconfigureNatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reconfigure nat params +func (o *ReconfigureNatParams) WithHTTPClient(client *http.Client) *ReconfigureNatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reconfigure nat params +func (o *ReconfigureNatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the reconfigure nat params +func (o *ReconfigureNatParams) WithAPIVersion(aPIVersion *string) *ReconfigureNatParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the reconfigure nat params +func (o *ReconfigureNatParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithBody adds the body to the reconfigure nat params +func (o *ReconfigureNatParams) WithBody(body *models.ReconfigureComputeNatSpecification) *ReconfigureNatParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the reconfigure nat params +func (o *ReconfigureNatParams) SetBody(body *models.ReconfigureComputeNatSpecification) { + o.Body = body +} + +// WithID adds the id to the reconfigure nat params +func (o *ReconfigureNatParams) WithID(id string) *ReconfigureNatParams { + o.SetID(id) + return o +} + +// SetID adds the id to the reconfigure nat params +func (o *ReconfigureNatParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ReconfigureNatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // 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/pkg/client/compute_nat/reconfigure_nat_responses.go b/pkg/client/compute_nat/reconfigure_nat_responses.go new file mode 100644 index 00000000..858d71d4 --- /dev/null +++ b/pkg/client/compute_nat/reconfigure_nat_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package compute_nat + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// ReconfigureNatReader is a Reader for the ReconfigureNat structure. +type ReconfigureNatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReconfigureNatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewReconfigureNatAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReconfigureNatBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReconfigureNatForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReconfigureNatAccepted creates a ReconfigureNatAccepted with default headers values +func NewReconfigureNatAccepted() *ReconfigureNatAccepted { + return &ReconfigureNatAccepted{} +} + +/* ReconfigureNatAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type ReconfigureNatAccepted struct { + Payload *models.RequestTracker +} + +func (o *ReconfigureNatAccepted) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats/{id}/operations/reconfigure][%d] reconfigureNatAccepted %+v", 202, o.Payload) +} +func (o *ReconfigureNatAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *ReconfigureNatAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureNatBadRequest creates a ReconfigureNatBadRequest with default headers values +func NewReconfigureNatBadRequest() *ReconfigureNatBadRequest { + return &ReconfigureNatBadRequest{} +} + +/* ReconfigureNatBadRequest describes a response with status code 400, with default header values. + +NAT rules cannot be null +*/ +type ReconfigureNatBadRequest struct { + Payload *models.Error +} + +func (o *ReconfigureNatBadRequest) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats/{id}/operations/reconfigure][%d] reconfigureNatBadRequest %+v", 400, o.Payload) +} +func (o *ReconfigureNatBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *ReconfigureNatBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureNatForbidden creates a ReconfigureNatForbidden with default headers values +func NewReconfigureNatForbidden() *ReconfigureNatForbidden { + return &ReconfigureNatForbidden{} +} + +/* ReconfigureNatForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReconfigureNatForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *ReconfigureNatForbidden) Error() string { + return fmt.Sprintf("[POST /iaas/api/compute-nats/{id}/operations/reconfigure][%d] reconfigureNatForbidden %+v", 403, o.Payload) +} +func (o *ReconfigureNatForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *ReconfigureNatForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/content_source/content_source_client.go b/pkg/client/content_source/content_source_client.go index f8291660..a52b51c7 100644 --- a/pkg/client/content_source/content_source_client.go +++ b/pkg/client/content_source/content_source_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateContentSourceUsingPOST(params *CreateContentSourceUsingPOSTParams) (*CreateContentSourceUsingPOSTCreated, error) + CreateContentSourceUsingPOST(params *CreateContentSourceUsingPOSTParams, opts ...ClientOption) (*CreateContentSourceUsingPOSTCreated, error) - DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsingDELETEParams) (*DeleteContentSourceUsingDELETENoContent, error) + DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsingDELETEParams, opts ...ClientOption) (*DeleteContentSourceUsingDELETENoContent, error) - GetContentSourceUsingGET(params *GetContentSourceUsingGETParams) (*GetContentSourceUsingGETOK, error) + GetContentSourceUsingGET(params *GetContentSourceUsingGETParams, opts ...ClientOption) (*GetContentSourceUsingGETOK, error) - ListContentSourcesUsingGET(params *ListContentSourcesUsingGETParams) (*ListContentSourcesUsingGETOK, error) + ListContentSourcesUsingGET(params *ListContentSourcesUsingGETParams, opts ...ClientOption) (*ListContentSourcesUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { Returns the new content source */ -func (a *Client) CreateContentSourceUsingPOST(params *CreateContentSourceUsingPOSTParams) (*CreateContentSourceUsingPOSTCreated, error) { +func (a *Client) CreateContentSourceUsingPOST(params *CreateContentSourceUsingPOSTParams, opts ...ClientOption) (*CreateContentSourceUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateContentSourceUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createContentSourceUsingPOST", Method: "POST", PathPattern: "/content/api/sources", @@ -60,7 +62,12 @@ func (a *Client) CreateContentSourceUsingPOST(params *CreateContentSourceUsingPO Reader: &CreateContentSourceUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) CreateContentSourceUsingPOST(params *CreateContentSourceUsingPO /* DeleteContentSourceUsingDELETE deletes a content source */ -func (a *Client) DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsingDELETEParams) (*DeleteContentSourceUsingDELETENoContent, error) { +func (a *Client) DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsingDELETEParams, opts ...ClientOption) (*DeleteContentSourceUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteContentSourceUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteContentSourceUsingDELETE", Method: "DELETE", PathPattern: "/content/api/sources/{id}", @@ -94,7 +100,12 @@ func (a *Client) DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsing Reader: &DeleteContentSourceUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -111,13 +122,12 @@ func (a *Client) DeleteContentSourceUsingDELETE(params *DeleteContentSourceUsing /* GetContentSourceUsingGET gets a content source */ -func (a *Client) GetContentSourceUsingGET(params *GetContentSourceUsingGETParams) (*GetContentSourceUsingGETOK, error) { +func (a *Client) GetContentSourceUsingGET(params *GetContentSourceUsingGETParams, opts ...ClientOption) (*GetContentSourceUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetContentSourceUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getContentSourceUsingGET", Method: "GET", PathPattern: "/content/api/sources/{id}", @@ -128,7 +138,12 @@ func (a *Client) GetContentSourceUsingGET(params *GetContentSourceUsingGETParams Reader: &GetContentSourceUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -147,13 +162,12 @@ func (a *Client) GetContentSourceUsingGET(params *GetContentSourceUsingGETParams Use filter parameters to narrow down the results */ -func (a *Client) ListContentSourcesUsingGET(params *ListContentSourcesUsingGETParams) (*ListContentSourcesUsingGETOK, error) { +func (a *Client) ListContentSourcesUsingGET(params *ListContentSourcesUsingGETParams, opts ...ClientOption) (*ListContentSourcesUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListContentSourcesUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listContentSourcesUsingGET", Method: "GET", PathPattern: "/content/api/sources", @@ -164,7 +178,12 @@ func (a *Client) ListContentSourcesUsingGET(params *ListContentSourcesUsingGETPa Reader: &ListContentSourcesUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/content_source/create_content_source_using_post_parameters.go b/pkg/client/content_source/create_content_source_using_post_parameters.go index c38ac8c1..c06366aa 100644 --- a/pkg/client/content_source/create_content_source_using_post_parameters.go +++ b/pkg/client/content_source/create_content_source_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateContentSourceUsingPOSTParams creates a new CreateContentSourceUsingPOSTParams object -// with the default values initialized. +// NewCreateContentSourceUsingPOSTParams creates a new CreateContentSourceUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateContentSourceUsingPOSTParams() *CreateContentSourceUsingPOSTParams { - var () return &CreateContentSourceUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreateContentSourceUsingPOSTParamsWithTimeout creates a new CreateContentSourceUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateContentSourceUsingPOSTParamsWithTimeout(timeout time.Duration) *CreateContentSourceUsingPOSTParams { - var () return &CreateContentSourceUsingPOSTParams{ - timeout: timeout, } } // NewCreateContentSourceUsingPOSTParamsWithContext creates a new CreateContentSourceUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateContentSourceUsingPOSTParamsWithContext(ctx context.Context) *CreateContentSourceUsingPOSTParams { - var () return &CreateContentSourceUsingPOSTParams{ - Context: ctx, } } // NewCreateContentSourceUsingPOSTParamsWithHTTPClient creates a new CreateContentSourceUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateContentSourceUsingPOSTParamsWithHTTPClient(client *http.Client) *CreateContentSourceUsingPOSTParams { - var () return &CreateContentSourceUsingPOSTParams{ HTTPClient: client, } } -/*CreateContentSourceUsingPOSTParams contains all the parameters to send to the API endpoint -for the create content source using p o s t operation typically these are written to a http.Request +/* CreateContentSourceUsingPOSTParams contains all the parameters to send to the API endpoint + for the create content source using p o s t operation. + + Typically these are written to a http.Request. */ type CreateContentSourceUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*Source - source + /* Source. + + source */ Source *models.ContentSource @@ -78,6 +78,21 @@ type CreateContentSourceUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create content source using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateContentSourceUsingPOSTParams) WithDefaults() *CreateContentSourceUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create content source using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateContentSourceUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create content source using p o s t params func (o *CreateContentSourceUsingPOSTParams) WithTimeout(timeout time.Duration) *CreateContentSourceUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateContentSourceUsingPOSTParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Source != nil { if err := r.SetBodyParam(o.Source); err != nil { return err diff --git a/pkg/client/content_source/create_content_source_using_post_responses.go b/pkg/client/content_source/create_content_source_using_post_responses.go index f3120dd8..8cdb2ad2 100644 --- a/pkg/client/content_source/create_content_source_using_post_responses.go +++ b/pkg/client/content_source/create_content_source_using_post_responses.go @@ -41,7 +41,6 @@ func (o *CreateContentSourceUsingPOSTReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateContentSourceUsingPOSTCreated() *CreateContentSourceUsingPOSTCreat return &CreateContentSourceUsingPOSTCreated{} } -/*CreateContentSourceUsingPOSTCreated handles this case with default header values. +/* CreateContentSourceUsingPOSTCreated describes a response with status code 201, with default header values. Created content source */ @@ -63,7 +62,6 @@ type CreateContentSourceUsingPOSTCreated struct { func (o *CreateContentSourceUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /content/api/sources][%d] createContentSourceUsingPOSTCreated %+v", 201, o.Payload) } - func (o *CreateContentSourceUsingPOSTCreated) GetPayload() *models.ContentSource { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateContentSourceUsingPOSTBadRequest() *CreateContentSourceUsingPOSTBa return &CreateContentSourceUsingPOSTBadRequest{} } -/*CreateContentSourceUsingPOSTBadRequest handles this case with default header values. +/* CreateContentSourceUsingPOSTBadRequest describes a response with status code 400, with default header values. Invalid request data */ @@ -96,7 +94,6 @@ type CreateContentSourceUsingPOSTBadRequest struct { func (o *CreateContentSourceUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /content/api/sources][%d] createContentSourceUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *CreateContentSourceUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,7 +115,7 @@ func NewCreateContentSourceUsingPOSTForbidden() *CreateContentSourceUsingPOSTFor return &CreateContentSourceUsingPOSTForbidden{} } -/*CreateContentSourceUsingPOSTForbidden handles this case with default header values. +/* CreateContentSourceUsingPOSTForbidden describes a response with status code 403, with default header values. Invalid project id or integration id */ diff --git a/pkg/client/content_source/delete_content_source_using_delete_parameters.go b/pkg/client/content_source/delete_content_source_using_delete_parameters.go index bab93150..596481ef 100644 --- a/pkg/client/content_source/delete_content_source_using_delete_parameters.go +++ b/pkg/client/content_source/delete_content_source_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteContentSourceUsingDELETEParams creates a new DeleteContentSourceUsingDELETEParams object -// with the default values initialized. +// NewDeleteContentSourceUsingDELETEParams creates a new DeleteContentSourceUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteContentSourceUsingDELETEParams() *DeleteContentSourceUsingDELETEParams { - var () return &DeleteContentSourceUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteContentSourceUsingDELETEParamsWithTimeout creates a new DeleteContentSourceUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteContentSourceUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteContentSourceUsingDELETEParams { - var () return &DeleteContentSourceUsingDELETEParams{ - timeout: timeout, } } // NewDeleteContentSourceUsingDELETEParamsWithContext creates a new DeleteContentSourceUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteContentSourceUsingDELETEParamsWithContext(ctx context.Context) *DeleteContentSourceUsingDELETEParams { - var () return &DeleteContentSourceUsingDELETEParams{ - Context: ctx, } } // NewDeleteContentSourceUsingDELETEParamsWithHTTPClient creates a new DeleteContentSourceUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteContentSourceUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteContentSourceUsingDELETEParams { - var () return &DeleteContentSourceUsingDELETEParams{ HTTPClient: client, } } -/*DeleteContentSourceUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete content source using d e l e t e operation typically these are written to a http.Request +/* DeleteContentSourceUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete content source using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteContentSourceUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ID - ID of the content source + /* ID. + + ID of the content source + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteContentSourceUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete content source using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteContentSourceUsingDELETEParams) WithDefaults() *DeleteContentSourceUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete content source using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteContentSourceUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete content source using d e l e t e params func (o *DeleteContentSourceUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteContentSourceUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteContentSourceUsingDELETEParams) WriteToRequest(r runtime.ClientRe // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/content_source/delete_content_source_using_delete_responses.go b/pkg/client/content_source/delete_content_source_using_delete_responses.go index aab0cf93..9cdc2741 100644 --- a/pkg/client/content_source/delete_content_source_using_delete_responses.go +++ b/pkg/client/content_source/delete_content_source_using_delete_responses.go @@ -26,7 +26,6 @@ func (o *DeleteContentSourceUsingDELETEReader) ReadResponse(response runtime.Cli return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -37,7 +36,7 @@ func NewDeleteContentSourceUsingDELETENoContent() *DeleteContentSourceUsingDELET return &DeleteContentSourceUsingDELETENoContent{} } -/*DeleteContentSourceUsingDELETENoContent handles this case with default header values. +/* DeleteContentSourceUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ diff --git a/pkg/client/content_source/get_content_source_using_get_parameters.go b/pkg/client/content_source/get_content_source_using_get_parameters.go index 729ce897..76797fe2 100644 --- a/pkg/client/content_source/get_content_source_using_get_parameters.go +++ b/pkg/client/content_source/get_content_source_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetContentSourceUsingGETParams creates a new GetContentSourceUsingGETParams object -// with the default values initialized. +// NewGetContentSourceUsingGETParams creates a new GetContentSourceUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetContentSourceUsingGETParams() *GetContentSourceUsingGETParams { - var () return &GetContentSourceUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetContentSourceUsingGETParamsWithTimeout creates a new GetContentSourceUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetContentSourceUsingGETParamsWithTimeout(timeout time.Duration) *GetContentSourceUsingGETParams { - var () return &GetContentSourceUsingGETParams{ - timeout: timeout, } } // NewGetContentSourceUsingGETParamsWithContext creates a new GetContentSourceUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetContentSourceUsingGETParamsWithContext(ctx context.Context) *GetContentSourceUsingGETParams { - var () return &GetContentSourceUsingGETParams{ - Context: ctx, } } // NewGetContentSourceUsingGETParamsWithHTTPClient creates a new GetContentSourceUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetContentSourceUsingGETParamsWithHTTPClient(client *http.Client) *GetContentSourceUsingGETParams { - var () return &GetContentSourceUsingGETParams{ HTTPClient: client, } } -/*GetContentSourceUsingGETParams contains all the parameters to send to the API endpoint -for the get content source using g e t operation typically these are written to a http.Request +/* GetContentSourceUsingGETParams contains all the parameters to send to the API endpoint + for the get content source using g e t operation. + + Typically these are written to a http.Request. */ type GetContentSourceUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ID - ID of the content source + /* ID. + + ID of the content source + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetContentSourceUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get content source using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContentSourceUsingGETParams) WithDefaults() *GetContentSourceUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get content source using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContentSourceUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get content source using get params func (o *GetContentSourceUsingGETParams) WithTimeout(timeout time.Duration) *GetContentSourceUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetContentSourceUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/content_source/get_content_source_using_get_responses.go b/pkg/client/content_source/get_content_source_using_get_responses.go index 93ad5ed2..bf3c98ef 100644 --- a/pkg/client/content_source/get_content_source_using_get_responses.go +++ b/pkg/client/content_source/get_content_source_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetContentSourceUsingGETReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetContentSourceUsingGETOK() *GetContentSourceUsingGETOK { return &GetContentSourceUsingGETOK{} } -/*GetContentSourceUsingGETOK handles this case with default header values. +/* GetContentSourceUsingGETOK describes a response with status code 200, with default header values. Content source */ @@ -57,7 +56,6 @@ type GetContentSourceUsingGETOK struct { func (o *GetContentSourceUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/sources/{id}][%d] getContentSourceUsingGETOK %+v", 200, o.Payload) } - func (o *GetContentSourceUsingGETOK) GetPayload() *models.ContentSource { return o.Payload } @@ -79,7 +77,7 @@ func NewGetContentSourceUsingGETNotFound() *GetContentSourceUsingGETNotFound { return &GetContentSourceUsingGETNotFound{} } -/*GetContentSourceUsingGETNotFound handles this case with default header values. +/* GetContentSourceUsingGETNotFound describes a response with status code 404, with default header values. Content source not found */ @@ -90,7 +88,6 @@ type GetContentSourceUsingGETNotFound struct { func (o *GetContentSourceUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /content/api/sources/{id}][%d] getContentSourceUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetContentSourceUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/content_source/list_content_sources_using_get_parameters.go b/pkg/client/content_source/list_content_sources_using_get_parameters.go index 20c5050c..ae2c2422 100644 --- a/pkg/client/content_source/list_content_sources_using_get_parameters.go +++ b/pkg/client/content_source/list_content_sources_using_get_parameters.go @@ -17,93 +17,100 @@ import ( "github.com/go-openapi/swag" ) -// NewListContentSourcesUsingGETParams creates a new ListContentSourcesUsingGETParams object -// with the default values initialized. +// NewListContentSourcesUsingGETParams creates a new ListContentSourcesUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListContentSourcesUsingGETParams() *ListContentSourcesUsingGETParams { - var () return &ListContentSourcesUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewListContentSourcesUsingGETParamsWithTimeout creates a new ListContentSourcesUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListContentSourcesUsingGETParamsWithTimeout(timeout time.Duration) *ListContentSourcesUsingGETParams { - var () return &ListContentSourcesUsingGETParams{ - timeout: timeout, } } // NewListContentSourcesUsingGETParamsWithContext creates a new ListContentSourcesUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListContentSourcesUsingGETParamsWithContext(ctx context.Context) *ListContentSourcesUsingGETParams { - var () return &ListContentSourcesUsingGETParams{ - Context: ctx, } } // NewListContentSourcesUsingGETParamsWithHTTPClient creates a new ListContentSourcesUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListContentSourcesUsingGETParamsWithHTTPClient(client *http.Client) *ListContentSourcesUsingGETParams { - var () return &ListContentSourcesUsingGETParams{ HTTPClient: client, } } -/*ListContentSourcesUsingGETParams contains all the parameters to send to the API endpoint -for the list content sources using g e t operation typically these are written to a http.Request +/* ListContentSourcesUsingGETParams contains all the parameters to send to the API endpoint + for the list content sources using g e t operation. + + Typically these are written to a http.Request. */ type ListContentSourcesUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentType - Search based on Content Type + /* ContentType. + + Search based on Content Type */ ContentType *string - /*IntegrationID - Search based on integrationId + /* IntegrationID. + + Search based on integrationId */ IntegrationID *string - /*Name - Search based on Content Source name + /* Name. + + Search based on Content Source name */ Name *string - /*ProjectIds - Search based on associated projects + /* ProjectIds. + + Search based on associated projects */ ProjectIds []string - /*Repository - Search based on repository + /* Repository. + + Search based on repository */ Repository *string - /*Search - Search based on name or repository + /* Search. + + Search based on name or repository */ Search *string - /*SyncEnabled - Search based on whether sync is enabled or not + /* SyncEnabled. + + Search based on whether sync is enabled or not */ SyncEnabled *bool - /*TypeIds - Search based on Content Source Type Ids + /* TypeIds. + + Search based on Content Source Type Ids */ TypeIds []string @@ -112,6 +119,21 @@ type ListContentSourcesUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list content sources using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListContentSourcesUsingGETParams) WithDefaults() *ListContentSourcesUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list content sources using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListContentSourcesUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list content sources using get params func (o *ListContentSourcesUsingGETParams) WithTimeout(timeout time.Duration) *ListContentSourcesUsingGETParams { o.SetTimeout(timeout) @@ -256,128 +278,141 @@ func (o *ListContentSourcesUsingGETParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ContentType != nil { // query param contentType var qrContentType string + if o.ContentType != nil { qrContentType = *o.ContentType } qContentType := qrContentType if qContentType != "" { + if err := r.SetQueryParam("contentType", qContentType); err != nil { return err } } - } if o.IntegrationID != nil { // query param integrationId var qrIntegrationID string + if o.IntegrationID != nil { qrIntegrationID = *o.IntegrationID } qIntegrationID := qrIntegrationID if qIntegrationID != "" { + if err := r.SetQueryParam("integrationId", qIntegrationID); 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 } } - } - valuesProjectIds := o.ProjectIds + if o.ProjectIds != nil { - joinedProjectIds := swag.JoinByFormat(valuesProjectIds, "multi") - // query array param projectIds - if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { - return err + // binding items for projectIds + joinedProjectIds := o.bindParamProjectIds(reg) + + // query array param projectIds + if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { + return err + } } if o.Repository != nil { // query param repository var qrRepository string + if o.Repository != nil { qrRepository = *o.Repository } qRepository := qrRepository if qRepository != "" { + if err := r.SetQueryParam("repository", qRepository); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if o.SyncEnabled != nil { // query param syncEnabled var qrSyncEnabled bool + if o.SyncEnabled != nil { qrSyncEnabled = *o.SyncEnabled } qSyncEnabled := swag.FormatBool(qrSyncEnabled) if qSyncEnabled != "" { + if err := r.SetQueryParam("syncEnabled", qSyncEnabled); err != nil { return err } } - } - valuesTypeIds := o.TypeIds + if o.TypeIds != nil { - joinedTypeIds := swag.JoinByFormat(valuesTypeIds, "multi") - // query array param typeIds - if err := r.SetQueryParam("typeIds", joinedTypeIds...); err != nil { - return err + // binding items for typeIds + joinedTypeIds := o.bindParamTypeIds(reg) + + // query array param typeIds + if err := r.SetQueryParam("typeIds", joinedTypeIds...); err != nil { + return err + } } if len(res) > 0 { @@ -385,3 +420,37 @@ func (o *ListContentSourcesUsingGETParams) WriteToRequest(r runtime.ClientReques } return nil } + +// bindParamListContentSourcesUsingGET binds the parameter projectIds +func (o *ListContentSourcesUsingGETParams) bindParamProjectIds(formats strfmt.Registry) []string { + projectIdsIR := o.ProjectIds + + var projectIdsIC []string + for _, projectIdsIIR := range projectIdsIR { // explode []string + + projectIdsIIV := projectIdsIIR // string as string + projectIdsIC = append(projectIdsIC, projectIdsIIV) + } + + // items.CollectionFormat: "multi" + projectIdsIS := swag.JoinByFormat(projectIdsIC, "multi") + + return projectIdsIS +} + +// bindParamListContentSourcesUsingGET binds the parameter typeIds +func (o *ListContentSourcesUsingGETParams) bindParamTypeIds(formats strfmt.Registry) []string { + typeIdsIR := o.TypeIds + + var typeIdsIC []string + for _, typeIdsIIR := range typeIdsIR { // explode []string + + typeIdsIIV := typeIdsIIR // string as string + typeIdsIC = append(typeIdsIC, typeIdsIIV) + } + + // items.CollectionFormat: "multi" + typeIdsIS := swag.JoinByFormat(typeIdsIC, "multi") + + return typeIdsIS +} diff --git a/pkg/client/content_source/list_content_sources_using_get_responses.go b/pkg/client/content_source/list_content_sources_using_get_responses.go index 80884834..e70692fc 100644 --- a/pkg/client/content_source/list_content_sources_using_get_responses.go +++ b/pkg/client/content_source/list_content_sources_using_get_responses.go @@ -29,7 +29,6 @@ func (o *ListContentSourcesUsingGETReader) ReadResponse(response runtime.ClientR return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewListContentSourcesUsingGETOK() *ListContentSourcesUsingGETOK { return &ListContentSourcesUsingGETOK{} } -/*ListContentSourcesUsingGETOK handles this case with default header values. +/* ListContentSourcesUsingGETOK describes a response with status code 200, with default header values. Content sources */ @@ -51,7 +50,6 @@ type ListContentSourcesUsingGETOK struct { func (o *ListContentSourcesUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/sources][%d] listContentSourcesUsingGETOK %+v", 200, o.Payload) } - func (o *ListContentSourcesUsingGETOK) GetPayload() *models.ContentSources { return o.Payload } diff --git a/pkg/client/data_collector/create_data_collector_parameters.go b/pkg/client/data_collector/create_data_collector_parameters.go index f7877e13..993c4497 100644 --- a/pkg/client/data_collector/create_data_collector_parameters.go +++ b/pkg/client/data_collector/create_data_collector_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreateDataCollectorParams creates a new CreateDataCollectorParams object -// with the default values initialized. +// NewCreateDataCollectorParams creates a new CreateDataCollectorParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateDataCollectorParams() *CreateDataCollectorParams { - var () return &CreateDataCollectorParams{ - timeout: cr.DefaultTimeout, } } // NewCreateDataCollectorParamsWithTimeout creates a new CreateDataCollectorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateDataCollectorParamsWithTimeout(timeout time.Duration) *CreateDataCollectorParams { - var () return &CreateDataCollectorParams{ - timeout: timeout, } } // NewCreateDataCollectorParamsWithContext creates a new CreateDataCollectorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateDataCollectorParamsWithContext(ctx context.Context) *CreateDataCollectorParams { - var () return &CreateDataCollectorParams{ - Context: ctx, } } // NewCreateDataCollectorParamsWithHTTPClient creates a new CreateDataCollectorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateDataCollectorParamsWithHTTPClient(client *http.Client) *CreateDataCollectorParams { - var () return &CreateDataCollectorParams{ HTTPClient: client, } } -/*CreateDataCollectorParams contains all the parameters to send to the API endpoint -for the create data collector operation typically these are written to a http.Request +/* CreateDataCollectorParams contains all the parameters to send to the API endpoint + for the create data collector operation. + + Typically these are written to a http.Request. */ type CreateDataCollectorParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type CreateDataCollectorParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDataCollectorParams) WithDefaults() *CreateDataCollectorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDataCollectorParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create data collector params func (o *CreateDataCollectorParams) WithTimeout(timeout time.Duration) *CreateDataCollectorParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *CreateDataCollectorParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/data_collector/create_data_collector_responses.go b/pkg/client/data_collector/create_data_collector_responses.go index 09660694..2e996205 100644 --- a/pkg/client/data_collector/create_data_collector_responses.go +++ b/pkg/client/data_collector/create_data_collector_responses.go @@ -41,7 +41,6 @@ func (o *CreateDataCollectorReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateDataCollectorCreated() *CreateDataCollectorCreated { return &CreateDataCollectorCreated{} } -/*CreateDataCollectorCreated handles this case with default header values. +/* CreateDataCollectorCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateDataCollectorCreated struct { func (o *CreateDataCollectorCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/data-collectors][%d] createDataCollectorCreated %+v", 201, o.Payload) } - func (o *CreateDataCollectorCreated) GetPayload() *models.DataCollectorRegistration { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateDataCollectorBadRequest() *CreateDataCollectorBadRequest { return &CreateDataCollectorBadRequest{} } -/*CreateDataCollectorBadRequest handles this case with default header values. +/* CreateDataCollectorBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateDataCollectorBadRequest struct { func (o *CreateDataCollectorBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/data-collectors][%d] createDataCollectorBadRequest %+v", 400, o.Payload) } - func (o *CreateDataCollectorBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateDataCollectorForbidden() *CreateDataCollectorForbidden { return &CreateDataCollectorForbidden{} } -/*CreateDataCollectorForbidden handles this case with default header values. +/* CreateDataCollectorForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateDataCollectorForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateDataCollectorForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/data-collectors][%d] createDataCollectorForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/data-collectors][%d] createDataCollectorForbidden %+v", 403, o.Payload) +} +func (o *CreateDataCollectorForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateDataCollectorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/data_collector/data_collector_client.go b/pkg/client/data_collector/data_collector_client.go index 2801b7df..9b577f5e 100644 --- a/pkg/client/data_collector/data_collector_client.go +++ b/pkg/client/data_collector/data_collector_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateDataCollector(params *CreateDataCollectorParams) (*CreateDataCollectorCreated, error) + CreateDataCollector(params *CreateDataCollectorParams, opts ...ClientOption) (*CreateDataCollectorCreated, error) - DeleteDataCollector(params *DeleteDataCollectorParams) (*DeleteDataCollectorNoContent, error) + DeleteDataCollector(params *DeleteDataCollectorParams, opts ...ClientOption) (*DeleteDataCollectorNoContent, error) - GetDataCollector(params *GetDataCollectorParams) (*GetDataCollectorOK, error) + GetDataCollector(params *GetDataCollectorParams, opts ...ClientOption) (*GetDataCollectorOK, error) - GetDataCollectors(params *GetDataCollectorsParams) (*GetDataCollectorsOK, error) + GetDataCollectors(params *GetDataCollectorsParams, opts ...ClientOption) (*GetDataCollectorsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { Note: Data collector endpoints are not available in vRA on-prem release. */ -func (a *Client) CreateDataCollector(params *CreateDataCollectorParams) (*CreateDataCollectorCreated, error) { +func (a *Client) CreateDataCollector(params *CreateDataCollectorParams, opts ...ClientOption) (*CreateDataCollectorCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateDataCollectorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createDataCollector", Method: "POST", PathPattern: "/iaas/api/data-collectors", @@ -62,7 +64,12 @@ func (a *Client) CreateDataCollector(params *CreateDataCollectorParams) (*Create Reader: &CreateDataCollectorReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -83,13 +90,12 @@ func (a *Client) CreateDataCollector(params *CreateDataCollectorParams) (*Create Note: Data collector endpoints are not available in vRA on-prem release. */ -func (a *Client) DeleteDataCollector(params *DeleteDataCollectorParams) (*DeleteDataCollectorNoContent, error) { +func (a *Client) DeleteDataCollector(params *DeleteDataCollectorParams, opts ...ClientOption) (*DeleteDataCollectorNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteDataCollectorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteDataCollector", Method: "DELETE", PathPattern: "/iaas/api/data-collectors/{id}", @@ -100,7 +106,12 @@ func (a *Client) DeleteDataCollector(params *DeleteDataCollectorParams) (*Delete Reader: &DeleteDataCollectorReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) DeleteDataCollector(params *DeleteDataCollectorParams) (*Delete Note: Data collector endpoints are not available in vRA on-prem release. */ -func (a *Client) GetDataCollector(params *GetDataCollectorParams) (*GetDataCollectorOK, error) { +func (a *Client) GetDataCollector(params *GetDataCollectorParams, opts ...ClientOption) (*GetDataCollectorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDataCollectorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDataCollector", Method: "GET", PathPattern: "/iaas/api/data-collectors/{id}", @@ -138,7 +148,12 @@ func (a *Client) GetDataCollector(params *GetDataCollectorParams) (*GetDataColle Reader: &GetDataCollectorReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -159,13 +174,12 @@ func (a *Client) GetDataCollector(params *GetDataCollectorParams) (*GetDataColle Note: Data collector endpoints are not available in vRA on-prem release. */ -func (a *Client) GetDataCollectors(params *GetDataCollectorsParams) (*GetDataCollectorsOK, error) { +func (a *Client) GetDataCollectors(params *GetDataCollectorsParams, opts ...ClientOption) (*GetDataCollectorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDataCollectorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDataCollectors", Method: "GET", PathPattern: "/iaas/api/data-collectors", @@ -176,7 +190,12 @@ func (a *Client) GetDataCollectors(params *GetDataCollectorsParams) (*GetDataCol Reader: &GetDataCollectorsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/data_collector/delete_data_collector_parameters.go b/pkg/client/data_collector/delete_data_collector_parameters.go index 8a428aca..8497850c 100644 --- a/pkg/client/data_collector/delete_data_collector_parameters.go +++ b/pkg/client/data_collector/delete_data_collector_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteDataCollectorParams creates a new DeleteDataCollectorParams object -// with the default values initialized. +// NewDeleteDataCollectorParams creates a new DeleteDataCollectorParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteDataCollectorParams() *DeleteDataCollectorParams { - var () return &DeleteDataCollectorParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteDataCollectorParamsWithTimeout creates a new DeleteDataCollectorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteDataCollectorParamsWithTimeout(timeout time.Duration) *DeleteDataCollectorParams { - var () return &DeleteDataCollectorParams{ - timeout: timeout, } } // NewDeleteDataCollectorParamsWithContext creates a new DeleteDataCollectorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteDataCollectorParamsWithContext(ctx context.Context) *DeleteDataCollectorParams { - var () return &DeleteDataCollectorParams{ - Context: ctx, } } // NewDeleteDataCollectorParamsWithHTTPClient creates a new DeleteDataCollectorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteDataCollectorParamsWithHTTPClient(client *http.Client) *DeleteDataCollectorParams { - var () return &DeleteDataCollectorParams{ HTTPClient: client, } } -/*DeleteDataCollectorParams contains all the parameters to send to the API endpoint -for the delete data collector operation typically these are written to a http.Request +/* DeleteDataCollectorParams contains all the parameters to send to the API endpoint + for the delete data collector operation. + + Typically these are written to a http.Request. */ type DeleteDataCollectorParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Data Collector. + /* ID. + + The ID of the Data Collector. */ ID string @@ -76,6 +76,21 @@ type DeleteDataCollectorParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDataCollectorParams) WithDefaults() *DeleteDataCollectorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDataCollectorParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete data collector params func (o *DeleteDataCollectorParams) WithTimeout(timeout time.Duration) *DeleteDataCollectorParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteDataCollectorParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/data_collector/delete_data_collector_responses.go b/pkg/client/data_collector/delete_data_collector_responses.go index ceabac59..aadec2d2 100644 --- a/pkg/client/data_collector/delete_data_collector_responses.go +++ b/pkg/client/data_collector/delete_data_collector_responses.go @@ -7,9 +7,12 @@ package data_collector import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteDataCollectorReader is a Reader for the DeleteDataCollector structure. @@ -32,7 +35,6 @@ func (o *DeleteDataCollectorReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteDataCollectorNoContent() *DeleteDataCollectorNoContent { return &DeleteDataCollectorNoContent{} } -/*DeleteDataCollectorNoContent handles this case with default header values. +/* DeleteDataCollectorNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteDataCollectorForbidden() *DeleteDataCollectorForbidden { return &DeleteDataCollectorForbidden{} } -/*DeleteDataCollectorForbidden handles this case with default header values. +/* DeleteDataCollectorForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteDataCollectorForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteDataCollectorForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/data-collectors/{id}][%d] deleteDataCollectorForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/data-collectors/{id}][%d] deleteDataCollectorForbidden %+v", 403, o.Payload) +} +func (o *DeleteDataCollectorForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteDataCollectorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/data_collector/get_data_collector_parameters.go b/pkg/client/data_collector/get_data_collector_parameters.go index be67e17b..cf3da2b0 100644 --- a/pkg/client/data_collector/get_data_collector_parameters.go +++ b/pkg/client/data_collector/get_data_collector_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDataCollectorParams creates a new GetDataCollectorParams object -// with the default values initialized. +// NewGetDataCollectorParams creates a new GetDataCollectorParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDataCollectorParams() *GetDataCollectorParams { - var () return &GetDataCollectorParams{ - timeout: cr.DefaultTimeout, } } // NewGetDataCollectorParamsWithTimeout creates a new GetDataCollectorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDataCollectorParamsWithTimeout(timeout time.Duration) *GetDataCollectorParams { - var () return &GetDataCollectorParams{ - timeout: timeout, } } // NewGetDataCollectorParamsWithContext creates a new GetDataCollectorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDataCollectorParamsWithContext(ctx context.Context) *GetDataCollectorParams { - var () return &GetDataCollectorParams{ - Context: ctx, } } // NewGetDataCollectorParamsWithHTTPClient creates a new GetDataCollectorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDataCollectorParamsWithHTTPClient(client *http.Client) *GetDataCollectorParams { - var () return &GetDataCollectorParams{ HTTPClient: client, } } -/*GetDataCollectorParams contains all the parameters to send to the API endpoint -for the get data collector operation typically these are written to a http.Request +/* GetDataCollectorParams contains all the parameters to send to the API endpoint + for the get data collector operation. + + Typically these are written to a http.Request. */ type GetDataCollectorParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Data Collector. + /* ID. + + The ID of the Data Collector. */ ID string @@ -76,6 +76,21 @@ type GetDataCollectorParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataCollectorParams) WithDefaults() *GetDataCollectorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get data collector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataCollectorParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get data collector params func (o *GetDataCollectorParams) WithTimeout(timeout time.Duration) *GetDataCollectorParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetDataCollectorParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/data_collector/get_data_collector_responses.go b/pkg/client/data_collector/get_data_collector_responses.go index 147da2e8..f477bc5d 100644 --- a/pkg/client/data_collector/get_data_collector_responses.go +++ b/pkg/client/data_collector/get_data_collector_responses.go @@ -41,7 +41,6 @@ func (o *GetDataCollectorReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDataCollectorOK() *GetDataCollectorOK { return &GetDataCollectorOK{} } -/*GetDataCollectorOK handles this case with default header values. +/* GetDataCollectorOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetDataCollectorOK struct { func (o *GetDataCollectorOK) Error() string { return fmt.Sprintf("[GET /iaas/api/data-collectors/{id}][%d] getDataCollectorOK %+v", 200, o.Payload) } - func (o *GetDataCollectorOK) GetPayload() *models.DataCollector { return o.Payload } @@ -85,19 +83,30 @@ func NewGetDataCollectorForbidden() *GetDataCollectorForbidden { return &GetDataCollectorForbidden{} } -/*GetDataCollectorForbidden handles this case with default header values. +/* GetDataCollectorForbidden describes a response with status code 403, with default header values. Forbidden */ type GetDataCollectorForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetDataCollectorForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/data-collectors/{id}][%d] getDataCollectorForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/data-collectors/{id}][%d] getDataCollectorForbidden %+v", 403, o.Payload) +} +func (o *GetDataCollectorForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetDataCollectorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetDataCollectorNotFound() *GetDataCollectorNotFound { return &GetDataCollectorNotFound{} } -/*GetDataCollectorNotFound handles this case with default header values. +/* GetDataCollectorNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetDataCollectorNotFound struct { func (o *GetDataCollectorNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/data-collectors/{id}][%d] getDataCollectorNotFound %+v", 404, o.Payload) } - func (o *GetDataCollectorNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/data_collector/get_data_collectors_parameters.go b/pkg/client/data_collector/get_data_collectors_parameters.go index 8f0dc79f..4d271199 100644 --- a/pkg/client/data_collector/get_data_collectors_parameters.go +++ b/pkg/client/data_collector/get_data_collectors_parameters.go @@ -17,58 +17,58 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDataCollectorsParams creates a new GetDataCollectorsParams object -// with the default values initialized. +// NewGetDataCollectorsParams creates a new GetDataCollectorsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDataCollectorsParams() *GetDataCollectorsParams { - var () return &GetDataCollectorsParams{ - timeout: cr.DefaultTimeout, } } // NewGetDataCollectorsParamsWithTimeout creates a new GetDataCollectorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDataCollectorsParamsWithTimeout(timeout time.Duration) *GetDataCollectorsParams { - var () return &GetDataCollectorsParams{ - timeout: timeout, } } // NewGetDataCollectorsParamsWithContext creates a new GetDataCollectorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDataCollectorsParamsWithContext(ctx context.Context) *GetDataCollectorsParams { - var () return &GetDataCollectorsParams{ - Context: ctx, } } // NewGetDataCollectorsParamsWithHTTPClient creates a new GetDataCollectorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDataCollectorsParamsWithHTTPClient(client *http.Client) *GetDataCollectorsParams { - var () return &GetDataCollectorsParams{ HTTPClient: client, } } -/*GetDataCollectorsParams contains all the parameters to send to the API endpoint -for the get data collectors operation typically these are written to a http.Request +/* GetDataCollectorsParams contains all the parameters to send to the API endpoint + for the get data collectors operation. + + Typically these are written to a http.Request. */ type GetDataCollectorsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Disabled - If query param is provided with value equals to true, only disabled data collectors will be retrieved. + /* Disabled. + + If query param is provided with value equals to true, only disabled data collectors will be retrieved. */ Disabled *bool @@ -77,6 +77,21 @@ type GetDataCollectorsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get data collectors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataCollectorsParams) WithDefaults() *GetDataCollectorsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get data collectors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataCollectorsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get data collectors params func (o *GetDataCollectorsParams) WithTimeout(timeout time.Duration) *GetDataCollectorsParams { o.SetTimeout(timeout) @@ -144,32 +159,34 @@ func (o *GetDataCollectorsParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Disabled != nil { // query param disabled var qrDisabled bool + if o.Disabled != nil { qrDisabled = *o.Disabled } qDisabled := swag.FormatBool(qrDisabled) if qDisabled != "" { + if err := r.SetQueryParam("disabled", qDisabled); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/data_collector/get_data_collectors_responses.go b/pkg/client/data_collector/get_data_collectors_responses.go index e4652c6d..c2d0e306 100644 --- a/pkg/client/data_collector/get_data_collectors_responses.go +++ b/pkg/client/data_collector/get_data_collectors_responses.go @@ -35,7 +35,6 @@ func (o *GetDataCollectorsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDataCollectorsOK() *GetDataCollectorsOK { return &GetDataCollectorsOK{} } -/*GetDataCollectorsOK handles this case with default header values. +/* GetDataCollectorsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetDataCollectorsOK struct { func (o *GetDataCollectorsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/data-collectors][%d] getDataCollectorsOK %+v", 200, o.Payload) } - func (o *GetDataCollectorsOK) GetPayload() *models.DataCollectorResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetDataCollectorsForbidden() *GetDataCollectorsForbidden { return &GetDataCollectorsForbidden{} } -/*GetDataCollectorsForbidden handles this case with default header values. +/* GetDataCollectorsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetDataCollectorsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetDataCollectorsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/data-collectors][%d] getDataCollectorsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/data-collectors][%d] getDataCollectorsForbidden %+v", 403, o.Payload) +} +func (o *GetDataCollectorsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetDataCollectorsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/deployment/create_deployment_parameters.go b/pkg/client/deployment/create_deployment_parameters.go index eb0d3216..db0f504a 100644 --- a/pkg/client/deployment/create_deployment_parameters.go +++ b/pkg/client/deployment/create_deployment_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateDeploymentParams creates a new CreateDeploymentParams object -// with the default values initialized. +// NewCreateDeploymentParams creates a new CreateDeploymentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateDeploymentParams() *CreateDeploymentParams { - var () return &CreateDeploymentParams{ - timeout: cr.DefaultTimeout, } } // NewCreateDeploymentParamsWithTimeout creates a new CreateDeploymentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateDeploymentParamsWithTimeout(timeout time.Duration) *CreateDeploymentParams { - var () return &CreateDeploymentParams{ - timeout: timeout, } } // NewCreateDeploymentParamsWithContext creates a new CreateDeploymentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateDeploymentParamsWithContext(ctx context.Context) *CreateDeploymentParams { - var () return &CreateDeploymentParams{ - Context: ctx, } } // NewCreateDeploymentParamsWithHTTPClient creates a new CreateDeploymentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateDeploymentParamsWithHTTPClient(client *http.Client) *CreateDeploymentParams { - var () return &CreateDeploymentParams{ HTTPClient: client, } } -/*CreateDeploymentParams contains all the parameters to send to the API endpoint -for the create deployment operation typically these are written to a http.Request +/* CreateDeploymentParams contains all the parameters to send to the API endpoint + for the create deployment operation. + + Typically these are written to a http.Request. */ type CreateDeploymentParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Deployment specification instance + /* Body. + + Deployment specification instance */ Body *models.DeploymentSpecification @@ -78,6 +78,21 @@ type CreateDeploymentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDeploymentParams) WithDefaults() *CreateDeploymentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDeploymentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create deployment params func (o *CreateDeploymentParams) WithTimeout(timeout time.Duration) *CreateDeploymentParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateDeploymentParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/deployment/create_deployment_responses.go b/pkg/client/deployment/create_deployment_responses.go index f6dc332c..10bfe2c4 100644 --- a/pkg/client/deployment/create_deployment_responses.go +++ b/pkg/client/deployment/create_deployment_responses.go @@ -41,7 +41,6 @@ func (o *CreateDeploymentReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateDeploymentCreated() *CreateDeploymentCreated { return &CreateDeploymentCreated{} } -/*CreateDeploymentCreated handles this case with default header values. +/* CreateDeploymentCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateDeploymentCreated struct { func (o *CreateDeploymentCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/deployments][%d] createDeploymentCreated %+v", 201, o.Payload) } - func (o *CreateDeploymentCreated) GetPayload() *models.IaaSDeployment { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateDeploymentBadRequest() *CreateDeploymentBadRequest { return &CreateDeploymentBadRequest{} } -/*CreateDeploymentBadRequest handles this case with default header values. +/* CreateDeploymentBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateDeploymentBadRequest struct { func (o *CreateDeploymentBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/deployments][%d] createDeploymentBadRequest %+v", 400, o.Payload) } - func (o *CreateDeploymentBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateDeploymentForbidden() *CreateDeploymentForbidden { return &CreateDeploymentForbidden{} } -/*CreateDeploymentForbidden handles this case with default header values. +/* CreateDeploymentForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateDeploymentForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateDeploymentForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/deployments][%d] createDeploymentForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/deployments][%d] createDeploymentForbidden %+v", 403, o.Payload) +} +func (o *CreateDeploymentForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateDeploymentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/deployment/delete_deployment_parameters.go b/pkg/client/deployment/delete_deployment_parameters.go index 67040d38..bdeb9369 100644 --- a/pkg/client/deployment/delete_deployment_parameters.go +++ b/pkg/client/deployment/delete_deployment_parameters.go @@ -14,60 +14,67 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewDeleteDeploymentParams creates a new DeleteDeploymentParams object -// with the default values initialized. +// NewDeleteDeploymentParams creates a new DeleteDeploymentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteDeploymentParams() *DeleteDeploymentParams { - var () return &DeleteDeploymentParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteDeploymentParamsWithTimeout creates a new DeleteDeploymentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteDeploymentParamsWithTimeout(timeout time.Duration) *DeleteDeploymentParams { - var () return &DeleteDeploymentParams{ - timeout: timeout, } } // NewDeleteDeploymentParamsWithContext creates a new DeleteDeploymentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteDeploymentParamsWithContext(ctx context.Context) *DeleteDeploymentParams { - var () return &DeleteDeploymentParams{ - Context: ctx, } } // NewDeleteDeploymentParamsWithHTTPClient creates a new DeleteDeploymentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteDeploymentParamsWithHTTPClient(client *http.Client) *DeleteDeploymentParams { - var () return &DeleteDeploymentParams{ HTTPClient: client, } } -/*DeleteDeploymentParams contains all the parameters to send to the API endpoint -for the delete deployment operation typically these are written to a http.Request +/* DeleteDeploymentParams contains all the parameters to send to the API endpoint + for the delete deployment operation. + + Typically these are written to a http.Request. */ type DeleteDeploymentParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the deployment. + /* ForceDelete. + + If true, best effort is made for deleting this deployment and all related resources. In some situations, this may leave provisioned infrastructure resources behind. Please ensure you remove them manually. If false, a standard delete action will be executed. + */ + ForceDelete *bool + + /* ID. + + The id of the deployment. */ ID string @@ -76,6 +83,21 @@ type DeleteDeploymentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentParams) WithDefaults() *DeleteDeploymentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete deployment params func (o *DeleteDeploymentParams) WithTimeout(timeout time.Duration) *DeleteDeploymentParams { o.SetTimeout(timeout) @@ -120,6 +142,17 @@ func (o *DeleteDeploymentParams) SetAPIVersion(aPIVersion *string) { o.APIVersion = aPIVersion } +// WithForceDelete adds the forceDelete to the delete deployment params +func (o *DeleteDeploymentParams) WithForceDelete(forceDelete *bool) *DeleteDeploymentParams { + o.SetForceDelete(forceDelete) + return o +} + +// SetForceDelete adds the forceDelete to the delete deployment params +func (o *DeleteDeploymentParams) SetForceDelete(forceDelete *bool) { + o.ForceDelete = forceDelete +} + // WithID adds the id to the delete deployment params func (o *DeleteDeploymentParams) WithID(id string) *DeleteDeploymentParams { o.SetID(id) @@ -143,16 +176,34 @@ func (o *DeleteDeploymentParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } + } + + if o.ForceDelete != nil { + + // query param forceDelete + var qrForceDelete bool + + if o.ForceDelete != nil { + qrForceDelete = *o.ForceDelete + } + qForceDelete := swag.FormatBool(qrForceDelete) + if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { + return err + } + } } // path param id diff --git a/pkg/client/deployment/delete_deployment_responses.go b/pkg/client/deployment/delete_deployment_responses.go index 268fe997..67a731a3 100644 --- a/pkg/client/deployment/delete_deployment_responses.go +++ b/pkg/client/deployment/delete_deployment_responses.go @@ -35,7 +35,6 @@ func (o *DeleteDeploymentReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteDeploymentAccepted() *DeleteDeploymentAccepted { return &DeleteDeploymentAccepted{} } -/*DeleteDeploymentAccepted handles this case with default header values. +/* DeleteDeploymentAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteDeploymentAccepted struct { func (o *DeleteDeploymentAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/deployments/{id}][%d] deleteDeploymentAccepted %+v", 202, o.Payload) } - func (o *DeleteDeploymentAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteDeploymentForbidden() *DeleteDeploymentForbidden { return &DeleteDeploymentForbidden{} } -/*DeleteDeploymentForbidden handles this case with default header values. +/* DeleteDeploymentForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteDeploymentForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteDeploymentForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/deployments/{id}][%d] deleteDeploymentForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/deployments/{id}][%d] deleteDeploymentForbidden %+v", 403, o.Payload) +} +func (o *DeleteDeploymentForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteDeploymentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/deployment/deployment_client.go b/pkg/client/deployment/deployment_client.go index ea4e4317..10db46d2 100644 --- a/pkg/client/deployment/deployment_client.go +++ b/pkg/client/deployment/deployment_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateDeployment(params *CreateDeploymentParams) (*CreateDeploymentCreated, error) + CreateDeployment(params *CreateDeploymentParams, opts ...ClientOption) (*CreateDeploymentCreated, error) - DeleteDeployment(params *DeleteDeploymentParams) (*DeleteDeploymentAccepted, error) + DeleteDeployment(params *DeleteDeploymentParams, opts ...ClientOption) (*DeleteDeploymentAccepted, error) - GetDeployments(params *GetDeploymentsParams) (*GetDeploymentsOK, error) + GetDeployments(params *GetDeploymentsParams, opts ...ClientOption) (*GetDeploymentsOK, error) - GetSingleDeployment(params *GetSingleDeploymentParams) (*GetSingleDeploymentOK, error) + GetSingleDeployment(params *GetSingleDeploymentParams, opts ...ClientOption) (*GetSingleDeploymentOK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { Create a new Deployment. */ -func (a *Client) CreateDeployment(params *CreateDeploymentParams) (*CreateDeploymentCreated, error) { +func (a *Client) CreateDeployment(params *CreateDeploymentParams, opts ...ClientOption) (*CreateDeploymentCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateDeploymentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createDeployment", Method: "POST", PathPattern: "/iaas/api/deployments", @@ -60,7 +62,12 @@ func (a *Client) CreateDeployment(params *CreateDeploymentParams) (*CreateDeploy Reader: &CreateDeploymentReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +86,12 @@ func (a *Client) CreateDeployment(params *CreateDeploymentParams) (*CreateDeploy Delete a deployment. */ -func (a *Client) DeleteDeployment(params *DeleteDeploymentParams) (*DeleteDeploymentAccepted, error) { +func (a *Client) DeleteDeployment(params *DeleteDeploymentParams, opts ...ClientOption) (*DeleteDeploymentAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteDeploymentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteDeployment", Method: "DELETE", PathPattern: "/iaas/api/deployments/{id}", @@ -96,7 +102,12 @@ func (a *Client) DeleteDeployment(params *DeleteDeploymentParams) (*DeleteDeploy Reader: &DeleteDeploymentReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +126,12 @@ func (a *Client) DeleteDeployment(params *DeleteDeploymentParams) (*DeleteDeploy Get all deployments. */ -func (a *Client) GetDeployments(params *GetDeploymentsParams) (*GetDeploymentsOK, error) { +func (a *Client) GetDeployments(params *GetDeploymentsParams, opts ...ClientOption) (*GetDeploymentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeployments", Method: "GET", PathPattern: "/iaas/api/deployments", @@ -132,7 +142,12 @@ func (a *Client) GetDeployments(params *GetDeploymentsParams) (*GetDeploymentsOK Reader: &GetDeploymentsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -151,13 +166,12 @@ func (a *Client) GetDeployments(params *GetDeploymentsParams) (*GetDeploymentsOK Get a single deployment. */ -func (a *Client) GetSingleDeployment(params *GetSingleDeploymentParams) (*GetSingleDeploymentOK, error) { +func (a *Client) GetSingleDeployment(params *GetSingleDeploymentParams, opts ...ClientOption) (*GetSingleDeploymentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSingleDeploymentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSingleDeployment", Method: "GET", PathPattern: "/iaas/api/deployments/{id}", @@ -168,7 +182,12 @@ func (a *Client) GetSingleDeployment(params *GetSingleDeploymentParams) (*GetSin Reader: &GetSingleDeploymentReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/deployment/get_deployments_parameters.go b/pkg/client/deployment/get_deployments_parameters.go index 36545c07..a49aa53b 100644 --- a/pkg/client/deployment/get_deployments_parameters.go +++ b/pkg/client/deployment/get_deployments_parameters.go @@ -14,55 +14,79 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetDeploymentsParams creates a new GetDeploymentsParams object -// with the default values initialized. +// NewGetDeploymentsParams creates a new GetDeploymentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentsParams() *GetDeploymentsParams { - var () return &GetDeploymentsParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentsParamsWithTimeout creates a new GetDeploymentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentsParamsWithTimeout(timeout time.Duration) *GetDeploymentsParams { - var () return &GetDeploymentsParams{ - timeout: timeout, } } // NewGetDeploymentsParamsWithContext creates a new GetDeploymentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentsParamsWithContext(ctx context.Context) *GetDeploymentsParams { - var () return &GetDeploymentsParams{ - Context: ctx, } } // NewGetDeploymentsParamsWithHTTPClient creates a new GetDeploymentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentsParamsWithHTTPClient(client *http.Client) *GetDeploymentsParams { - var () return &GetDeploymentsParams{ HTTPClient: client, } } -/*GetDeploymentsParams contains all the parameters to send to the API endpoint -for the get deployments operation typically these are written to a http.Request +/* GetDeploymentsParams contains all the parameters to send to the API endpoint + for the get deployments operation. + + Typically these are written to a http.Request. */ type GetDeploymentsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarCount. + + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. + */ + DollarFilter *string + + /* DollarSkip. + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +95,21 @@ type GetDeploymentsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsParams) WithDefaults() *GetDeploymentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployments params func (o *GetDeploymentsParams) WithTimeout(timeout time.Duration) *GetDeploymentsParams { o.SetTimeout(timeout) @@ -104,6 +143,50 @@ func (o *GetDeploymentsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get deployments params +func (o *GetDeploymentsParams) WithDollarCount(dollarCount *bool) *GetDeploymentsParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get deployments params +func (o *GetDeploymentsParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + +// WithDollarFilter adds the dollarFilter to the get deployments params +func (o *GetDeploymentsParams) WithDollarFilter(dollarFilter *string) *GetDeploymentsParams { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the get deployments params +func (o *GetDeploymentsParams) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarSkip adds the dollarSkip to the get deployments params +func (o *GetDeploymentsParams) WithDollarSkip(dollarSkip *int64) *GetDeploymentsParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get deployments params +func (o *GetDeploymentsParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get deployments params +func (o *GetDeploymentsParams) WithDollarTop(dollarTop *int64) *GetDeploymentsParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get deployments params +func (o *GetDeploymentsParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get deployments params func (o *GetDeploymentsParams) WithAPIVersion(aPIVersion *string) *GetDeploymentsParams { o.SetAPIVersion(aPIVersion) @@ -123,20 +206,89 @@ func (o *GetDeploymentsParams) WriteToRequest(r runtime.ClientRequest, reg strfm } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/deployment/get_deployments_responses.go b/pkg/client/deployment/get_deployments_responses.go index 71751873..e8a4f26d 100644 --- a/pkg/client/deployment/get_deployments_responses.go +++ b/pkg/client/deployment/get_deployments_responses.go @@ -35,7 +35,6 @@ func (o *GetDeploymentsReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDeploymentsOK() *GetDeploymentsOK { return &GetDeploymentsOK{} } -/*GetDeploymentsOK handles this case with default header values. +/* GetDeploymentsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetDeploymentsOK struct { func (o *GetDeploymentsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/deployments][%d] getDeploymentsOK %+v", 200, o.Payload) } - func (o *GetDeploymentsOK) GetPayload() []*models.IaaSDeployment { return o.Payload } @@ -77,18 +75,29 @@ func NewGetDeploymentsForbidden() *GetDeploymentsForbidden { return &GetDeploymentsForbidden{} } -/*GetDeploymentsForbidden handles this case with default header values. +/* GetDeploymentsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetDeploymentsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetDeploymentsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/deployments][%d] getDeploymentsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/deployments][%d] getDeploymentsForbidden %+v", 403, o.Payload) +} +func (o *GetDeploymentsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetDeploymentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/deployment/get_single_deployment_parameters.go b/pkg/client/deployment/get_single_deployment_parameters.go index 4afa991a..327b13c0 100644 --- a/pkg/client/deployment/get_single_deployment_parameters.go +++ b/pkg/client/deployment/get_single_deployment_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSingleDeploymentParams creates a new GetSingleDeploymentParams object -// with the default values initialized. +// NewGetSingleDeploymentParams creates a new GetSingleDeploymentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetSingleDeploymentParams() *GetSingleDeploymentParams { - var () return &GetSingleDeploymentParams{ - timeout: cr.DefaultTimeout, } } // NewGetSingleDeploymentParamsWithTimeout creates a new GetSingleDeploymentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSingleDeploymentParamsWithTimeout(timeout time.Duration) *GetSingleDeploymentParams { - var () return &GetSingleDeploymentParams{ - timeout: timeout, } } // NewGetSingleDeploymentParamsWithContext creates a new GetSingleDeploymentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSingleDeploymentParamsWithContext(ctx context.Context) *GetSingleDeploymentParams { - var () return &GetSingleDeploymentParams{ - Context: ctx, } } // NewGetSingleDeploymentParamsWithHTTPClient creates a new GetSingleDeploymentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSingleDeploymentParamsWithHTTPClient(client *http.Client) *GetSingleDeploymentParams { - var () return &GetSingleDeploymentParams{ HTTPClient: client, } } -/*GetSingleDeploymentParams contains all the parameters to send to the API endpoint -for the get single deployment operation typically these are written to a http.Request +/* GetSingleDeploymentParams contains all the parameters to send to the API endpoint + for the get single deployment operation. + + Typically these are written to a http.Request. */ type GetSingleDeploymentParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the deployment. + /* ID. + + The id of the deployment. */ ID string @@ -76,6 +76,21 @@ type GetSingleDeploymentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get single deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSingleDeploymentParams) WithDefaults() *GetSingleDeploymentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get single deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSingleDeploymentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get single deployment params func (o *GetSingleDeploymentParams) WithTimeout(timeout time.Duration) *GetSingleDeploymentParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetSingleDeploymentParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/deployment/get_single_deployment_responses.go b/pkg/client/deployment/get_single_deployment_responses.go index 0735113b..f7f793a9 100644 --- a/pkg/client/deployment/get_single_deployment_responses.go +++ b/pkg/client/deployment/get_single_deployment_responses.go @@ -41,7 +41,6 @@ func (o *GetSingleDeploymentReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetSingleDeploymentOK() *GetSingleDeploymentOK { return &GetSingleDeploymentOK{} } -/*GetSingleDeploymentOK handles this case with default header values. +/* GetSingleDeploymentOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetSingleDeploymentOK struct { func (o *GetSingleDeploymentOK) Error() string { return fmt.Sprintf("[GET /iaas/api/deployments/{id}][%d] getSingleDeploymentOK %+v", 200, o.Payload) } - func (o *GetSingleDeploymentOK) GetPayload() *models.IaaSDeployment { return o.Payload } @@ -85,19 +83,30 @@ func NewGetSingleDeploymentForbidden() *GetSingleDeploymentForbidden { return &GetSingleDeploymentForbidden{} } -/*GetSingleDeploymentForbidden handles this case with default header values. +/* GetSingleDeploymentForbidden describes a response with status code 403, with default header values. Forbidden */ type GetSingleDeploymentForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetSingleDeploymentForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/deployments/{id}][%d] getSingleDeploymentForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/deployments/{id}][%d] getSingleDeploymentForbidden %+v", 403, o.Payload) +} +func (o *GetSingleDeploymentForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetSingleDeploymentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetSingleDeploymentNotFound() *GetSingleDeploymentNotFound { return &GetSingleDeploymentNotFound{} } -/*GetSingleDeploymentNotFound handles this case with default header values. +/* GetSingleDeploymentNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetSingleDeploymentNotFound struct { func (o *GetSingleDeploymentNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/deployments/{id}][%d] getSingleDeploymentNotFound %+v", 404, o.Payload) } - func (o *GetSingleDeploymentNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/action_deployment_request_using_post_parameters.go b/pkg/client/deployment_actions/action_deployment_request_using_post_parameters.go index 01b0a51d..d45b4537 100644 --- a/pkg/client/deployment_actions/action_deployment_request_using_post_parameters.go +++ b/pkg/client/deployment_actions/action_deployment_request_using_post_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewActionDeploymentRequestUsingPOSTParams creates a new ActionDeploymentRequestUsingPOSTParams object -// with the default values initialized. +// NewActionDeploymentRequestUsingPOSTParams creates a new ActionDeploymentRequestUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewActionDeploymentRequestUsingPOSTParams() *ActionDeploymentRequestUsingPOSTParams { - var () return &ActionDeploymentRequestUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewActionDeploymentRequestUsingPOSTParamsWithTimeout creates a new ActionDeploymentRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewActionDeploymentRequestUsingPOSTParamsWithTimeout(timeout time.Duration) *ActionDeploymentRequestUsingPOSTParams { - var () return &ActionDeploymentRequestUsingPOSTParams{ - timeout: timeout, } } // NewActionDeploymentRequestUsingPOSTParamsWithContext creates a new ActionDeploymentRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewActionDeploymentRequestUsingPOSTParamsWithContext(ctx context.Context) *ActionDeploymentRequestUsingPOSTParams { - var () return &ActionDeploymentRequestUsingPOSTParams{ - Context: ctx, } } // NewActionDeploymentRequestUsingPOSTParamsWithHTTPClient creates a new ActionDeploymentRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewActionDeploymentRequestUsingPOSTParamsWithHTTPClient(client *http.Client) *ActionDeploymentRequestUsingPOSTParams { - var () return &ActionDeploymentRequestUsingPOSTParams{ HTTPClient: client, } } -/*ActionDeploymentRequestUsingPOSTParams contains all the parameters to send to the API endpoint -for the action deployment request using p o s t operation typically these are written to a http.Request +/* ActionDeploymentRequestUsingPOSTParams contains all the parameters to send to the API endpoint + for the action deployment request using p o s t operation. + + Typically these are written to a http.Request. */ type ActionDeploymentRequestUsingPOSTParams struct { - /*Action - action + /* Action. + action */ Action string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*RequestID - requestId + /* RequestID. + + requestId + + Format: uuid */ RequestID strfmt.UUID @@ -81,6 +84,21 @@ type ActionDeploymentRequestUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the action deployment request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ActionDeploymentRequestUsingPOSTParams) WithDefaults() *ActionDeploymentRequestUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the action deployment request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ActionDeploymentRequestUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the action deployment request using p o s t params func (o *ActionDeploymentRequestUsingPOSTParams) WithTimeout(timeout time.Duration) *ActionDeploymentRequestUsingPOSTParams { o.SetTimeout(timeout) @@ -159,6 +177,7 @@ func (o *ActionDeploymentRequestUsingPOSTParams) WriteToRequest(r runtime.Client qrAction := o.Action qAction := qrAction if qAction != "" { + if err := r.SetQueryParam("action", qAction); err != nil { return err } @@ -168,16 +187,17 @@ func (o *ActionDeploymentRequestUsingPOSTParams) WriteToRequest(r runtime.Client // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param requestId diff --git a/pkg/client/deployment_actions/action_deployment_request_using_post_responses.go b/pkg/client/deployment_actions/action_deployment_request_using_post_responses.go index d4f4204a..f53699ce 100644 --- a/pkg/client/deployment_actions/action_deployment_request_using_post_responses.go +++ b/pkg/client/deployment_actions/action_deployment_request_using_post_responses.go @@ -47,7 +47,6 @@ func (o *ActionDeploymentRequestUsingPOSTReader) ReadResponse(response runtime.C return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewActionDeploymentRequestUsingPOSTOK() *ActionDeploymentRequestUsingPOSTOK return &ActionDeploymentRequestUsingPOSTOK{} } -/*ActionDeploymentRequestUsingPOSTOK handles this case with default header values. +/* ActionDeploymentRequestUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -79,7 +78,7 @@ func NewActionDeploymentRequestUsingPOSTUnauthorized() *ActionDeploymentRequestU return &ActionDeploymentRequestUsingPOSTUnauthorized{} } -/*ActionDeploymentRequestUsingPOSTUnauthorized handles this case with default header values. +/* ActionDeploymentRequestUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -100,7 +99,7 @@ func NewActionDeploymentRequestUsingPOSTForbidden() *ActionDeploymentRequestUsin return &ActionDeploymentRequestUsingPOSTForbidden{} } -/*ActionDeploymentRequestUsingPOSTForbidden handles this case with default header values. +/* ActionDeploymentRequestUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -121,7 +120,7 @@ func NewActionDeploymentRequestUsingPOSTNotFound() *ActionDeploymentRequestUsing return &ActionDeploymentRequestUsingPOSTNotFound{} } -/*ActionDeploymentRequestUsingPOSTNotFound handles this case with default header values. +/* ActionDeploymentRequestUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type ActionDeploymentRequestUsingPOSTNotFound struct { func (o *ActionDeploymentRequestUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /deployment/api/requests/{requestId}][%d] actionDeploymentRequestUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *ActionDeploymentRequestUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/deployment_actions_client.go b/pkg/client/deployment_actions/deployment_actions_client.go index c06d16c0..3e5d25e9 100644 --- a/pkg/client/deployment_actions/deployment_actions_client.go +++ b/pkg/client/deployment_actions/deployment_actions_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ActionDeploymentRequestUsingPOST(params *ActionDeploymentRequestUsingPOSTParams) (*ActionDeploymentRequestUsingPOSTOK, error) + ActionDeploymentRequestUsingPOST(params *ActionDeploymentRequestUsingPOSTParams, opts ...ClientOption) (*ActionDeploymentRequestUsingPOSTOK, error) - GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGETParams) (*GetDeploymentActionUsingGETOK, error) + GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGETParams, opts ...ClientOption) (*GetDeploymentActionUsingGETOK, error) - GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingGETParams) (*GetDeploymentActionsUsingGETOK, error) + GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingGETParams, opts ...ClientOption) (*GetDeploymentActionsUsingGETOK, error) - GetResourceActionUsingGET(params *GetResourceActionUsingGETParams) (*GetResourceActionUsingGETOK, error) + GetResourceActionUsingGET(params *GetResourceActionUsingGETParams, opts ...ClientOption) (*GetResourceActionUsingGETOK, error) - GetResourceActionsUsingGET(params *GetResourceActionsUsingGETParams) (*GetResourceActionsUsingGETOK, error) + GetResourceActionsUsingGET(params *GetResourceActionsUsingGETParams, opts ...ClientOption) (*GetResourceActionsUsingGETOK, error) - SubmitDeploymentActionRequestUsingPOST(params *SubmitDeploymentActionRequestUsingPOSTParams) (*SubmitDeploymentActionRequestUsingPOSTOK, error) + SubmitDeploymentActionRequestUsingPOST(params *SubmitDeploymentActionRequestUsingPOSTParams, opts ...ClientOption) (*SubmitDeploymentActionRequestUsingPOSTOK, error) - SubmitResourceActionRequestUsingPOST(params *SubmitResourceActionRequestUsingPOSTParams) (*SubmitResourceActionRequestUsingPOSTOK, error) + SubmitResourceActionRequestUsingPOST(params *SubmitResourceActionRequestUsingPOSTParams, opts ...ClientOption) (*SubmitResourceActionRequestUsingPOSTOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Cancel can be submitted on In-progress requests and Dismiss can be submitted on Failed requests. */ -func (a *Client) ActionDeploymentRequestUsingPOST(params *ActionDeploymentRequestUsingPOSTParams) (*ActionDeploymentRequestUsingPOSTOK, error) { +func (a *Client) ActionDeploymentRequestUsingPOST(params *ActionDeploymentRequestUsingPOSTParams, opts ...ClientOption) (*ActionDeploymentRequestUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewActionDeploymentRequestUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "actionDeploymentRequestUsingPOST", Method: "POST", PathPattern: "/deployment/api/requests/{requestId}", @@ -66,7 +68,12 @@ func (a *Client) ActionDeploymentRequestUsingPOST(params *ActionDeploymentReques Reader: &ActionDeploymentRequestUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) ActionDeploymentRequestUsingPOST(params *ActionDeploymentReques Returns an action for the deployment specified by its Deployment ID and Action ID. */ -func (a *Client) GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGETParams) (*GetDeploymentActionUsingGETOK, error) { +func (a *Client) GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGETParams, opts ...ClientOption) (*GetDeploymentActionUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentActionUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentActionUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/actions/{actionId}", @@ -102,7 +108,12 @@ func (a *Client) GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGET Reader: &GetDeploymentActionUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) GetDeploymentActionUsingGET(params *GetDeploymentActionUsingGET Returns the complete list of available actions that can be performed on a given deployment. */ -func (a *Client) GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingGETParams) (*GetDeploymentActionsUsingGETOK, error) { +func (a *Client) GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingGETParams, opts ...ClientOption) (*GetDeploymentActionsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentActionsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentActionsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/actions", @@ -138,7 +148,12 @@ func (a *Client) GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingG Reader: &GetDeploymentActionsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -157,13 +172,12 @@ func (a *Client) GetDeploymentActionsUsingGET(params *GetDeploymentActionsUsingG Returns an action for the resource specified by its Resource ID and Action ID. */ -func (a *Client) GetResourceActionUsingGET(params *GetResourceActionUsingGETParams) (*GetResourceActionUsingGETOK, error) { +func (a *Client) GetResourceActionUsingGET(params *GetResourceActionUsingGETParams, opts ...ClientOption) (*GetResourceActionUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourceActionUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getResourceActionUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/resources/{resourceId}/actions/{actionId}", @@ -174,7 +188,12 @@ func (a *Client) GetResourceActionUsingGET(params *GetResourceActionUsingGETPara Reader: &GetResourceActionUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -193,13 +212,12 @@ func (a *Client) GetResourceActionUsingGET(params *GetResourceActionUsingGETPara Returns the complete list of available actions that can be performed on a given resource. */ -func (a *Client) GetResourceActionsUsingGET(params *GetResourceActionsUsingGETParams) (*GetResourceActionsUsingGETOK, error) { +func (a *Client) GetResourceActionsUsingGET(params *GetResourceActionsUsingGETParams, opts ...ClientOption) (*GetResourceActionsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourceActionsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getResourceActionsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/resources/{resourceId}/actions", @@ -210,7 +228,12 @@ func (a *Client) GetResourceActionsUsingGET(params *GetResourceActionsUsingGETPa Reader: &GetResourceActionsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetResourceActionsUsingGET(params *GetResourceActionsUsingGETPa Submit a deployment action request */ -func (a *Client) SubmitDeploymentActionRequestUsingPOST(params *SubmitDeploymentActionRequestUsingPOSTParams) (*SubmitDeploymentActionRequestUsingPOSTOK, error) { +func (a *Client) SubmitDeploymentActionRequestUsingPOST(params *SubmitDeploymentActionRequestUsingPOSTParams, opts ...ClientOption) (*SubmitDeploymentActionRequestUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewSubmitDeploymentActionRequestUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "submitDeploymentActionRequestUsingPOST", Method: "POST", PathPattern: "/deployment/api/deployments/{depId}/requests", @@ -246,7 +268,12 @@ func (a *Client) SubmitDeploymentActionRequestUsingPOST(params *SubmitDeployment Reader: &SubmitDeploymentActionRequestUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -265,13 +292,12 @@ func (a *Client) SubmitDeploymentActionRequestUsingPOST(params *SubmitDeployment Submit a resource action request. */ -func (a *Client) SubmitResourceActionRequestUsingPOST(params *SubmitResourceActionRequestUsingPOSTParams) (*SubmitResourceActionRequestUsingPOSTOK, error) { +func (a *Client) SubmitResourceActionRequestUsingPOST(params *SubmitResourceActionRequestUsingPOSTParams, opts ...ClientOption) (*SubmitResourceActionRequestUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewSubmitResourceActionRequestUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "submitResourceActionRequestUsingPOST", Method: "POST", PathPattern: "/deployment/api/deployments/{depId}/resources/{resourceId}/requests", @@ -282,7 +308,12 @@ func (a *Client) SubmitResourceActionRequestUsingPOST(params *SubmitResourceActi Reader: &SubmitResourceActionRequestUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/deployment_actions/get_deployment_action_using_get_parameters.go b/pkg/client/deployment_actions/get_deployment_action_using_get_parameters.go index a3c7a6b8..8f8dae79 100644 --- a/pkg/client/deployment_actions/get_deployment_action_using_get_parameters.go +++ b/pkg/client/deployment_actions/get_deployment_action_using_get_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDeploymentActionUsingGETParams creates a new GetDeploymentActionUsingGETParams object -// with the default values initialized. +// NewGetDeploymentActionUsingGETParams creates a new GetDeploymentActionUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentActionUsingGETParams() *GetDeploymentActionUsingGETParams { - var () return &GetDeploymentActionUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentActionUsingGETParamsWithTimeout creates a new GetDeploymentActionUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentActionUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentActionUsingGETParams { - var () return &GetDeploymentActionUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentActionUsingGETParamsWithContext creates a new GetDeploymentActionUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentActionUsingGETParamsWithContext(ctx context.Context) *GetDeploymentActionUsingGETParams { - var () return &GetDeploymentActionUsingGETParams{ - Context: ctx, } } // NewGetDeploymentActionUsingGETParamsWithHTTPClient creates a new GetDeploymentActionUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentActionUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentActionUsingGETParams { - var () return &GetDeploymentActionUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentActionUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment action using g e t operation typically these are written to a http.Request +/* GetDeploymentActionUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment action using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentActionUsingGETParams struct { - /*ActionID - Action ID + /* ActionID. + Action ID */ ActionID string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID @@ -81,6 +84,21 @@ type GetDeploymentActionUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment action using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentActionUsingGETParams) WithDefaults() *GetDeploymentActionUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment action using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentActionUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment action using get params func (o *GetDeploymentActionUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentActionUsingGETParams { o.SetTimeout(timeout) @@ -164,16 +182,17 @@ func (o *GetDeploymentActionUsingGETParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/get_deployment_action_using_get_responses.go b/pkg/client/deployment_actions/get_deployment_action_using_get_responses.go index 86898d93..3b15da14 100644 --- a/pkg/client/deployment_actions/get_deployment_action_using_get_responses.go +++ b/pkg/client/deployment_actions/get_deployment_action_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentActionUsingGETReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentActionUsingGETOK() *GetDeploymentActionUsingGETOK { return &GetDeploymentActionUsingGETOK{} } -/*GetDeploymentActionUsingGETOK handles this case with default header values. +/* GetDeploymentActionUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentActionUsingGETOK struct { func (o *GetDeploymentActionUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/actions/{actionId}][%d] getDeploymentActionUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentActionUsingGETOK) GetPayload() *models.ResourceAction { return o.Payload } @@ -85,7 +83,7 @@ func NewGetDeploymentActionUsingGETUnauthorized() *GetDeploymentActionUsingGETUn return &GetDeploymentActionUsingGETUnauthorized{} } -/*GetDeploymentActionUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentActionUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetDeploymentActionUsingGETNotFound() *GetDeploymentActionUsingGETNotFou return &GetDeploymentActionUsingGETNotFound{} } -/*GetDeploymentActionUsingGETNotFound handles this case with default header values. +/* GetDeploymentActionUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetDeploymentActionUsingGETNotFound struct { func (o *GetDeploymentActionUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/actions/{actionId}][%d] getDeploymentActionUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentActionUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/get_deployment_actions_using_get_parameters.go b/pkg/client/deployment_actions/get_deployment_actions_using_get_parameters.go index 3b58177d..bbfccadb 100644 --- a/pkg/client/deployment_actions/get_deployment_actions_using_get_parameters.go +++ b/pkg/client/deployment_actions/get_deployment_actions_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDeploymentActionsUsingGETParams creates a new GetDeploymentActionsUsingGETParams object -// with the default values initialized. +// NewGetDeploymentActionsUsingGETParams creates a new GetDeploymentActionsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentActionsUsingGETParams() *GetDeploymentActionsUsingGETParams { - var () return &GetDeploymentActionsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentActionsUsingGETParamsWithTimeout creates a new GetDeploymentActionsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentActionsUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentActionsUsingGETParams { - var () return &GetDeploymentActionsUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentActionsUsingGETParamsWithContext creates a new GetDeploymentActionsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentActionsUsingGETParamsWithContext(ctx context.Context) *GetDeploymentActionsUsingGETParams { - var () return &GetDeploymentActionsUsingGETParams{ - Context: ctx, } } // NewGetDeploymentActionsUsingGETParamsWithHTTPClient creates a new GetDeploymentActionsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentActionsUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentActionsUsingGETParams { - var () return &GetDeploymentActionsUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentActionsUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment actions using g e t operation typically these are written to a http.Request +/* GetDeploymentActionsUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment actions using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentActionsUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID @@ -76,6 +78,21 @@ type GetDeploymentActionsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment actions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentActionsUsingGETParams) WithDefaults() *GetDeploymentActionsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment actions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentActionsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment actions using get params func (o *GetDeploymentActionsUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentActionsUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetDeploymentActionsUsingGETParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/get_deployment_actions_using_get_responses.go b/pkg/client/deployment_actions/get_deployment_actions_using_get_responses.go index c17cb685..3ef8b190 100644 --- a/pkg/client/deployment_actions/get_deployment_actions_using_get_responses.go +++ b/pkg/client/deployment_actions/get_deployment_actions_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentActionsUsingGETReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentActionsUsingGETOK() *GetDeploymentActionsUsingGETOK { return &GetDeploymentActionsUsingGETOK{} } -/*GetDeploymentActionsUsingGETOK handles this case with default header values. +/* GetDeploymentActionsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentActionsUsingGETOK struct { func (o *GetDeploymentActionsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/actions][%d] getDeploymentActionsUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentActionsUsingGETOK) GetPayload() []*models.ResourceAction { return o.Payload } @@ -83,7 +81,7 @@ func NewGetDeploymentActionsUsingGETUnauthorized() *GetDeploymentActionsUsingGET return &GetDeploymentActionsUsingGETUnauthorized{} } -/*GetDeploymentActionsUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentActionsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -104,7 +102,7 @@ func NewGetDeploymentActionsUsingGETNotFound() *GetDeploymentActionsUsingGETNotF return &GetDeploymentActionsUsingGETNotFound{} } -/*GetDeploymentActionsUsingGETNotFound handles this case with default header values. +/* GetDeploymentActionsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -115,7 +113,6 @@ type GetDeploymentActionsUsingGETNotFound struct { func (o *GetDeploymentActionsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/actions][%d] getDeploymentActionsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentActionsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/get_resource_action_using_get_parameters.go b/pkg/client/deployment_actions/get_resource_action_using_get_parameters.go index b0adfa24..762a3d86 100644 --- a/pkg/client/deployment_actions/get_resource_action_using_get_parameters.go +++ b/pkg/client/deployment_actions/get_resource_action_using_get_parameters.go @@ -16,68 +16,74 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourceActionUsingGETParams creates a new GetResourceActionUsingGETParams object -// with the default values initialized. +// NewGetResourceActionUsingGETParams creates a new GetResourceActionUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetResourceActionUsingGETParams() *GetResourceActionUsingGETParams { - var () return &GetResourceActionUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetResourceActionUsingGETParamsWithTimeout creates a new GetResourceActionUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourceActionUsingGETParamsWithTimeout(timeout time.Duration) *GetResourceActionUsingGETParams { - var () return &GetResourceActionUsingGETParams{ - timeout: timeout, } } // NewGetResourceActionUsingGETParamsWithContext creates a new GetResourceActionUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourceActionUsingGETParamsWithContext(ctx context.Context) *GetResourceActionUsingGETParams { - var () return &GetResourceActionUsingGETParams{ - Context: ctx, } } // NewGetResourceActionUsingGETParamsWithHTTPClient creates a new GetResourceActionUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourceActionUsingGETParamsWithHTTPClient(client *http.Client) *GetResourceActionUsingGETParams { - var () return &GetResourceActionUsingGETParams{ HTTPClient: client, } } -/*GetResourceActionUsingGETParams contains all the parameters to send to the API endpoint -for the get resource action using g e t operation typically these are written to a http.Request +/* GetResourceActionUsingGETParams contains all the parameters to send to the API endpoint + for the get resource action using g e t operation. + + Typically these are written to a http.Request. */ type GetResourceActionUsingGETParams struct { - /*ActionID - Action ID + /* ActionID. + Action ID */ ActionID string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*ResourceID - Resource ID + /* ResourceID. + + Resource ID + + Format: uuid */ ResourceID strfmt.UUID @@ -86,6 +92,21 @@ type GetResourceActionUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resource action using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceActionUsingGETParams) WithDefaults() *GetResourceActionUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource action using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceActionUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resource action using get params func (o *GetResourceActionUsingGETParams) WithTimeout(timeout time.Duration) *GetResourceActionUsingGETParams { o.SetTimeout(timeout) @@ -180,16 +201,17 @@ func (o *GetResourceActionUsingGETParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/get_resource_action_using_get_responses.go b/pkg/client/deployment_actions/get_resource_action_using_get_responses.go index 4b4216f3..16f1aca7 100644 --- a/pkg/client/deployment_actions/get_resource_action_using_get_responses.go +++ b/pkg/client/deployment_actions/get_resource_action_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetResourceActionUsingGETReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetResourceActionUsingGETOK() *GetResourceActionUsingGETOK { return &GetResourceActionUsingGETOK{} } -/*GetResourceActionUsingGETOK handles this case with default header values. +/* GetResourceActionUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetResourceActionUsingGETOK struct { func (o *GetResourceActionUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}/actions/{actionId}][%d] getResourceActionUsingGETOK %+v", 200, o.Payload) } - func (o *GetResourceActionUsingGETOK) GetPayload() *models.ResourceAction { return o.Payload } @@ -85,7 +83,7 @@ func NewGetResourceActionUsingGETUnauthorized() *GetResourceActionUsingGETUnauth return &GetResourceActionUsingGETUnauthorized{} } -/*GetResourceActionUsingGETUnauthorized handles this case with default header values. +/* GetResourceActionUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetResourceActionUsingGETNotFound() *GetResourceActionUsingGETNotFound { return &GetResourceActionUsingGETNotFound{} } -/*GetResourceActionUsingGETNotFound handles this case with default header values. +/* GetResourceActionUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetResourceActionUsingGETNotFound struct { func (o *GetResourceActionUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}/actions/{actionId}][%d] getResourceActionUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetResourceActionUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/get_resource_actions_using_get_parameters.go b/pkg/client/deployment_actions/get_resource_actions_using_get_parameters.go index 042bec0c..2973b4ef 100644 --- a/pkg/client/deployment_actions/get_resource_actions_using_get_parameters.go +++ b/pkg/client/deployment_actions/get_resource_actions_using_get_parameters.go @@ -16,63 +16,68 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourceActionsUsingGETParams creates a new GetResourceActionsUsingGETParams object -// with the default values initialized. +// NewGetResourceActionsUsingGETParams creates a new GetResourceActionsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetResourceActionsUsingGETParams() *GetResourceActionsUsingGETParams { - var () return &GetResourceActionsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetResourceActionsUsingGETParamsWithTimeout creates a new GetResourceActionsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourceActionsUsingGETParamsWithTimeout(timeout time.Duration) *GetResourceActionsUsingGETParams { - var () return &GetResourceActionsUsingGETParams{ - timeout: timeout, } } // NewGetResourceActionsUsingGETParamsWithContext creates a new GetResourceActionsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourceActionsUsingGETParamsWithContext(ctx context.Context) *GetResourceActionsUsingGETParams { - var () return &GetResourceActionsUsingGETParams{ - Context: ctx, } } // NewGetResourceActionsUsingGETParamsWithHTTPClient creates a new GetResourceActionsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourceActionsUsingGETParamsWithHTTPClient(client *http.Client) *GetResourceActionsUsingGETParams { - var () return &GetResourceActionsUsingGETParams{ HTTPClient: client, } } -/*GetResourceActionsUsingGETParams contains all the parameters to send to the API endpoint -for the get resource actions using g e t operation typically these are written to a http.Request +/* GetResourceActionsUsingGETParams contains all the parameters to send to the API endpoint + for the get resource actions using g e t operation. + + Typically these are written to a http.Request. */ type GetResourceActionsUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*ResourceID - Resource ID + /* ResourceID. + + Resource ID + + Format: uuid */ ResourceID strfmt.UUID @@ -81,6 +86,21 @@ type GetResourceActionsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resource actions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceActionsUsingGETParams) WithDefaults() *GetResourceActionsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource actions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceActionsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resource actions using get params func (o *GetResourceActionsUsingGETParams) WithTimeout(timeout time.Duration) *GetResourceActionsUsingGETParams { o.SetTimeout(timeout) @@ -159,16 +179,17 @@ func (o *GetResourceActionsUsingGETParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/get_resource_actions_using_get_responses.go b/pkg/client/deployment_actions/get_resource_actions_using_get_responses.go index c20f9ab3..fcca7547 100644 --- a/pkg/client/deployment_actions/get_resource_actions_using_get_responses.go +++ b/pkg/client/deployment_actions/get_resource_actions_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetResourceActionsUsingGETReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetResourceActionsUsingGETOK() *GetResourceActionsUsingGETOK { return &GetResourceActionsUsingGETOK{} } -/*GetResourceActionsUsingGETOK handles this case with default header values. +/* GetResourceActionsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetResourceActionsUsingGETOK struct { func (o *GetResourceActionsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}/actions][%d] getResourceActionsUsingGETOK %+v", 200, o.Payload) } - func (o *GetResourceActionsUsingGETOK) GetPayload() []*models.ResourceAction { return o.Payload } @@ -83,7 +81,7 @@ func NewGetResourceActionsUsingGETUnauthorized() *GetResourceActionsUsingGETUnau return &GetResourceActionsUsingGETUnauthorized{} } -/*GetResourceActionsUsingGETUnauthorized handles this case with default header values. +/* GetResourceActionsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -104,7 +102,7 @@ func NewGetResourceActionsUsingGETNotFound() *GetResourceActionsUsingGETNotFound return &GetResourceActionsUsingGETNotFound{} } -/*GetResourceActionsUsingGETNotFound handles this case with default header values. +/* GetResourceActionsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -115,7 +113,6 @@ type GetResourceActionsUsingGETNotFound struct { func (o *GetResourceActionsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}/actions][%d] getResourceActionsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetResourceActionsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/submit_deployment_action_request_using_post_parameters.go b/pkg/client/deployment_actions/submit_deployment_action_request_using_post_parameters.go index 56871def..af678136 100644 --- a/pkg/client/deployment_actions/submit_deployment_action_request_using_post_parameters.go +++ b/pkg/client/deployment_actions/submit_deployment_action_request_using_post_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewSubmitDeploymentActionRequestUsingPOSTParams creates a new SubmitDeploymentActionRequestUsingPOSTParams object -// with the default values initialized. +// NewSubmitDeploymentActionRequestUsingPOSTParams creates a new SubmitDeploymentActionRequestUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSubmitDeploymentActionRequestUsingPOSTParams() *SubmitDeploymentActionRequestUsingPOSTParams { - var () return &SubmitDeploymentActionRequestUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewSubmitDeploymentActionRequestUsingPOSTParamsWithTimeout creates a new SubmitDeploymentActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSubmitDeploymentActionRequestUsingPOSTParamsWithTimeout(timeout time.Duration) *SubmitDeploymentActionRequestUsingPOSTParams { - var () return &SubmitDeploymentActionRequestUsingPOSTParams{ - timeout: timeout, } } // NewSubmitDeploymentActionRequestUsingPOSTParamsWithContext creates a new SubmitDeploymentActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSubmitDeploymentActionRequestUsingPOSTParamsWithContext(ctx context.Context) *SubmitDeploymentActionRequestUsingPOSTParams { - var () return &SubmitDeploymentActionRequestUsingPOSTParams{ - Context: ctx, } } // NewSubmitDeploymentActionRequestUsingPOSTParamsWithHTTPClient creates a new SubmitDeploymentActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSubmitDeploymentActionRequestUsingPOSTParamsWithHTTPClient(client *http.Client) *SubmitDeploymentActionRequestUsingPOSTParams { - var () return &SubmitDeploymentActionRequestUsingPOSTParams{ HTTPClient: client, } } -/*SubmitDeploymentActionRequestUsingPOSTParams contains all the parameters to send to the API endpoint -for the submit deployment action request using p o s t operation typically these are written to a http.Request +/* SubmitDeploymentActionRequestUsingPOSTParams contains all the parameters to send to the API endpoint + for the submit deployment action request using p o s t operation. + + Typically these are written to a http.Request. */ type SubmitDeploymentActionRequestUsingPOSTParams struct { - /*ActionRequest - actionRequest + /* ActionRequest. + actionRequest */ ActionRequest *models.ResourceActionRequest - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID @@ -83,6 +86,21 @@ type SubmitDeploymentActionRequestUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the submit deployment action request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitDeploymentActionRequestUsingPOSTParams) WithDefaults() *SubmitDeploymentActionRequestUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the submit deployment action request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitDeploymentActionRequestUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the submit deployment action request using p o s t params func (o *SubmitDeploymentActionRequestUsingPOSTParams) WithTimeout(timeout time.Duration) *SubmitDeploymentActionRequestUsingPOSTParams { o.SetTimeout(timeout) @@ -156,7 +174,6 @@ func (o *SubmitDeploymentActionRequestUsingPOSTParams) WriteToRequest(r runtime. return err } var res []error - if o.ActionRequest != nil { if err := r.SetBodyParam(o.ActionRequest); err != nil { return err @@ -167,16 +184,17 @@ func (o *SubmitDeploymentActionRequestUsingPOSTParams) WriteToRequest(r runtime. // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/submit_deployment_action_request_using_post_responses.go b/pkg/client/deployment_actions/submit_deployment_action_request_using_post_responses.go index fe972cda..206eaace 100644 --- a/pkg/client/deployment_actions/submit_deployment_action_request_using_post_responses.go +++ b/pkg/client/deployment_actions/submit_deployment_action_request_using_post_responses.go @@ -47,7 +47,6 @@ func (o *SubmitDeploymentActionRequestUsingPOSTReader) ReadResponse(response run return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewSubmitDeploymentActionRequestUsingPOSTOK() *SubmitDeploymentActionReques return &SubmitDeploymentActionRequestUsingPOSTOK{} } -/*SubmitDeploymentActionRequestUsingPOSTOK handles this case with default header values. +/* SubmitDeploymentActionRequestUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type SubmitDeploymentActionRequestUsingPOSTOK struct { func (o *SubmitDeploymentActionRequestUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /deployment/api/deployments/{depId}/requests][%d] submitDeploymentActionRequestUsingPOSTOK %+v", 200, o.Payload) } - func (o *SubmitDeploymentActionRequestUsingPOSTOK) GetPayload() *models.Request { return o.Payload } @@ -91,7 +89,7 @@ func NewSubmitDeploymentActionRequestUsingPOSTUnauthorized() *SubmitDeploymentAc return &SubmitDeploymentActionRequestUsingPOSTUnauthorized{} } -/*SubmitDeploymentActionRequestUsingPOSTUnauthorized handles this case with default header values. +/* SubmitDeploymentActionRequestUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewSubmitDeploymentActionRequestUsingPOSTForbidden() *SubmitDeploymentActio return &SubmitDeploymentActionRequestUsingPOSTForbidden{} } -/*SubmitDeploymentActionRequestUsingPOSTForbidden handles this case with default header values. +/* SubmitDeploymentActionRequestUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewSubmitDeploymentActionRequestUsingPOSTNotFound() *SubmitDeploymentAction return &SubmitDeploymentActionRequestUsingPOSTNotFound{} } -/*SubmitDeploymentActionRequestUsingPOSTNotFound handles this case with default header values. +/* SubmitDeploymentActionRequestUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type SubmitDeploymentActionRequestUsingPOSTNotFound struct { func (o *SubmitDeploymentActionRequestUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /deployment/api/deployments/{depId}/requests][%d] submitDeploymentActionRequestUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *SubmitDeploymentActionRequestUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_actions/submit_resource_action_request_using_post_parameters.go b/pkg/client/deployment_actions/submit_resource_action_request_using_post_parameters.go index c17121e8..349214a5 100644 --- a/pkg/client/deployment_actions/submit_resource_action_request_using_post_parameters.go +++ b/pkg/client/deployment_actions/submit_resource_action_request_using_post_parameters.go @@ -18,68 +18,74 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewSubmitResourceActionRequestUsingPOSTParams creates a new SubmitResourceActionRequestUsingPOSTParams object -// with the default values initialized. +// NewSubmitResourceActionRequestUsingPOSTParams creates a new SubmitResourceActionRequestUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSubmitResourceActionRequestUsingPOSTParams() *SubmitResourceActionRequestUsingPOSTParams { - var () return &SubmitResourceActionRequestUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewSubmitResourceActionRequestUsingPOSTParamsWithTimeout creates a new SubmitResourceActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSubmitResourceActionRequestUsingPOSTParamsWithTimeout(timeout time.Duration) *SubmitResourceActionRequestUsingPOSTParams { - var () return &SubmitResourceActionRequestUsingPOSTParams{ - timeout: timeout, } } // NewSubmitResourceActionRequestUsingPOSTParamsWithContext creates a new SubmitResourceActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSubmitResourceActionRequestUsingPOSTParamsWithContext(ctx context.Context) *SubmitResourceActionRequestUsingPOSTParams { - var () return &SubmitResourceActionRequestUsingPOSTParams{ - Context: ctx, } } // NewSubmitResourceActionRequestUsingPOSTParamsWithHTTPClient creates a new SubmitResourceActionRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSubmitResourceActionRequestUsingPOSTParamsWithHTTPClient(client *http.Client) *SubmitResourceActionRequestUsingPOSTParams { - var () return &SubmitResourceActionRequestUsingPOSTParams{ HTTPClient: client, } } -/*SubmitResourceActionRequestUsingPOSTParams contains all the parameters to send to the API endpoint -for the submit resource action request using p o s t operation typically these are written to a http.Request +/* SubmitResourceActionRequestUsingPOSTParams contains all the parameters to send to the API endpoint + for the submit resource action request using p o s t operation. + + Typically these are written to a http.Request. */ type SubmitResourceActionRequestUsingPOSTParams struct { - /*ActionRequest - actionRequest + /* ActionRequest. + actionRequest */ ActionRequest *models.ResourceActionRequest - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*ResourceID - Resource ID + /* ResourceID. + + Resource ID + + Format: uuid */ ResourceID strfmt.UUID @@ -88,6 +94,21 @@ type SubmitResourceActionRequestUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the submit resource action request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitResourceActionRequestUsingPOSTParams) WithDefaults() *SubmitResourceActionRequestUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the submit resource action request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitResourceActionRequestUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the submit resource action request using p o s t params func (o *SubmitResourceActionRequestUsingPOSTParams) WithTimeout(timeout time.Duration) *SubmitResourceActionRequestUsingPOSTParams { o.SetTimeout(timeout) @@ -172,7 +193,6 @@ func (o *SubmitResourceActionRequestUsingPOSTParams) WriteToRequest(r runtime.Cl return err } var res []error - if o.ActionRequest != nil { if err := r.SetBodyParam(o.ActionRequest); err != nil { return err @@ -183,16 +203,17 @@ func (o *SubmitResourceActionRequestUsingPOSTParams) WriteToRequest(r runtime.Cl // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_actions/submit_resource_action_request_using_post_responses.go b/pkg/client/deployment_actions/submit_resource_action_request_using_post_responses.go index 395db4f4..637e8725 100644 --- a/pkg/client/deployment_actions/submit_resource_action_request_using_post_responses.go +++ b/pkg/client/deployment_actions/submit_resource_action_request_using_post_responses.go @@ -47,7 +47,6 @@ func (o *SubmitResourceActionRequestUsingPOSTReader) ReadResponse(response runti return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewSubmitResourceActionRequestUsingPOSTOK() *SubmitResourceActionRequestUsi return &SubmitResourceActionRequestUsingPOSTOK{} } -/*SubmitResourceActionRequestUsingPOSTOK handles this case with default header values. +/* SubmitResourceActionRequestUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type SubmitResourceActionRequestUsingPOSTOK struct { func (o *SubmitResourceActionRequestUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /deployment/api/deployments/{depId}/resources/{resourceId}/requests][%d] submitResourceActionRequestUsingPOSTOK %+v", 200, o.Payload) } - func (o *SubmitResourceActionRequestUsingPOSTOK) GetPayload() *models.Request { return o.Payload } @@ -91,7 +89,7 @@ func NewSubmitResourceActionRequestUsingPOSTUnauthorized() *SubmitResourceAction return &SubmitResourceActionRequestUsingPOSTUnauthorized{} } -/*SubmitResourceActionRequestUsingPOSTUnauthorized handles this case with default header values. +/* SubmitResourceActionRequestUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewSubmitResourceActionRequestUsingPOSTForbidden() *SubmitResourceActionReq return &SubmitResourceActionRequestUsingPOSTForbidden{} } -/*SubmitResourceActionRequestUsingPOSTForbidden handles this case with default header values. +/* SubmitResourceActionRequestUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewSubmitResourceActionRequestUsingPOSTNotFound() *SubmitResourceActionRequ return &SubmitResourceActionRequestUsingPOSTNotFound{} } -/*SubmitResourceActionRequestUsingPOSTNotFound handles this case with default header values. +/* SubmitResourceActionRequestUsingPOSTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type SubmitResourceActionRequestUsingPOSTNotFound struct { func (o *SubmitResourceActionRequestUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /deployment/api/deployments/{depId}/resources/{resourceId}/requests][%d] submitResourceActionRequestUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *SubmitResourceActionRequestUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_requests/deployment_requests_client.go b/pkg/client/deployment_requests/deployment_requests_client.go index 85b65fe3..41b9704d 100644 --- a/pkg/client/deployment_requests/deployment_requests_client.go +++ b/pkg/client/deployment_requests/deployment_requests_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsingGETParams) (*GetDeploymentRequestsUsingGETOK, error) + GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsingGETParams, opts ...ClientOption) (*GetDeploymentRequestsUsingGETOK, error) - GetEventLogsUsingGET(params *GetEventLogsUsingGETParams) (*GetEventLogsUsingGETOK, error) + GetEventLogsUsingGET(params *GetEventLogsUsingGETParams, opts ...ClientOption) (*GetEventLogsUsingGETOK, error) - GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams) (*GetRequestEventsUsingGETOK, error) + GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams, opts ...ClientOption) (*GetRequestEventsUsingGETOK, error) - GetRequestUsingGET(params *GetRequestUsingGETParams) (*GetRequestUsingGETOK, error) + GetRequestUsingGET(params *GetRequestUsingGETParams, opts ...ClientOption) (*GetRequestUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { Returns the requests for the deployment. */ -func (a *Client) GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsingGETParams) (*GetDeploymentRequestsUsingGETOK, error) { +func (a *Client) GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsingGETParams, opts ...ClientOption) (*GetDeploymentRequestsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentRequestsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentRequestsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/requests", @@ -60,7 +62,12 @@ func (a *Client) GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsin Reader: &GetDeploymentRequestsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +86,12 @@ func (a *Client) GetDeploymentRequestsUsingGET(params *GetDeploymentRequestsUsin Returns the logs for an event. */ -func (a *Client) GetEventLogsUsingGET(params *GetEventLogsUsingGETParams) (*GetEventLogsUsingGETOK, error) { +func (a *Client) GetEventLogsUsingGET(params *GetEventLogsUsingGETParams, opts ...ClientOption) (*GetEventLogsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetEventLogsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getEventLogsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/requests/{requestId}/events/{eventId}/logs", @@ -96,7 +102,12 @@ func (a *Client) GetEventLogsUsingGET(params *GetEventLogsUsingGETParams) (*GetE Reader: &GetEventLogsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +126,12 @@ func (a *Client) GetEventLogsUsingGET(params *GetEventLogsUsingGETParams) (*GetE Returns all the events for a request. */ -func (a *Client) GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams) (*GetRequestEventsUsingGETOK, error) { +func (a *Client) GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams, opts ...ClientOption) (*GetRequestEventsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRequestEventsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRequestEventsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/requests/{requestId}/events", @@ -132,7 +142,12 @@ func (a *Client) GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams Reader: &GetRequestEventsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -151,13 +166,12 @@ func (a *Client) GetRequestEventsUsingGET(params *GetRequestEventsUsingGETParams Returns the request with the given ID. */ -func (a *Client) GetRequestUsingGET(params *GetRequestUsingGETParams) (*GetRequestUsingGETOK, error) { +func (a *Client) GetRequestUsingGET(params *GetRequestUsingGETParams, opts ...ClientOption) (*GetRequestUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRequestUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRequestUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/requests/{requestId}", @@ -168,7 +182,12 @@ func (a *Client) GetRequestUsingGET(params *GetRequestUsingGETParams) (*GetReque Reader: &GetRequestUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/deployment_requests/get_deployment_requests_using_get_parameters.go b/pkg/client/deployment_requests/get_deployment_requests_using_get_parameters.go index 0180452a..8cfd8199 100644 --- a/pkg/client/deployment_requests/get_deployment_requests_using_get_parameters.go +++ b/pkg/client/deployment_requests/get_deployment_requests_using_get_parameters.go @@ -17,78 +17,88 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentRequestsUsingGETParams creates a new GetDeploymentRequestsUsingGETParams object -// with the default values initialized. +// NewGetDeploymentRequestsUsingGETParams creates a new GetDeploymentRequestsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentRequestsUsingGETParams() *GetDeploymentRequestsUsingGETParams { - var () return &GetDeploymentRequestsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentRequestsUsingGETParamsWithTimeout creates a new GetDeploymentRequestsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentRequestsUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentRequestsUsingGETParams { - var () return &GetDeploymentRequestsUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentRequestsUsingGETParamsWithContext creates a new GetDeploymentRequestsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentRequestsUsingGETParamsWithContext(ctx context.Context) *GetDeploymentRequestsUsingGETParams { - var () return &GetDeploymentRequestsUsingGETParams{ - Context: ctx, } } // NewGetDeploymentRequestsUsingGETParamsWithHTTPClient creates a new GetDeploymentRequestsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentRequestsUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentRequestsUsingGETParams { - var () return &GetDeploymentRequestsUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentRequestsUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment requests using g e t operation typically these are written to a http.Request +/* GetDeploymentRequestsUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment requests using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentRequestsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Deleted - Retrieves the soft-deleted requests that have not yet been completely deleted. + /* Deleted. + + Retrieves the soft-deleted requests that have not yet been completely deleted. */ Deleted *bool - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID @@ -97,6 +107,21 @@ type GetDeploymentRequestsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment requests using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentRequestsUsingGETParams) WithDefaults() *GetDeploymentRequestsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment requests using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentRequestsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment requests using get params func (o *GetDeploymentRequestsUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentRequestsUsingGETParams { o.SetTimeout(timeout) @@ -204,76 +229,83 @@ func (o *GetDeploymentRequestsUsingGETParams) WriteToRequest(r runtime.ClientReq } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } // path param depId @@ -286,3 +318,20 @@ func (o *GetDeploymentRequestsUsingGETParams) WriteToRequest(r runtime.ClientReq } return nil } + +// bindParamGetDeploymentRequestsUsingGET binds the parameter $orderby +func (o *GetDeploymentRequestsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/deployment_requests/get_deployment_requests_using_get_responses.go b/pkg/client/deployment_requests/get_deployment_requests_using_get_responses.go index f6dd71e5..7ab18d03 100644 --- a/pkg/client/deployment_requests/get_deployment_requests_using_get_responses.go +++ b/pkg/client/deployment_requests/get_deployment_requests_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentRequestsUsingGETReader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentRequestsUsingGETOK() *GetDeploymentRequestsUsingGETOK { return &GetDeploymentRequestsUsingGETOK{} } -/*GetDeploymentRequestsUsingGETOK handles this case with default header values. +/* GetDeploymentRequestsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentRequestsUsingGETOK struct { func (o *GetDeploymentRequestsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests][%d] getDeploymentRequestsUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentRequestsUsingGETOK) GetPayload() *models.PageOfRequest { return o.Payload } @@ -85,7 +83,7 @@ func NewGetDeploymentRequestsUsingGETUnauthorized() *GetDeploymentRequestsUsingG return &GetDeploymentRequestsUsingGETUnauthorized{} } -/*GetDeploymentRequestsUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentRequestsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetDeploymentRequestsUsingGETNotFound() *GetDeploymentRequestsUsingGETNo return &GetDeploymentRequestsUsingGETNotFound{} } -/*GetDeploymentRequestsUsingGETNotFound handles this case with default header values. +/* GetDeploymentRequestsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetDeploymentRequestsUsingGETNotFound struct { func (o *GetDeploymentRequestsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests][%d] getDeploymentRequestsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentRequestsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_requests/get_event_logs_using_get_parameters.go b/pkg/client/deployment_requests/get_event_logs_using_get_parameters.go index 67b54d71..1e680200 100644 --- a/pkg/client/deployment_requests/get_event_logs_using_get_parameters.go +++ b/pkg/client/deployment_requests/get_event_logs_using_get_parameters.go @@ -17,93 +17,112 @@ import ( "github.com/go-openapi/swag" ) -// NewGetEventLogsUsingGETParams creates a new GetEventLogsUsingGETParams object -// with the default values initialized. +// NewGetEventLogsUsingGETParams creates a new GetEventLogsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetEventLogsUsingGETParams() *GetEventLogsUsingGETParams { - var () return &GetEventLogsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetEventLogsUsingGETParamsWithTimeout creates a new GetEventLogsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetEventLogsUsingGETParamsWithTimeout(timeout time.Duration) *GetEventLogsUsingGETParams { - var () return &GetEventLogsUsingGETParams{ - timeout: timeout, } } // NewGetEventLogsUsingGETParamsWithContext creates a new GetEventLogsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetEventLogsUsingGETParamsWithContext(ctx context.Context) *GetEventLogsUsingGETParams { - var () return &GetEventLogsUsingGETParams{ - Context: ctx, } } // NewGetEventLogsUsingGETParamsWithHTTPClient creates a new GetEventLogsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetEventLogsUsingGETParamsWithHTTPClient(client *http.Client) *GetEventLogsUsingGETParams { - var () return &GetEventLogsUsingGETParams{ HTTPClient: client, } } -/*GetEventLogsUsingGETParams contains all the parameters to send to the API endpoint -for the get event logs using g e t operation typically these are written to a http.Request +/* GetEventLogsUsingGETParams contains all the parameters to send to the API endpoint + for the get event logs using g e t operation. + + Typically these are written to a http.Request. */ type GetEventLogsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Deleted - Retrieves the soft-deleted event logs that have not yet been completely deleted. + /* Deleted. + + Retrieves the soft-deleted event logs that have not yet been completely deleted. */ Deleted *bool - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*EventID - Event ID + /* EventID. + + Event ID + + Format: uuid */ EventID strfmt.UUID - /*RequestID - Request ID + /* RequestID. + + Request ID + + Format: uuid */ RequestID strfmt.UUID - /*SinceRow - A positive row number from which to show logs. + /* SinceRow. + + A positive row number from which to show logs. + + Format: int32 */ SinceRow *int32 @@ -112,6 +131,21 @@ type GetEventLogsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get event logs using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEventLogsUsingGETParams) WithDefaults() *GetEventLogsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get event logs using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEventLogsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get event logs using get params func (o *GetEventLogsUsingGETParams) WithTimeout(timeout time.Duration) *GetEventLogsUsingGETParams { o.SetTimeout(timeout) @@ -252,76 +286,83 @@ func (o *GetEventLogsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } // path param depId @@ -343,16 +384,17 @@ func (o *GetEventLogsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param sinceRow var qrSinceRow int32 + if o.SinceRow != nil { qrSinceRow = *o.SinceRow } qSinceRow := swag.FormatInt32(qrSinceRow) if qSinceRow != "" { + if err := r.SetQueryParam("sinceRow", qSinceRow); err != nil { return err } } - } if len(res) > 0 { @@ -360,3 +402,20 @@ func (o *GetEventLogsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } return nil } + +// bindParamGetEventLogsUsingGET binds the parameter $orderby +func (o *GetEventLogsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/deployment_requests/get_event_logs_using_get_responses.go b/pkg/client/deployment_requests/get_event_logs_using_get_responses.go index a84fc0af..13e588a0 100644 --- a/pkg/client/deployment_requests/get_event_logs_using_get_responses.go +++ b/pkg/client/deployment_requests/get_event_logs_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetEventLogsUsingGETReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetEventLogsUsingGETOK() *GetEventLogsUsingGETOK { return &GetEventLogsUsingGETOK{} } -/*GetEventLogsUsingGETOK handles this case with default header values. +/* GetEventLogsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetEventLogsUsingGETOK struct { func (o *GetEventLogsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}/events/{eventId}/logs][%d] getEventLogsUsingGETOK %+v", 200, o.Payload) } - func (o *GetEventLogsUsingGETOK) GetPayload() *models.SliceOfEventLog { return o.Payload } @@ -85,7 +83,7 @@ func NewGetEventLogsUsingGETUnauthorized() *GetEventLogsUsingGETUnauthorized { return &GetEventLogsUsingGETUnauthorized{} } -/*GetEventLogsUsingGETUnauthorized handles this case with default header values. +/* GetEventLogsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetEventLogsUsingGETNotFound() *GetEventLogsUsingGETNotFound { return &GetEventLogsUsingGETNotFound{} } -/*GetEventLogsUsingGETNotFound handles this case with default header values. +/* GetEventLogsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetEventLogsUsingGETNotFound struct { func (o *GetEventLogsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}/events/{eventId}/logs][%d] getEventLogsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetEventLogsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_requests/get_request_events_using_get_parameters.go b/pkg/client/deployment_requests/get_request_events_using_get_parameters.go index f878efb4..95a65a5c 100644 --- a/pkg/client/deployment_requests/get_request_events_using_get_parameters.go +++ b/pkg/client/deployment_requests/get_request_events_using_get_parameters.go @@ -17,83 +17,96 @@ import ( "github.com/go-openapi/swag" ) -// NewGetRequestEventsUsingGETParams creates a new GetRequestEventsUsingGETParams object -// with the default values initialized. +// NewGetRequestEventsUsingGETParams creates a new GetRequestEventsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRequestEventsUsingGETParams() *GetRequestEventsUsingGETParams { - var () return &GetRequestEventsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetRequestEventsUsingGETParamsWithTimeout creates a new GetRequestEventsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRequestEventsUsingGETParamsWithTimeout(timeout time.Duration) *GetRequestEventsUsingGETParams { - var () return &GetRequestEventsUsingGETParams{ - timeout: timeout, } } // NewGetRequestEventsUsingGETParamsWithContext creates a new GetRequestEventsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRequestEventsUsingGETParamsWithContext(ctx context.Context) *GetRequestEventsUsingGETParams { - var () return &GetRequestEventsUsingGETParams{ - Context: ctx, } } // NewGetRequestEventsUsingGETParamsWithHTTPClient creates a new GetRequestEventsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRequestEventsUsingGETParamsWithHTTPClient(client *http.Client) *GetRequestEventsUsingGETParams { - var () return &GetRequestEventsUsingGETParams{ HTTPClient: client, } } -/*GetRequestEventsUsingGETParams contains all the parameters to send to the API endpoint -for the get request events using g e t operation typically these are written to a http.Request +/* GetRequestEventsUsingGETParams contains all the parameters to send to the API endpoint + for the get request events using g e t operation. + + Typically these are written to a http.Request. */ type GetRequestEventsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Deleted - Retrieves the soft-deleted events of the request that have not yet been completely deleted. + /* Deleted. + + Retrieves the soft-deleted events of the request that have not yet been completely deleted. */ Deleted *bool - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*RequestID - Request ID + /* RequestID. + + Request ID + + Format: uuid */ RequestID strfmt.UUID @@ -102,6 +115,21 @@ type GetRequestEventsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get request events using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestEventsUsingGETParams) WithDefaults() *GetRequestEventsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get request events using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestEventsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get request events using get params func (o *GetRequestEventsUsingGETParams) WithTimeout(timeout time.Duration) *GetRequestEventsUsingGETParams { o.SetTimeout(timeout) @@ -220,76 +248,83 @@ func (o *GetRequestEventsUsingGETParams) WriteToRequest(r runtime.ClientRequest, } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } // path param depId @@ -307,3 +342,20 @@ func (o *GetRequestEventsUsingGETParams) WriteToRequest(r runtime.ClientRequest, } return nil } + +// bindParamGetRequestEventsUsingGET binds the parameter $orderby +func (o *GetRequestEventsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/deployment_requests/get_request_events_using_get_responses.go b/pkg/client/deployment_requests/get_request_events_using_get_responses.go index 8e7545a1..da43fcf7 100644 --- a/pkg/client/deployment_requests/get_request_events_using_get_responses.go +++ b/pkg/client/deployment_requests/get_request_events_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetRequestEventsUsingGETReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetRequestEventsUsingGETOK() *GetRequestEventsUsingGETOK { return &GetRequestEventsUsingGETOK{} } -/*GetRequestEventsUsingGETOK handles this case with default header values. +/* GetRequestEventsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetRequestEventsUsingGETOK struct { func (o *GetRequestEventsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}/events][%d] getRequestEventsUsingGETOK %+v", 200, o.Payload) } - func (o *GetRequestEventsUsingGETOK) GetPayload() *models.PageOfEvent { return o.Payload } @@ -85,7 +83,7 @@ func NewGetRequestEventsUsingGETUnauthorized() *GetRequestEventsUsingGETUnauthor return &GetRequestEventsUsingGETUnauthorized{} } -/*GetRequestEventsUsingGETUnauthorized handles this case with default header values. +/* GetRequestEventsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetRequestEventsUsingGETNotFound() *GetRequestEventsUsingGETNotFound { return &GetRequestEventsUsingGETNotFound{} } -/*GetRequestEventsUsingGETNotFound handles this case with default header values. +/* GetRequestEventsUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetRequestEventsUsingGETNotFound struct { func (o *GetRequestEventsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}/events][%d] getRequestEventsUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetRequestEventsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployment_requests/get_request_using_get_parameters.go b/pkg/client/deployment_requests/get_request_using_get_parameters.go index 91357d53..2242879c 100644 --- a/pkg/client/deployment_requests/get_request_using_get_parameters.go +++ b/pkg/client/deployment_requests/get_request_using_get_parameters.go @@ -17,68 +17,74 @@ import ( "github.com/go-openapi/swag" ) -// NewGetRequestUsingGETParams creates a new GetRequestUsingGETParams object -// with the default values initialized. +// NewGetRequestUsingGETParams creates a new GetRequestUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRequestUsingGETParams() *GetRequestUsingGETParams { - var () return &GetRequestUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetRequestUsingGETParamsWithTimeout creates a new GetRequestUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRequestUsingGETParamsWithTimeout(timeout time.Duration) *GetRequestUsingGETParams { - var () return &GetRequestUsingGETParams{ - timeout: timeout, } } // NewGetRequestUsingGETParamsWithContext creates a new GetRequestUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRequestUsingGETParamsWithContext(ctx context.Context) *GetRequestUsingGETParams { - var () return &GetRequestUsingGETParams{ - Context: ctx, } } // NewGetRequestUsingGETParamsWithHTTPClient creates a new GetRequestUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRequestUsingGETParamsWithHTTPClient(client *http.Client) *GetRequestUsingGETParams { - var () return &GetRequestUsingGETParams{ HTTPClient: client, } } -/*GetRequestUsingGETParams contains all the parameters to send to the API endpoint -for the get request using g e t operation typically these are written to a http.Request +/* GetRequestUsingGETParams contains all the parameters to send to the API endpoint + for the get request using g e t operation. + + Typically these are written to a http.Request. */ type GetRequestUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Deleted - Retrieves the request, includes soft-deleted request that have not yet been completely deleted. + /* Deleted. + + Retrieves the request, includes soft-deleted request that have not yet been completely deleted. */ Deleted *bool - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*RequestID - Request ID + /* RequestID. + + Request ID + + Format: uuid */ RequestID strfmt.UUID @@ -87,6 +93,21 @@ type GetRequestUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get request using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestUsingGETParams) WithDefaults() *GetRequestUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get request using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get request using get params func (o *GetRequestUsingGETParams) WithTimeout(timeout time.Duration) *GetRequestUsingGETParams { o.SetTimeout(timeout) @@ -176,32 +197,34 @@ func (o *GetRequestUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployment_requests/get_request_using_get_responses.go b/pkg/client/deployment_requests/get_request_using_get_responses.go index 3e0de0c0..646f0097 100644 --- a/pkg/client/deployment_requests/get_request_using_get_responses.go +++ b/pkg/client/deployment_requests/get_request_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetRequestUsingGETReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetRequestUsingGETOK() *GetRequestUsingGETOK { return &GetRequestUsingGETOK{} } -/*GetRequestUsingGETOK handles this case with default header values. +/* GetRequestUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetRequestUsingGETOK struct { func (o *GetRequestUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}][%d] getRequestUsingGETOK %+v", 200, o.Payload) } - func (o *GetRequestUsingGETOK) GetPayload() *models.Request { return o.Payload } @@ -85,7 +83,7 @@ func NewGetRequestUsingGETUnauthorized() *GetRequestUsingGETUnauthorized { return &GetRequestUsingGETUnauthorized{} } -/*GetRequestUsingGETUnauthorized handles this case with default header values. +/* GetRequestUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetRequestUsingGETNotFound() *GetRequestUsingGETNotFound { return &GetRequestUsingGETNotFound{} } -/*GetRequestUsingGETNotFound handles this case with default header values. +/* GetRequestUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetRequestUsingGETNotFound struct { func (o *GetRequestUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/requests/{requestId}][%d] getRequestUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetRequestUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/check_deployment_name_using_get_parameters.go b/pkg/client/deployments/check_deployment_name_using_get_parameters.go index 53c49ac8..01abc93c 100644 --- a/pkg/client/deployments/check_deployment_name_using_get_parameters.go +++ b/pkg/client/deployments/check_deployment_name_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCheckDeploymentNameUsingGETParams creates a new CheckDeploymentNameUsingGETParams object -// with the default values initialized. +// NewCheckDeploymentNameUsingGETParams creates a new CheckDeploymentNameUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCheckDeploymentNameUsingGETParams() *CheckDeploymentNameUsingGETParams { - var () return &CheckDeploymentNameUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewCheckDeploymentNameUsingGETParamsWithTimeout creates a new CheckDeploymentNameUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCheckDeploymentNameUsingGETParamsWithTimeout(timeout time.Duration) *CheckDeploymentNameUsingGETParams { - var () return &CheckDeploymentNameUsingGETParams{ - timeout: timeout, } } // NewCheckDeploymentNameUsingGETParamsWithContext creates a new CheckDeploymentNameUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCheckDeploymentNameUsingGETParamsWithContext(ctx context.Context) *CheckDeploymentNameUsingGETParams { - var () return &CheckDeploymentNameUsingGETParams{ - Context: ctx, } } // NewCheckDeploymentNameUsingGETParamsWithHTTPClient creates a new CheckDeploymentNameUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCheckDeploymentNameUsingGETParamsWithHTTPClient(client *http.Client) *CheckDeploymentNameUsingGETParams { - var () return &CheckDeploymentNameUsingGETParams{ HTTPClient: client, } } -/*CheckDeploymentNameUsingGETParams contains all the parameters to send to the API endpoint -for the check deployment name using g e t operation typically these are written to a http.Request +/* CheckDeploymentNameUsingGETParams contains all the parameters to send to the API endpoint + for the check deployment name using g e t operation. + + Typically these are written to a http.Request. */ type CheckDeploymentNameUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Name - Deployment name + /* Name. + + Deployment name */ Name string @@ -76,6 +76,21 @@ type CheckDeploymentNameUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the check deployment name using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckDeploymentNameUsingGETParams) WithDefaults() *CheckDeploymentNameUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the check deployment name using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckDeploymentNameUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the check deployment name using get params func (o *CheckDeploymentNameUsingGETParams) WithTimeout(timeout time.Duration) *CheckDeploymentNameUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *CheckDeploymentNameUsingGETParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param name diff --git a/pkg/client/deployments/check_deployment_name_using_get_responses.go b/pkg/client/deployments/check_deployment_name_using_get_responses.go index ba866ff2..1fcf0e7d 100644 --- a/pkg/client/deployments/check_deployment_name_using_get_responses.go +++ b/pkg/client/deployments/check_deployment_name_using_get_responses.go @@ -41,7 +41,6 @@ func (o *CheckDeploymentNameUsingGETReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCheckDeploymentNameUsingGETOK() *CheckDeploymentNameUsingGETOK { return &CheckDeploymentNameUsingGETOK{} } -/*CheckDeploymentNameUsingGETOK handles this case with default header values. +/* CheckDeploymentNameUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -73,7 +72,7 @@ func NewCheckDeploymentNameUsingGETUnauthorized() *CheckDeploymentNameUsingGETUn return &CheckDeploymentNameUsingGETUnauthorized{} } -/*CheckDeploymentNameUsingGETUnauthorized handles this case with default header values. +/* CheckDeploymentNameUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -94,7 +93,7 @@ func NewCheckDeploymentNameUsingGETNotFound() *CheckDeploymentNameUsingGETNotFou return &CheckDeploymentNameUsingGETNotFound{} } -/*CheckDeploymentNameUsingGETNotFound handles this case with default header values. +/* CheckDeploymentNameUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -105,7 +104,6 @@ type CheckDeploymentNameUsingGETNotFound struct { func (o *CheckDeploymentNameUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/names/{name}][%d] checkDeploymentNameUsingGETNotFound %+v", 404, o.Payload) } - func (o *CheckDeploymentNameUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/delete_deployment_using_delete_parameters.go b/pkg/client/deployments/delete_deployment_using_delete_parameters.go index b60dce67..50a8f6df 100644 --- a/pkg/client/deployments/delete_deployment_using_delete_parameters.go +++ b/pkg/client/deployments/delete_deployment_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteDeploymentUsingDELETEParams creates a new DeleteDeploymentUsingDELETEParams object -// with the default values initialized. +// NewDeleteDeploymentUsingDELETEParams creates a new DeleteDeploymentUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteDeploymentUsingDELETEParams() *DeleteDeploymentUsingDELETEParams { - var () return &DeleteDeploymentUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteDeploymentUsingDELETEParamsWithTimeout creates a new DeleteDeploymentUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteDeploymentUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteDeploymentUsingDELETEParams { - var () return &DeleteDeploymentUsingDELETEParams{ - timeout: timeout, } } // NewDeleteDeploymentUsingDELETEParamsWithContext creates a new DeleteDeploymentUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteDeploymentUsingDELETEParamsWithContext(ctx context.Context) *DeleteDeploymentUsingDELETEParams { - var () return &DeleteDeploymentUsingDELETEParams{ - Context: ctx, } } // NewDeleteDeploymentUsingDELETEParamsWithHTTPClient creates a new DeleteDeploymentUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteDeploymentUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteDeploymentUsingDELETEParams { - var () return &DeleteDeploymentUsingDELETEParams{ HTTPClient: client, } } -/*DeleteDeploymentUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete deployment using d e l e t e operation typically these are written to a http.Request +/* DeleteDeploymentUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete deployment using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteDeploymentUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteDeploymentUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete deployment using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentUsingDELETEParams) WithDefaults() *DeleteDeploymentUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete deployment using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete deployment using d e l e t e params func (o *DeleteDeploymentUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteDeploymentUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteDeploymentUsingDELETEParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployments/delete_deployment_using_delete_responses.go b/pkg/client/deployments/delete_deployment_using_delete_responses.go index dfee3ec8..a7ad9bc7 100644 --- a/pkg/client/deployments/delete_deployment_using_delete_responses.go +++ b/pkg/client/deployments/delete_deployment_using_delete_responses.go @@ -47,7 +47,6 @@ func (o *DeleteDeploymentUsingDELETEReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeleteDeploymentUsingDELETEOK() *DeleteDeploymentUsingDELETEOK { return &DeleteDeploymentUsingDELETEOK{} } -/*DeleteDeploymentUsingDELETEOK handles this case with default header values. +/* DeleteDeploymentUsingDELETEOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type DeleteDeploymentUsingDELETEOK struct { func (o *DeleteDeploymentUsingDELETEOK) Error() string { return fmt.Sprintf("[DELETE /deployment/api/deployments/{depId}][%d] deleteDeploymentUsingDELETEOK %+v", 200, o.Payload) } - func (o *DeleteDeploymentUsingDELETEOK) GetPayload() *models.Request { return o.Payload } @@ -91,7 +89,7 @@ func NewDeleteDeploymentUsingDELETEUnauthorized() *DeleteDeploymentUsingDELETEUn return &DeleteDeploymentUsingDELETEUnauthorized{} } -/*DeleteDeploymentUsingDELETEUnauthorized handles this case with default header values. +/* DeleteDeploymentUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewDeleteDeploymentUsingDELETEForbidden() *DeleteDeploymentUsingDELETEForbi return &DeleteDeploymentUsingDELETEForbidden{} } -/*DeleteDeploymentUsingDELETEForbidden handles this case with default header values. +/* DeleteDeploymentUsingDELETEForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewDeleteDeploymentUsingDELETENotFound() *DeleteDeploymentUsingDELETENotFou return &DeleteDeploymentUsingDELETENotFound{} } -/*DeleteDeploymentUsingDELETENotFound handles this case with default header values. +/* DeleteDeploymentUsingDELETENotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type DeleteDeploymentUsingDELETENotFound struct { func (o *DeleteDeploymentUsingDELETENotFound) Error() string { return fmt.Sprintf("[DELETE /deployment/api/deployments/{depId}][%d] deleteDeploymentUsingDELETENotFound %+v", 404, o.Payload) } - func (o *DeleteDeploymentUsingDELETENotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/delete_resource_using_delete_parameters.go b/pkg/client/deployments/delete_resource_using_delete_parameters.go index 610e0247..85bbbd5c 100644 --- a/pkg/client/deployments/delete_resource_using_delete_parameters.go +++ b/pkg/client/deployments/delete_resource_using_delete_parameters.go @@ -16,63 +16,68 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteResourceUsingDELETEParams creates a new DeleteResourceUsingDELETEParams object -// with the default values initialized. +// NewDeleteResourceUsingDELETEParams creates a new DeleteResourceUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteResourceUsingDELETEParams() *DeleteResourceUsingDELETEParams { - var () return &DeleteResourceUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteResourceUsingDELETEParamsWithTimeout creates a new DeleteResourceUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteResourceUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteResourceUsingDELETEParams { - var () return &DeleteResourceUsingDELETEParams{ - timeout: timeout, } } // NewDeleteResourceUsingDELETEParamsWithContext creates a new DeleteResourceUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteResourceUsingDELETEParamsWithContext(ctx context.Context) *DeleteResourceUsingDELETEParams { - var () return &DeleteResourceUsingDELETEParams{ - Context: ctx, } } // NewDeleteResourceUsingDELETEParamsWithHTTPClient creates a new DeleteResourceUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteResourceUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteResourceUsingDELETEParams { - var () return &DeleteResourceUsingDELETEParams{ HTTPClient: client, } } -/*DeleteResourceUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete resource using d e l e t e operation typically these are written to a http.Request +/* DeleteResourceUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete resource using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteResourceUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*ResourceID - Resource ID + /* ResourceID. + + Resource ID + + Format: uuid */ ResourceID strfmt.UUID @@ -81,6 +86,21 @@ type DeleteResourceUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete resource using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteResourceUsingDELETEParams) WithDefaults() *DeleteResourceUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete resource using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteResourceUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete resource using d e l e t e params func (o *DeleteResourceUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteResourceUsingDELETEParams { o.SetTimeout(timeout) @@ -159,16 +179,17 @@ func (o *DeleteResourceUsingDELETEParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployments/delete_resource_using_delete_responses.go b/pkg/client/deployments/delete_resource_using_delete_responses.go index b762f0d8..be231d6a 100644 --- a/pkg/client/deployments/delete_resource_using_delete_responses.go +++ b/pkg/client/deployments/delete_resource_using_delete_responses.go @@ -47,7 +47,6 @@ func (o *DeleteResourceUsingDELETEReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeleteResourceUsingDELETEOK() *DeleteResourceUsingDELETEOK { return &DeleteResourceUsingDELETEOK{} } -/*DeleteResourceUsingDELETEOK handles this case with default header values. +/* DeleteResourceUsingDELETEOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type DeleteResourceUsingDELETEOK struct { func (o *DeleteResourceUsingDELETEOK) Error() string { return fmt.Sprintf("[DELETE /deployment/api/deployments/{depId}/resources/{resourceId}][%d] deleteResourceUsingDELETEOK %+v", 200, o.Payload) } - func (o *DeleteResourceUsingDELETEOK) GetPayload() *models.Request { return o.Payload } @@ -91,7 +89,7 @@ func NewDeleteResourceUsingDELETEUnauthorized() *DeleteResourceUsingDELETEUnauth return &DeleteResourceUsingDELETEUnauthorized{} } -/*DeleteResourceUsingDELETEUnauthorized handles this case with default header values. +/* DeleteResourceUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewDeleteResourceUsingDELETEForbidden() *DeleteResourceUsingDELETEForbidden return &DeleteResourceUsingDELETEForbidden{} } -/*DeleteResourceUsingDELETEForbidden handles this case with default header values. +/* DeleteResourceUsingDELETEForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewDeleteResourceUsingDELETENotFound() *DeleteResourceUsingDELETENotFound { return &DeleteResourceUsingDELETENotFound{} } -/*DeleteResourceUsingDELETENotFound handles this case with default header values. +/* DeleteResourceUsingDELETENotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type DeleteResourceUsingDELETENotFound struct { func (o *DeleteResourceUsingDELETENotFound) Error() string { return fmt.Sprintf("[DELETE /deployment/api/deployments/{depId}/resources/{resourceId}][%d] deleteResourceUsingDELETENotFound %+v", 404, o.Payload) } - func (o *DeleteResourceUsingDELETENotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/deployments_client.go b/pkg/client/deployments/deployments_client.go index c2410e07..848f9ad4 100644 --- a/pkg/client/deployments/deployments_client.go +++ b/pkg/client/deployments/deployments_client.go @@ -25,31 +25,34 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGETParams) (*CheckDeploymentNameUsingGETOK, error) + CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGETParams, opts ...ClientOption) (*CheckDeploymentNameUsingGETOK, error) - DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETEParams) (*DeleteDeploymentUsingDELETEOK, error) + DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETEParams, opts ...ClientOption) (*DeleteDeploymentUsingDELETEOK, error) - DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEParams) (*DeleteResourceUsingDELETEOK, error) + DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEParams, opts ...ClientOption) (*DeleteResourceUsingDELETEOK, error) - GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETParams) (*GetDeploymentByIDUsingGETOK, error) + GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentByIDUsingGETOK, error) - GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentExpenseHistoryByIDUsingGETParams) (*GetDeploymentExpenseHistoryByIDUsingGETOK, error) + GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentExpenseHistoryByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentExpenseHistoryByIDUsingGETOK, error) - GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByIDUsingGETParams) (*GetDeploymentFilterByIDUsingGETOK, error) + GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentFilterByIDUsingGETOK, error) - GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingGETParams) (*GetDeploymentFiltersUsingGETOK, error) + GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingGETParams, opts ...ClientOption) (*GetDeploymentFiltersUsingGETOK, error) - GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUsingGETParams) (*GetDeploymentResourcesUsingGETOK, error) + GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUsingGETParams, opts ...ClientOption) (*GetDeploymentResourcesUsingGETOK, error) - GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProjectUsingGETParams) (*GetDeploymentsForProjectUsingGETOK, error) + GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProjectUsingGETParams, opts ...ClientOption) (*GetDeploymentsForProjectUsingGETOK, error) - GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams) (*GetDeploymentsUsingGETOK, error) + GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams, opts ...ClientOption) (*GetDeploymentsUsingGETOK, error) - GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams) (*GetResourceByIDUsingGETOK, error) + GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams, opts ...ClientOption) (*GetResourceByIDUsingGETOK, error) - PatchDeploymentUsingPATCH(params *PatchDeploymentUsingPATCHParams) (*PatchDeploymentUsingPATCHOK, error) + PatchDeploymentUsingPATCH(params *PatchDeploymentUsingPATCHParams, opts ...ClientOption) (*PatchDeploymentUsingPATCHOK, error) SetTransport(transport runtime.ClientTransport) } @@ -59,13 +62,12 @@ type ClientService interface { Returns OK if a deployment with the supplied name exists. */ -func (a *Client) CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGETParams) (*CheckDeploymentNameUsingGETOK, error) { +func (a *Client) CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGETParams, opts ...ClientOption) (*CheckDeploymentNameUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCheckDeploymentNameUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "checkDeploymentNameUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/names/{name}", @@ -76,7 +78,12 @@ func (a *Client) CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGET Reader: &CheckDeploymentNameUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -95,13 +102,12 @@ func (a *Client) CheckDeploymentNameUsingGET(params *CheckDeploymentNameUsingGET Deletes the deployment with the supplied ID, cleans up the associated resources from the Cloud Provider. */ -func (a *Client) DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETEParams) (*DeleteDeploymentUsingDELETEOK, error) { +func (a *Client) DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETEParams, opts ...ClientOption) (*DeleteDeploymentUsingDELETEOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteDeploymentUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteDeploymentUsingDELETE", Method: "DELETE", PathPattern: "/deployment/api/deployments/{depId}", @@ -112,7 +118,12 @@ func (a *Client) DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETE Reader: &DeleteDeploymentUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -131,13 +142,12 @@ func (a *Client) DeleteDeploymentUsingDELETE(params *DeleteDeploymentUsingDELETE Deletes the resource with the specified ID and attempts to delete resource from the Cloud Provider. */ -func (a *Client) DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEParams) (*DeleteResourceUsingDELETEOK, error) { +func (a *Client) DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEParams, opts ...ClientOption) (*DeleteResourceUsingDELETEOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteResourceUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteResourceUsingDELETE", Method: "DELETE", PathPattern: "/deployment/api/deployments/{depId}/resources/{resourceId}", @@ -148,7 +158,12 @@ func (a *Client) DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEPara Reader: &DeleteResourceUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -167,13 +182,12 @@ func (a *Client) DeleteResourceUsingDELETE(params *DeleteResourceUsingDELETEPara Returns the deployment with the supplied ID. */ -func (a *Client) GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETParams) (*GetDeploymentByIDUsingGETOK, error) { +func (a *Client) GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentByIdUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}", @@ -184,7 +198,12 @@ func (a *Client) GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETPara Reader: &GetDeploymentByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -203,13 +222,12 @@ func (a *Client) GetDeploymentByIDUsingGET(params *GetDeploymentByIDUsingGETPara Returns the deployment expense history with the supplied ID. */ -func (a *Client) GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentExpenseHistoryByIDUsingGETParams) (*GetDeploymentExpenseHistoryByIDUsingGETOK, error) { +func (a *Client) GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentExpenseHistoryByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentExpenseHistoryByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentExpenseHistoryByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentExpenseHistoryByIdUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/expense-history", @@ -220,7 +238,12 @@ func (a *Client) GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentEx Reader: &GetDeploymentExpenseHistoryByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -237,13 +260,12 @@ func (a *Client) GetDeploymentExpenseHistoryByIDUsingGET(params *GetDeploymentEx /* GetDeploymentFilterByIDUsingGET returns the deployment filter with the supplied ID */ -func (a *Client) GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByIDUsingGETParams) (*GetDeploymentFilterByIDUsingGETOK, error) { +func (a *Client) GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByIDUsingGETParams, opts ...ClientOption) (*GetDeploymentFilterByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentFilterByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentFilterByIdUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/filters/{filterId}", @@ -254,7 +276,12 @@ func (a *Client) GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByID Reader: &GetDeploymentFilterByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -271,13 +298,12 @@ func (a *Client) GetDeploymentFilterByIDUsingGET(params *GetDeploymentFilterByID /* GetDeploymentFiltersUsingGET returns the deployment filters in context of given user */ -func (a *Client) GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingGETParams) (*GetDeploymentFiltersUsingGETOK, error) { +func (a *Client) GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingGETParams, opts ...ClientOption) (*GetDeploymentFiltersUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentFiltersUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentFiltersUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/filters", @@ -288,7 +314,12 @@ func (a *Client) GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingG Reader: &GetDeploymentFiltersUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -307,13 +338,12 @@ func (a *Client) GetDeploymentFiltersUsingGET(params *GetDeploymentFiltersUsingG Returns a paginated list of resources corresponding to the deployment with the supplied ID. */ -func (a *Client) GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUsingGETParams) (*GetDeploymentResourcesUsingGETOK, error) { +func (a *Client) GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUsingGETParams, opts ...ClientOption) (*GetDeploymentResourcesUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentResourcesUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentResourcesUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/resources", @@ -324,7 +354,12 @@ func (a *Client) GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUs Reader: &GetDeploymentResourcesUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -341,13 +376,12 @@ func (a *Client) GetDeploymentResourcesUsingGET(params *GetDeploymentResourcesUs /* GetDeploymentsForProjectUsingGET returns a count of deployments using the project */ -func (a *Client) GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProjectUsingGETParams) (*GetDeploymentsForProjectUsingGETOK, error) { +func (a *Client) GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProjectUsingGETParams, opts ...ClientOption) (*GetDeploymentsForProjectUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentsForProjectUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentsForProjectUsingGET", Method: "GET", PathPattern: "/deployment/api/projects/{projectId}/deployment-count", @@ -358,7 +392,12 @@ func (a *Client) GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProje Reader: &GetDeploymentsForProjectUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -377,13 +416,12 @@ func (a *Client) GetDeploymentsForProjectUsingGET(params *GetDeploymentsForProje Returns a paginated list of deployments. Deployments with more than 100 resources is not supported. */ -func (a *Client) GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams) (*GetDeploymentsUsingGETOK, error) { +func (a *Client) GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams, opts ...ClientOption) (*GetDeploymentsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDeploymentsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDeploymentsUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments", @@ -394,7 +432,12 @@ func (a *Client) GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams) (* Reader: &GetDeploymentsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -413,13 +456,12 @@ func (a *Client) GetDeploymentsUsingGET(params *GetDeploymentsUsingGETParams) (* Returns the resource with the specified ID that is correlated with the supplied deployment. */ -func (a *Client) GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams) (*GetResourceByIDUsingGETOK, error) { +func (a *Client) GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams, opts ...ClientOption) (*GetResourceByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourceByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getResourceByIdUsingGET", Method: "GET", PathPattern: "/deployment/api/deployments/{depId}/resources/{resourceId}", @@ -430,7 +472,12 @@ func (a *Client) GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams) Reader: &GetResourceByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -449,13 +496,12 @@ func (a *Client) GetResourceByIDUsingGET(params *GetResourceByIDUsingGETParams) Updates the deployment with the supplied ID. */ -func (a *Client) PatchDeploymentUsingPATCH(params *PatchDeploymentUsingPATCHParams) (*PatchDeploymentUsingPATCHOK, error) { +func (a *Client) PatchDeploymentUsingPATCH(params *PatchDeploymentUsingPATCHParams, opts ...ClientOption) (*PatchDeploymentUsingPATCHOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchDeploymentUsingPATCHParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchDeploymentUsingPATCH", Method: "PATCH", PathPattern: "/deployment/api/deployments/{depId}", @@ -466,7 +512,12 @@ func (a *Client) PatchDeploymentUsingPATCH(params *PatchDeploymentUsingPATCHPara Reader: &PatchDeploymentUsingPATCHReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/deployments/get_deployment_by_id_using_get_parameters.go b/pkg/client/deployments/get_deployment_by_id_using_get_parameters.go index 0b0a2414..c6bc6064 100644 --- a/pkg/client/deployments/get_deployment_by_id_using_get_parameters.go +++ b/pkg/client/deployments/get_deployment_by_id_using_get_parameters.go @@ -17,83 +17,90 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentByIDUsingGETParams creates a new GetDeploymentByIDUsingGETParams object -// with the default values initialized. +// NewGetDeploymentByIDUsingGETParams creates a new GetDeploymentByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentByIDUsingGETParams() *GetDeploymentByIDUsingGETParams { - var () return &GetDeploymentByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentByIDUsingGETParamsWithTimeout creates a new GetDeploymentByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentByIDUsingGETParams { - var () return &GetDeploymentByIDUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentByIDUsingGETParamsWithContext creates a new GetDeploymentByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentByIDUsingGETParamsWithContext(ctx context.Context) *GetDeploymentByIDUsingGETParams { - var () return &GetDeploymentByIDUsingGETParams{ - Context: ctx, } } // NewGetDeploymentByIDUsingGETParamsWithHTTPClient creates a new GetDeploymentByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentByIDUsingGETParams { - var () return &GetDeploymentByIDUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment by Id using g e t operation typically these are written to a http.Request +/* GetDeploymentByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Deleted - Retrieves the deployment, includes soft-deleted deployments that have not yet been completely deleted. + /* Deleted. + + Retrieves the deployment, includes soft-deleted deployments that have not yet been completely deleted. */ Deleted *bool - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*Expand - The expanded details of the requested comma separated objects. 'resources' option returns resources with all properties. Ex. blueprint, project + /* Expand. + + The expanded details of the requested comma separated objects. 'resources' option returns resources with all properties. Ex. blueprint, project */ Expand []string - /*ExpandLastRequest - Expands deployment last request. + /* ExpandLastRequest. + + Expands deployment last request. */ ExpandLastRequest *bool - /*ExpandProject - The 'project' field of the deployment will be retrieved. + /* ExpandProject. + + The 'project' field of the deployment will be retrieved. */ ExpandProject *bool - /*ExpandResources - The 'resources' field of the deployment will be retrieved. + /* ExpandResources. + + The 'resources' field of the deployment will be retrieved. */ ExpandResources *bool @@ -102,6 +109,21 @@ type GetDeploymentByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentByIDUsingGETParams) WithDefaults() *GetDeploymentByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment by Id using get params func (o *GetDeploymentByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentByIDUsingGETParams { o.SetTimeout(timeout) @@ -224,32 +246,34 @@ func (o *GetDeploymentByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } // path param depId @@ -257,60 +281,66 @@ func (o *GetDeploymentByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest return err } - valuesExpand := o.Expand + if o.Expand != nil { - joinedExpand := swag.JoinByFormat(valuesExpand, "multi") - // query array param expand - if err := r.SetQueryParam("expand", joinedExpand...); err != nil { - return err + // binding items for expand + joinedExpand := o.bindParamExpand(reg) + + // query array param expand + if err := r.SetQueryParam("expand", joinedExpand...); err != nil { + return err + } } if o.ExpandLastRequest != nil { // query param expandLastRequest var qrExpandLastRequest bool + if o.ExpandLastRequest != nil { qrExpandLastRequest = *o.ExpandLastRequest } qExpandLastRequest := swag.FormatBool(qrExpandLastRequest) if qExpandLastRequest != "" { + if err := r.SetQueryParam("expandLastRequest", qExpandLastRequest); err != nil { return err } } - } if o.ExpandProject != nil { // query param expandProject var qrExpandProject bool + if o.ExpandProject != nil { qrExpandProject = *o.ExpandProject } qExpandProject := swag.FormatBool(qrExpandProject) if qExpandProject != "" { + if err := r.SetQueryParam("expandProject", qExpandProject); err != nil { return err } } - } if o.ExpandResources != nil { // query param expandResources var qrExpandResources bool + if o.ExpandResources != nil { qrExpandResources = *o.ExpandResources } qExpandResources := swag.FormatBool(qrExpandResources) if qExpandResources != "" { + if err := r.SetQueryParam("expandResources", qExpandResources); err != nil { return err } } - } if len(res) > 0 { @@ -318,3 +348,20 @@ func (o *GetDeploymentByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest } return nil } + +// bindParamGetDeploymentByIDUsingGET binds the parameter expand +func (o *GetDeploymentByIDUsingGETParams) bindParamExpand(formats strfmt.Registry) []string { + expandIR := o.Expand + + var expandIC []string + for _, expandIIR := range expandIR { // explode []string + + expandIIV := expandIIR // string as string + expandIC = append(expandIC, expandIIV) + } + + // items.CollectionFormat: "multi" + expandIS := swag.JoinByFormat(expandIC, "multi") + + return expandIS +} diff --git a/pkg/client/deployments/get_deployment_by_id_using_get_responses.go b/pkg/client/deployments/get_deployment_by_id_using_get_responses.go index 71fb29f0..18d12ba1 100644 --- a/pkg/client/deployments/get_deployment_by_id_using_get_responses.go +++ b/pkg/client/deployments/get_deployment_by_id_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentByIDUsingGETReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentByIDUsingGETOK() *GetDeploymentByIDUsingGETOK { return &GetDeploymentByIDUsingGETOK{} } -/*GetDeploymentByIDUsingGETOK handles this case with default header values. +/* GetDeploymentByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentByIDUsingGETOK struct { func (o *GetDeploymentByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}][%d] getDeploymentByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentByIDUsingGETOK) GetPayload() *models.Deployment { return o.Payload } @@ -85,7 +83,7 @@ func NewGetDeploymentByIDUsingGETUnauthorized() *GetDeploymentByIDUsingGETUnauth return &GetDeploymentByIDUsingGETUnauthorized{} } -/*GetDeploymentByIDUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetDeploymentByIDUsingGETNotFound() *GetDeploymentByIDUsingGETNotFound { return &GetDeploymentByIDUsingGETNotFound{} } -/*GetDeploymentByIDUsingGETNotFound handles this case with default header values. +/* GetDeploymentByIDUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetDeploymentByIDUsingGETNotFound struct { func (o *GetDeploymentByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}][%d] getDeploymentByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_parameters.go b/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_parameters.go index 1c02110e..1f18fe50 100644 --- a/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_parameters.go +++ b/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_parameters.go @@ -16,73 +16,82 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDeploymentExpenseHistoryByIDUsingGETParams creates a new GetDeploymentExpenseHistoryByIDUsingGETParams object -// with the default values initialized. +// NewGetDeploymentExpenseHistoryByIDUsingGETParams creates a new GetDeploymentExpenseHistoryByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentExpenseHistoryByIDUsingGETParams() *GetDeploymentExpenseHistoryByIDUsingGETParams { - var () return &GetDeploymentExpenseHistoryByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithTimeout creates a new GetDeploymentExpenseHistoryByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentExpenseHistoryByIDUsingGETParams { - var () return &GetDeploymentExpenseHistoryByIDUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithContext creates a new GetDeploymentExpenseHistoryByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithContext(ctx context.Context) *GetDeploymentExpenseHistoryByIDUsingGETParams { - var () return &GetDeploymentExpenseHistoryByIDUsingGETParams{ - Context: ctx, } } // NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithHTTPClient creates a new GetDeploymentExpenseHistoryByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentExpenseHistoryByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentExpenseHistoryByIDUsingGETParams { - var () return &GetDeploymentExpenseHistoryByIDUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentExpenseHistoryByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment expense history by Id using g e t operation typically these are written to a http.Request +/* GetDeploymentExpenseHistoryByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment expense history by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentExpenseHistoryByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*From - The timestamp from when history is requested. Should be of ISO_INSTANT format. + /* From. + + The timestamp from when history is requested. Should be of ISO_INSTANT format. + + Format: date-time */ From *strfmt.DateTime - /*Interval - The interval of the expense history. Should be one of daily, weekly or monthly. + /* Interval. + + The interval of the expense history. Should be one of daily, weekly or monthly. */ Interval *string - /*To - The timestamp until when history is requested. Should be of ISO_INSTANT format. + /* To. + + The timestamp until when history is requested. Should be of ISO_INSTANT format. + + Format: date-time */ To *strfmt.DateTime @@ -91,6 +100,21 @@ type GetDeploymentExpenseHistoryByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment expense history by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentExpenseHistoryByIDUsingGETParams) WithDefaults() *GetDeploymentExpenseHistoryByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment expense history by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentExpenseHistoryByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment expense history by Id using get params func (o *GetDeploymentExpenseHistoryByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentExpenseHistoryByIDUsingGETParams { o.SetTimeout(timeout) @@ -191,16 +215,17 @@ func (o *GetDeploymentExpenseHistoryByIDUsingGETParams) WriteToRequest(r runtime // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId @@ -212,48 +237,51 @@ func (o *GetDeploymentExpenseHistoryByIDUsingGETParams) WriteToRequest(r runtime // query param from var qrFrom strfmt.DateTime + if o.From != nil { qrFrom = *o.From } qFrom := qrFrom.String() if qFrom != "" { + if err := r.SetQueryParam("from", qFrom); err != nil { return err } } - } if o.Interval != nil { // query param interval var qrInterval string + if o.Interval != nil { qrInterval = *o.Interval } qInterval := qrInterval if qInterval != "" { + if err := r.SetQueryParam("interval", qInterval); err != nil { return err } } - } if o.To != nil { // query param to var qrTo strfmt.DateTime + if o.To != nil { qrTo = *o.To } qTo := qrTo.String() if qTo != "" { + if err := r.SetQueryParam("to", qTo); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_responses.go b/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_responses.go index daa29a72..96f111f5 100644 --- a/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_responses.go +++ b/pkg/client/deployments/get_deployment_expense_history_by_id_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentExpenseHistoryByIDUsingGETReader) ReadResponse(response ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentExpenseHistoryByIDUsingGETOK() *GetDeploymentExpenseHistory return &GetDeploymentExpenseHistoryByIDUsingGETOK{} } -/*GetDeploymentExpenseHistoryByIDUsingGETOK handles this case with default header values. +/* GetDeploymentExpenseHistoryByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentExpenseHistoryByIDUsingGETOK struct { func (o *GetDeploymentExpenseHistoryByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/expense-history][%d] getDeploymentExpenseHistoryByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentExpenseHistoryByIDUsingGETOK) GetPayload() *models.DeploymentExpenseHistory { return o.Payload } @@ -85,7 +83,7 @@ func NewGetDeploymentExpenseHistoryByIDUsingGETUnauthorized() *GetDeploymentExpe return &GetDeploymentExpenseHistoryByIDUsingGETUnauthorized{} } -/*GetDeploymentExpenseHistoryByIDUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentExpenseHistoryByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetDeploymentExpenseHistoryByIDUsingGETNotFound() *GetDeploymentExpenseH return &GetDeploymentExpenseHistoryByIDUsingGETNotFound{} } -/*GetDeploymentExpenseHistoryByIDUsingGETNotFound handles this case with default header values. +/* GetDeploymentExpenseHistoryByIDUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetDeploymentExpenseHistoryByIDUsingGETNotFound struct { func (o *GetDeploymentExpenseHistoryByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/expense-history][%d] getDeploymentExpenseHistoryByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentExpenseHistoryByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/get_deployment_filter_by_id_using_get_parameters.go b/pkg/client/deployments/get_deployment_filter_by_id_using_get_parameters.go index 1a868c81..78ff72e4 100644 --- a/pkg/client/deployments/get_deployment_filter_by_id_using_get_parameters.go +++ b/pkg/client/deployments/get_deployment_filter_by_id_using_get_parameters.go @@ -17,78 +17,86 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentFilterByIDUsingGETParams creates a new GetDeploymentFilterByIDUsingGETParams object -// with the default values initialized. +// NewGetDeploymentFilterByIDUsingGETParams creates a new GetDeploymentFilterByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentFilterByIDUsingGETParams() *GetDeploymentFilterByIDUsingGETParams { - var () return &GetDeploymentFilterByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentFilterByIDUsingGETParamsWithTimeout creates a new GetDeploymentFilterByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentFilterByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentFilterByIDUsingGETParams { - var () return &GetDeploymentFilterByIDUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentFilterByIDUsingGETParamsWithContext creates a new GetDeploymentFilterByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentFilterByIDUsingGETParamsWithContext(ctx context.Context) *GetDeploymentFilterByIDUsingGETParams { - var () return &GetDeploymentFilterByIDUsingGETParams{ - Context: ctx, } } // NewGetDeploymentFilterByIDUsingGETParamsWithHTTPClient creates a new GetDeploymentFilterByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentFilterByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentFilterByIDUsingGETParams { - var () return &GetDeploymentFilterByIDUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentFilterByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment filter by Id using g e t operation typically these are written to a http.Request +/* GetDeploymentFilterByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment filter by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentFilterByIDUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*FilterID - Filter Id + /* FilterID. + + Filter Id */ FilterID string - /*Search - Search string for filters + /* Search. + + Search string for filters */ Search *string @@ -97,6 +105,21 @@ type GetDeploymentFilterByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment filter by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentFilterByIDUsingGETParams) WithDefaults() *GetDeploymentFilterByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment filter by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentFilterByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment filter by Id using get params func (o *GetDeploymentFilterByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentFilterByIDUsingGETParams { o.SetTimeout(timeout) @@ -204,60 +227,66 @@ func (o *GetDeploymentFilterByIDUsingGETParams) WriteToRequest(r runtime.ClientR } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param filterId @@ -269,16 +298,17 @@ func (o *GetDeploymentFilterByIDUsingGETParams) WriteToRequest(r runtime.ClientR // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -286,3 +316,20 @@ func (o *GetDeploymentFilterByIDUsingGETParams) WriteToRequest(r runtime.ClientR } return nil } + +// bindParamGetDeploymentFilterByIDUsingGET binds the parameter $orderby +func (o *GetDeploymentFilterByIDUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/deployments/get_deployment_filter_by_id_using_get_responses.go b/pkg/client/deployments/get_deployment_filter_by_id_using_get_responses.go index 3cf99b66..861d267a 100644 --- a/pkg/client/deployments/get_deployment_filter_by_id_using_get_responses.go +++ b/pkg/client/deployments/get_deployment_filter_by_id_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetDeploymentFilterByIDUsingGETReader) ReadResponse(response runtime.Cl return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDeploymentFilterByIDUsingGETOK() *GetDeploymentFilterByIDUsingGETOK { return &GetDeploymentFilterByIDUsingGETOK{} } -/*GetDeploymentFilterByIDUsingGETOK handles this case with default header values. +/* GetDeploymentFilterByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetDeploymentFilterByIDUsingGETOK struct { func (o *GetDeploymentFilterByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/filters/{filterId}][%d] getDeploymentFilterByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentFilterByIDUsingGETOK) GetPayload() *models.PageOfFilterEntry { return o.Payload } @@ -79,7 +77,7 @@ func NewGetDeploymentFilterByIDUsingGETUnauthorized() *GetDeploymentFilterByIDUs return &GetDeploymentFilterByIDUsingGETUnauthorized{} } -/*GetDeploymentFilterByIDUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentFilterByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/deployments/get_deployment_filters_using_get_parameters.go b/pkg/client/deployments/get_deployment_filters_using_get_parameters.go index 65082b26..ceb4a13c 100644 --- a/pkg/client/deployments/get_deployment_filters_using_get_parameters.go +++ b/pkg/client/deployments/get_deployment_filters_using_get_parameters.go @@ -17,80 +17,92 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentFiltersUsingGETParams creates a new GetDeploymentFiltersUsingGETParams object -// with the default values initialized. +// NewGetDeploymentFiltersUsingGETParams creates a new GetDeploymentFiltersUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentFiltersUsingGETParams() *GetDeploymentFiltersUsingGETParams { - var () return &GetDeploymentFiltersUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentFiltersUsingGETParamsWithTimeout creates a new GetDeploymentFiltersUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentFiltersUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentFiltersUsingGETParams { - var () return &GetDeploymentFiltersUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentFiltersUsingGETParamsWithContext creates a new GetDeploymentFiltersUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentFiltersUsingGETParamsWithContext(ctx context.Context) *GetDeploymentFiltersUsingGETParams { - var () return &GetDeploymentFiltersUsingGETParams{ - Context: ctx, } } // NewGetDeploymentFiltersUsingGETParamsWithHTTPClient creates a new GetDeploymentFiltersUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentFiltersUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentFiltersUsingGETParams { - var () return &GetDeploymentFiltersUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentFiltersUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment filters using g e t operation typically these are written to a http.Request +/* GetDeploymentFiltersUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment filters using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentFiltersUsingGETParams struct { - /*ISO3Country*/ + // ISO3Country. ISO3Country *string - /*ISO3Language*/ + + // ISO3Language. ISO3Language *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Country*/ + + // Country. Country *string - /*DisplayCountry*/ + + // DisplayCountry. DisplayCountry *string - /*DisplayLanguage*/ + + // DisplayLanguage. DisplayLanguage *string - /*DisplayName*/ + + // DisplayName. DisplayName *string - /*DisplayScript*/ + + // DisplayScript. DisplayScript *string - /*DisplayVariant*/ + + // DisplayVariant. DisplayVariant *string - /*Language*/ + + // Language. Language *string - /*Script*/ + + // Script. Script *string - /*UnicodeLocaleAttributes*/ + + // UnicodeLocaleAttributes. UnicodeLocaleAttributes []string - /*UnicodeLocaleKeys*/ + + // UnicodeLocaleKeys. UnicodeLocaleKeys []string - /*Variant*/ + + // Variant. Variant *string timeout time.Duration @@ -98,6 +110,21 @@ type GetDeploymentFiltersUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment filters using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentFiltersUsingGETParams) WithDefaults() *GetDeploymentFiltersUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment filters using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentFiltersUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment filters using get params func (o *GetDeploymentFiltersUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentFiltersUsingGETParams { o.SetTimeout(timeout) @@ -297,208 +324,226 @@ func (o *GetDeploymentFiltersUsingGETParams) WriteToRequest(r runtime.ClientRequ // query param ISO3Country var qrISO3Country string + if o.ISO3Country != nil { qrISO3Country = *o.ISO3Country } qISO3Country := qrISO3Country if qISO3Country != "" { + if err := r.SetQueryParam("ISO3Country", qISO3Country); err != nil { return err } } - } if o.ISO3Language != nil { // query param ISO3Language var qrISO3Language string + if o.ISO3Language != nil { qrISO3Language = *o.ISO3Language } qISO3Language := qrISO3Language if qISO3Language != "" { + if err := r.SetQueryParam("ISO3Language", qISO3Language); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Country != nil { // query param country var qrCountry string + if o.Country != nil { qrCountry = *o.Country } qCountry := qrCountry if qCountry != "" { + if err := r.SetQueryParam("country", qCountry); err != nil { return err } } - } if o.DisplayCountry != nil { // query param displayCountry var qrDisplayCountry string + if o.DisplayCountry != nil { qrDisplayCountry = *o.DisplayCountry } qDisplayCountry := qrDisplayCountry if qDisplayCountry != "" { + if err := r.SetQueryParam("displayCountry", qDisplayCountry); err != nil { return err } } - } if o.DisplayLanguage != nil { // query param displayLanguage var qrDisplayLanguage string + if o.DisplayLanguage != nil { qrDisplayLanguage = *o.DisplayLanguage } qDisplayLanguage := qrDisplayLanguage if qDisplayLanguage != "" { + if err := r.SetQueryParam("displayLanguage", qDisplayLanguage); err != nil { return err } } - } if o.DisplayName != nil { // query param displayName var qrDisplayName string + if o.DisplayName != nil { qrDisplayName = *o.DisplayName } qDisplayName := qrDisplayName if qDisplayName != "" { + if err := r.SetQueryParam("displayName", qDisplayName); err != nil { return err } } - } if o.DisplayScript != nil { // query param displayScript var qrDisplayScript string + if o.DisplayScript != nil { qrDisplayScript = *o.DisplayScript } qDisplayScript := qrDisplayScript if qDisplayScript != "" { + if err := r.SetQueryParam("displayScript", qDisplayScript); err != nil { return err } } - } if o.DisplayVariant != nil { // query param displayVariant var qrDisplayVariant string + if o.DisplayVariant != nil { qrDisplayVariant = *o.DisplayVariant } qDisplayVariant := qrDisplayVariant if qDisplayVariant != "" { + if err := r.SetQueryParam("displayVariant", qDisplayVariant); err != nil { return err } } - } if o.Language != nil { // query param language var qrLanguage string + if o.Language != nil { qrLanguage = *o.Language } qLanguage := qrLanguage if qLanguage != "" { + if err := r.SetQueryParam("language", qLanguage); err != nil { return err } } - } if o.Script != nil { // query param script var qrScript string + if o.Script != nil { qrScript = *o.Script } qScript := qrScript if qScript != "" { + if err := r.SetQueryParam("script", qScript); err != nil { return err } } - } - valuesUnicodeLocaleAttributes := o.UnicodeLocaleAttributes + if o.UnicodeLocaleAttributes != nil { - joinedUnicodeLocaleAttributes := swag.JoinByFormat(valuesUnicodeLocaleAttributes, "multi") - // query array param unicodeLocaleAttributes - if err := r.SetQueryParam("unicodeLocaleAttributes", joinedUnicodeLocaleAttributes...); err != nil { - return err + // binding items for unicodeLocaleAttributes + joinedUnicodeLocaleAttributes := o.bindParamUnicodeLocaleAttributes(reg) + + // query array param unicodeLocaleAttributes + if err := r.SetQueryParam("unicodeLocaleAttributes", joinedUnicodeLocaleAttributes...); err != nil { + return err + } } - valuesUnicodeLocaleKeys := o.UnicodeLocaleKeys + if o.UnicodeLocaleKeys != nil { - joinedUnicodeLocaleKeys := swag.JoinByFormat(valuesUnicodeLocaleKeys, "multi") - // query array param unicodeLocaleKeys - if err := r.SetQueryParam("unicodeLocaleKeys", joinedUnicodeLocaleKeys...); err != nil { - return err + // binding items for unicodeLocaleKeys + joinedUnicodeLocaleKeys := o.bindParamUnicodeLocaleKeys(reg) + + // query array param unicodeLocaleKeys + if err := r.SetQueryParam("unicodeLocaleKeys", joinedUnicodeLocaleKeys...); err != nil { + return err + } } if o.Variant != nil { // query param variant var qrVariant string + if o.Variant != nil { qrVariant = *o.Variant } qVariant := qrVariant if qVariant != "" { + if err := r.SetQueryParam("variant", qVariant); err != nil { return err } } - } if len(res) > 0 { @@ -506,3 +551,37 @@ func (o *GetDeploymentFiltersUsingGETParams) WriteToRequest(r runtime.ClientRequ } return nil } + +// bindParamGetDeploymentFiltersUsingGET binds the parameter unicodeLocaleAttributes +func (o *GetDeploymentFiltersUsingGETParams) bindParamUnicodeLocaleAttributes(formats strfmt.Registry) []string { + unicodeLocaleAttributesIR := o.UnicodeLocaleAttributes + + var unicodeLocaleAttributesIC []string + for _, unicodeLocaleAttributesIIR := range unicodeLocaleAttributesIR { // explode []string + + unicodeLocaleAttributesIIV := unicodeLocaleAttributesIIR // string as string + unicodeLocaleAttributesIC = append(unicodeLocaleAttributesIC, unicodeLocaleAttributesIIV) + } + + // items.CollectionFormat: "multi" + unicodeLocaleAttributesIS := swag.JoinByFormat(unicodeLocaleAttributesIC, "multi") + + return unicodeLocaleAttributesIS +} + +// bindParamGetDeploymentFiltersUsingGET binds the parameter unicodeLocaleKeys +func (o *GetDeploymentFiltersUsingGETParams) bindParamUnicodeLocaleKeys(formats strfmt.Registry) []string { + unicodeLocaleKeysIR := o.UnicodeLocaleKeys + + var unicodeLocaleKeysIC []string + for _, unicodeLocaleKeysIIR := range unicodeLocaleKeysIR { // explode []string + + unicodeLocaleKeysIIV := unicodeLocaleKeysIIR // string as string + unicodeLocaleKeysIC = append(unicodeLocaleKeysIC, unicodeLocaleKeysIIV) + } + + // items.CollectionFormat: "multi" + unicodeLocaleKeysIS := swag.JoinByFormat(unicodeLocaleKeysIC, "multi") + + return unicodeLocaleKeysIS +} diff --git a/pkg/client/deployments/get_deployment_filters_using_get_responses.go b/pkg/client/deployments/get_deployment_filters_using_get_responses.go index 5e2d6a67..8562b2fe 100644 --- a/pkg/client/deployments/get_deployment_filters_using_get_responses.go +++ b/pkg/client/deployments/get_deployment_filters_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetDeploymentFiltersUsingGETReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDeploymentFiltersUsingGETOK() *GetDeploymentFiltersUsingGETOK { return &GetDeploymentFiltersUsingGETOK{} } -/*GetDeploymentFiltersUsingGETOK handles this case with default header values. +/* GetDeploymentFiltersUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetDeploymentFiltersUsingGETOK struct { func (o *GetDeploymentFiltersUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/filters][%d] getDeploymentFiltersUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentFiltersUsingGETOK) GetPayload() *models.DeploymentFilterSchema { return o.Payload } @@ -79,7 +77,7 @@ func NewGetDeploymentFiltersUsingGETUnauthorized() *GetDeploymentFiltersUsingGET return &GetDeploymentFiltersUsingGETUnauthorized{} } -/*GetDeploymentFiltersUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentFiltersUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/deployments/get_deployment_resources_using_get_parameters.go b/pkg/client/deployments/get_deployment_resources_using_get_parameters.go index 5857905f..9e2e15ad 100644 --- a/pkg/client/deployments/get_deployment_resources_using_get_parameters.go +++ b/pkg/client/deployments/get_deployment_resources_using_get_parameters.go @@ -17,78 +17,88 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentResourcesUsingGETParams creates a new GetDeploymentResourcesUsingGETParams object -// with the default values initialized. +// NewGetDeploymentResourcesUsingGETParams creates a new GetDeploymentResourcesUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentResourcesUsingGETParams() *GetDeploymentResourcesUsingGETParams { - var () return &GetDeploymentResourcesUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentResourcesUsingGETParamsWithTimeout creates a new GetDeploymentResourcesUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentResourcesUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentResourcesUsingGETParams { - var () return &GetDeploymentResourcesUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentResourcesUsingGETParamsWithContext creates a new GetDeploymentResourcesUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentResourcesUsingGETParamsWithContext(ctx context.Context) *GetDeploymentResourcesUsingGETParams { - var () return &GetDeploymentResourcesUsingGETParams{ - Context: ctx, } } // NewGetDeploymentResourcesUsingGETParamsWithHTTPClient creates a new GetDeploymentResourcesUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentResourcesUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentResourcesUsingGETParams { - var () return &GetDeploymentResourcesUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentResourcesUsingGETParams contains all the parameters to send to the API endpoint -for the get deployment resources using g e t operation typically these are written to a http.Request +/* GetDeploymentResourcesUsingGETParams contains all the parameters to send to the API endpoint + for the get deployment resources using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentResourcesUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*Names - Results must have exactly these resource names. + /* Names. + + Results must have exactly these resource names. */ Names []string @@ -97,6 +107,21 @@ type GetDeploymentResourcesUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployment resources using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentResourcesUsingGETParams) WithDefaults() *GetDeploymentResourcesUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment resources using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentResourcesUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployment resources using get params func (o *GetDeploymentResourcesUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentResourcesUsingGETParams { o.SetTimeout(timeout) @@ -204,60 +229,66 @@ func (o *GetDeploymentResourcesUsingGETParams) WriteToRequest(r runtime.ClientRe } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId @@ -265,12 +296,15 @@ func (o *GetDeploymentResourcesUsingGETParams) WriteToRequest(r runtime.ClientRe return err } - valuesNames := o.Names + if o.Names != nil { - joinedNames := swag.JoinByFormat(valuesNames, "multi") - // query array param names - if err := r.SetQueryParam("names", joinedNames...); err != nil { - return err + // binding items for names + joinedNames := o.bindParamNames(reg) + + // query array param names + if err := r.SetQueryParam("names", joinedNames...); err != nil { + return err + } } if len(res) > 0 { @@ -278,3 +312,37 @@ func (o *GetDeploymentResourcesUsingGETParams) WriteToRequest(r runtime.ClientRe } return nil } + +// bindParamGetDeploymentResourcesUsingGET binds the parameter $orderby +func (o *GetDeploymentResourcesUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamGetDeploymentResourcesUsingGET binds the parameter names +func (o *GetDeploymentResourcesUsingGETParams) bindParamNames(formats strfmt.Registry) []string { + namesIR := o.Names + + var namesIC []string + for _, namesIIR := range namesIR { // explode []string + + namesIIV := namesIIR // string as string + namesIC = append(namesIC, namesIIV) + } + + // items.CollectionFormat: "multi" + namesIS := swag.JoinByFormat(namesIC, "multi") + + return namesIS +} diff --git a/pkg/client/deployments/get_deployment_resources_using_get_responses.go b/pkg/client/deployments/get_deployment_resources_using_get_responses.go index 903ddb27..ff2ed10e 100644 --- a/pkg/client/deployments/get_deployment_resources_using_get_responses.go +++ b/pkg/client/deployments/get_deployment_resources_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetDeploymentResourcesUsingGETReader) ReadResponse(response runtime.Cli return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDeploymentResourcesUsingGETOK() *GetDeploymentResourcesUsingGETOK { return &GetDeploymentResourcesUsingGETOK{} } -/*GetDeploymentResourcesUsingGETOK handles this case with default header values. +/* GetDeploymentResourcesUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetDeploymentResourcesUsingGETOK struct { func (o *GetDeploymentResourcesUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources][%d] getDeploymentResourcesUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentResourcesUsingGETOK) GetPayload() *models.PageOfResource { return o.Payload } @@ -85,7 +83,7 @@ func NewGetDeploymentResourcesUsingGETUnauthorized() *GetDeploymentResourcesUsin return &GetDeploymentResourcesUsingGETUnauthorized{} } -/*GetDeploymentResourcesUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentResourcesUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetDeploymentResourcesUsingGETNotFound() *GetDeploymentResourcesUsingGET return &GetDeploymentResourcesUsingGETNotFound{} } -/*GetDeploymentResourcesUsingGETNotFound handles this case with default header values. +/* GetDeploymentResourcesUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetDeploymentResourcesUsingGETNotFound struct { func (o *GetDeploymentResourcesUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources][%d] getDeploymentResourcesUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetDeploymentResourcesUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/get_deployments_for_project_using_get_parameters.go b/pkg/client/deployments/get_deployments_for_project_using_get_parameters.go index 729dc197..15a9d845 100644 --- a/pkg/client/deployments/get_deployments_for_project_using_get_parameters.go +++ b/pkg/client/deployments/get_deployments_for_project_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDeploymentsForProjectUsingGETParams creates a new GetDeploymentsForProjectUsingGETParams object -// with the default values initialized. +// NewGetDeploymentsForProjectUsingGETParams creates a new GetDeploymentsForProjectUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentsForProjectUsingGETParams() *GetDeploymentsForProjectUsingGETParams { - var () return &GetDeploymentsForProjectUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentsForProjectUsingGETParamsWithTimeout creates a new GetDeploymentsForProjectUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentsForProjectUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentsForProjectUsingGETParams { - var () return &GetDeploymentsForProjectUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentsForProjectUsingGETParamsWithContext creates a new GetDeploymentsForProjectUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentsForProjectUsingGETParamsWithContext(ctx context.Context) *GetDeploymentsForProjectUsingGETParams { - var () return &GetDeploymentsForProjectUsingGETParams{ - Context: ctx, } } // NewGetDeploymentsForProjectUsingGETParamsWithHTTPClient creates a new GetDeploymentsForProjectUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentsForProjectUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentsForProjectUsingGETParams { - var () return &GetDeploymentsForProjectUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentsForProjectUsingGETParams contains all the parameters to send to the API endpoint -for the get deployments for project using g e t operation typically these are written to a http.Request +/* GetDeploymentsForProjectUsingGETParams contains all the parameters to send to the API endpoint + for the get deployments for project using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentsForProjectUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ProjectID - Project ID + /* ProjectID. + + Project ID + + Format: uuid */ ProjectID strfmt.UUID @@ -76,6 +78,21 @@ type GetDeploymentsForProjectUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployments for project using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsForProjectUsingGETParams) WithDefaults() *GetDeploymentsForProjectUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployments for project using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsForProjectUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployments for project using get params func (o *GetDeploymentsForProjectUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentsForProjectUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetDeploymentsForProjectUsingGETParams) WriteToRequest(r runtime.Client // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param projectId diff --git a/pkg/client/deployments/get_deployments_for_project_using_get_responses.go b/pkg/client/deployments/get_deployments_for_project_using_get_responses.go index bb9a636d..ab9521d1 100644 --- a/pkg/client/deployments/get_deployments_for_project_using_get_responses.go +++ b/pkg/client/deployments/get_deployments_for_project_using_get_responses.go @@ -29,7 +29,6 @@ func (o *GetDeploymentsForProjectUsingGETReader) ReadResponse(response runtime.C return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetDeploymentsForProjectUsingGETOK() *GetDeploymentsForProjectUsingGETOK return &GetDeploymentsForProjectUsingGETOK{} } -/*GetDeploymentsForProjectUsingGETOK handles this case with default header values. +/* GetDeploymentsForProjectUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetDeploymentsForProjectUsingGETOK struct { func (o *GetDeploymentsForProjectUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/projects/{projectId}/deployment-count][%d] getDeploymentsForProjectUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentsForProjectUsingGETOK) GetPayload() *models.Page { return o.Payload } diff --git a/pkg/client/deployments/get_deployments_using_get_parameters.go b/pkg/client/deployments/get_deployments_using_get_parameters.go index 26d95a98..f94e353f 100644 --- a/pkg/client/deployments/get_deployments_using_get_parameters.go +++ b/pkg/client/deployments/get_deployments_using_get_parameters.go @@ -17,163 +17,188 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDeploymentsUsingGETParams creates a new GetDeploymentsUsingGETParams object -// with the default values initialized. +// NewGetDeploymentsUsingGETParams creates a new GetDeploymentsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDeploymentsUsingGETParams() *GetDeploymentsUsingGETParams { - var () return &GetDeploymentsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDeploymentsUsingGETParamsWithTimeout creates a new GetDeploymentsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDeploymentsUsingGETParamsWithTimeout(timeout time.Duration) *GetDeploymentsUsingGETParams { - var () return &GetDeploymentsUsingGETParams{ - timeout: timeout, } } // NewGetDeploymentsUsingGETParamsWithContext creates a new GetDeploymentsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDeploymentsUsingGETParamsWithContext(ctx context.Context) *GetDeploymentsUsingGETParams { - var () return &GetDeploymentsUsingGETParams{ - Context: ctx, } } // NewGetDeploymentsUsingGETParamsWithHTTPClient creates a new GetDeploymentsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDeploymentsUsingGETParamsWithHTTPClient(client *http.Client) *GetDeploymentsUsingGETParams { - var () return &GetDeploymentsUsingGETParams{ HTTPClient: client, } } -/*GetDeploymentsUsingGETParams contains all the parameters to send to the API endpoint -for the get deployments using g e t operation typically these are written to a http.Request +/* GetDeploymentsUsingGETParams contains all the parameters to send to the API endpoint + for the get deployments using g e t operation. + + Typically these are written to a http.Request. */ type GetDeploymentsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*CloudAccounts - A comma-separated list. Results must be associated with one of these cloud accounts. + /* CloudAccounts. + + A comma-separated list. Results must be associated with one of these cloud accounts. */ CloudAccounts []string - /*CloudTypes - A comma-separated list. Results must be associated with one of these endpoint Types + /* CloudTypes. + + A comma-separated list. Results must be associated with one of these endpoint Types */ CloudTypes []string - /*CreatedAt - Comma-separated start and end dates for the interval + /* CreatedAt. + + Comma-separated start and end dates for the interval */ CreatedAt *string - /*Deleted - Retrieves only soft-deleted deployments that have not yet been completely deleted. + /* Deleted. + + Retrieves only soft-deleted deployments that have not yet been completely deleted. */ Deleted *bool - /*Expand - The expanded details of the requested comma separated objects. 'resources' option returns resources with all properties. Ex. blueprint, project + /* Expand. + + The expanded details of the requested comma separated objects. 'resources' option returns resources with all properties. Ex. blueprint, project */ Expand []string - /*ExpandLastRequest - Expands deployment last request. + /* ExpandLastRequest. + + Expands deployment last request. */ ExpandLastRequest *bool - /*ExpandProject - The 'project' field of each resulting deployment will be retrieved. + /* ExpandProject. + + The 'project' field of each resulting deployment will be retrieved. */ ExpandProject *bool - /*ExpandResources - The 'resources' field of each resulting deployment will be retrieved. + /* ExpandResources. + + The 'resources' field of each resulting deployment will be retrieved. */ ExpandResources *bool - /*ExpiresAt - Comma-separated start and end dates for the interval + /* ExpiresAt. + + Comma-separated start and end dates for the interval */ ExpiresAt *string - /*Ids - A comma-separated list. Only deployments with these IDs will be included in the results. + /* Ids. + + A comma-separated list. Only deployments with these IDs will be included in the results. */ Ids []strfmt.UUID - /*LastUpdatedAt - Comma-separated start and end dates for the interval + /* LastUpdatedAt. + + Comma-separated start and end dates for the interval */ LastUpdatedAt *string - /*Name - Results must have exactly this name. + /* Name. + + Results must have exactly this name. */ Name *string - /*OwnedBy - A comma-separated list. Results must be associated with one of these owners + /* OwnedBy. + + A comma-separated list. Results must be associated with one of these owners */ OwnedBy []string - /*Projects - A comma-separated list. Results must be associated with one of these project IDs. + /* Projects. + + A comma-separated list. Results must be associated with one of these project IDs. */ Projects []string - /*RequestedBy - A comma-separated list. Results must be associated with one of these requesters + /* RequestedBy. + + A comma-separated list. Results must be associated with one of these requesters */ RequestedBy []string - /*ResourceTypes - A comma-separated list. Results must be associated with one of these resourceType Names. + /* ResourceTypes. + + A comma-separated list. Results must be associated with one of these resourceType Names. */ ResourceTypes []string - /*Search - Given string should either be part of a searchable field in a deployment or one of deployment's resources. + /* Search. + + Given string should either be part of a searchable field in a deployment or one of deployment's resources. */ Search *string - /*Status - A comma-separated list. Results must be associated with one of these statuses. + /* Status. + + A comma-separated list. Results must be associated with one of these statuses. */ Status []string - /*Tags - A comma-separated list. Results must be associated with one of these tags + /* Tags. + + A comma-separated list. Results must be associated with one of these tags */ Tags []string @@ -182,6 +207,21 @@ type GetDeploymentsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get deployments using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsUsingGETParams) WithDefaults() *GetDeploymentsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployments using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get deployments using get params func (o *GetDeploymentsUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentsUsingGETParams { o.SetTimeout(timeout) @@ -476,287 +516,329 @@ func (o *GetDeploymentsUsingGETParams) WriteToRequest(r runtime.ClientRequest, r } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - valuesCloudAccounts := o.CloudAccounts + if o.CloudAccounts != nil { - joinedCloudAccounts := swag.JoinByFormat(valuesCloudAccounts, "multi") - // query array param cloudAccounts - if err := r.SetQueryParam("cloudAccounts", joinedCloudAccounts...); err != nil { - return err + // binding items for cloudAccounts + joinedCloudAccounts := o.bindParamCloudAccounts(reg) + + // query array param cloudAccounts + if err := r.SetQueryParam("cloudAccounts", joinedCloudAccounts...); err != nil { + return err + } } - valuesCloudTypes := o.CloudTypes + if o.CloudTypes != nil { - joinedCloudTypes := swag.JoinByFormat(valuesCloudTypes, "multi") - // query array param cloudTypes - if err := r.SetQueryParam("cloudTypes", joinedCloudTypes...); err != nil { - return err + // binding items for cloudTypes + joinedCloudTypes := o.bindParamCloudTypes(reg) + + // query array param cloudTypes + if err := r.SetQueryParam("cloudTypes", joinedCloudTypes...); err != nil { + return err + } } if o.CreatedAt != nil { // query param createdAt var qrCreatedAt string + if o.CreatedAt != nil { qrCreatedAt = *o.CreatedAt } qCreatedAt := qrCreatedAt if qCreatedAt != "" { + if err := r.SetQueryParam("createdAt", qCreatedAt); err != nil { return err } } - } if o.Deleted != nil { // query param deleted var qrDeleted bool + if o.Deleted != nil { qrDeleted = *o.Deleted } qDeleted := swag.FormatBool(qrDeleted) if qDeleted != "" { + if err := r.SetQueryParam("deleted", qDeleted); err != nil { return err } } - } - valuesExpand := o.Expand + if o.Expand != nil { - joinedExpand := swag.JoinByFormat(valuesExpand, "multi") - // query array param expand - if err := r.SetQueryParam("expand", joinedExpand...); err != nil { - return err + // binding items for expand + joinedExpand := o.bindParamExpand(reg) + + // query array param expand + if err := r.SetQueryParam("expand", joinedExpand...); err != nil { + return err + } } if o.ExpandLastRequest != nil { // query param expandLastRequest var qrExpandLastRequest bool + if o.ExpandLastRequest != nil { qrExpandLastRequest = *o.ExpandLastRequest } qExpandLastRequest := swag.FormatBool(qrExpandLastRequest) if qExpandLastRequest != "" { + if err := r.SetQueryParam("expandLastRequest", qExpandLastRequest); err != nil { return err } } - } if o.ExpandProject != nil { // query param expandProject var qrExpandProject bool + if o.ExpandProject != nil { qrExpandProject = *o.ExpandProject } qExpandProject := swag.FormatBool(qrExpandProject) if qExpandProject != "" { + if err := r.SetQueryParam("expandProject", qExpandProject); err != nil { return err } } - } if o.ExpandResources != nil { // query param expandResources var qrExpandResources bool + if o.ExpandResources != nil { qrExpandResources = *o.ExpandResources } qExpandResources := swag.FormatBool(qrExpandResources) if qExpandResources != "" { + if err := r.SetQueryParam("expandResources", qExpandResources); err != nil { return err } } - } if o.ExpiresAt != nil { // query param expiresAt var qrExpiresAt string + if o.ExpiresAt != nil { qrExpiresAt = *o.ExpiresAt } qExpiresAt := qrExpiresAt if qExpiresAt != "" { + if err := r.SetQueryParam("expiresAt", qExpiresAt); err != nil { return err } } - } - var valuesIds []string - for _, v := range o.Ids { - valuesIds = append(valuesIds, v.String()) - } + if o.Ids != nil { - joinedIds := swag.JoinByFormat(valuesIds, "multi") - // query array param ids - if err := r.SetQueryParam("ids", joinedIds...); err != nil { - return err + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } } if o.LastUpdatedAt != nil { // query param lastUpdatedAt var qrLastUpdatedAt string + if o.LastUpdatedAt != nil { qrLastUpdatedAt = *o.LastUpdatedAt } qLastUpdatedAt := qrLastUpdatedAt if qLastUpdatedAt != "" { + if err := r.SetQueryParam("lastUpdatedAt", qLastUpdatedAt); 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 } } - } - valuesOwnedBy := o.OwnedBy + if o.OwnedBy != nil { - joinedOwnedBy := swag.JoinByFormat(valuesOwnedBy, "multi") - // query array param ownedBy - if err := r.SetQueryParam("ownedBy", joinedOwnedBy...); err != nil { - return err + // binding items for ownedBy + joinedOwnedBy := o.bindParamOwnedBy(reg) + + // query array param ownedBy + if err := r.SetQueryParam("ownedBy", joinedOwnedBy...); err != nil { + return err + } } - valuesProjects := o.Projects + if o.Projects != nil { - joinedProjects := swag.JoinByFormat(valuesProjects, "multi") - // query array param projects - if err := r.SetQueryParam("projects", joinedProjects...); err != nil { - return err + // binding items for projects + joinedProjects := o.bindParamProjects(reg) + + // query array param projects + if err := r.SetQueryParam("projects", joinedProjects...); err != nil { + return err + } } - valuesRequestedBy := o.RequestedBy + if o.RequestedBy != nil { - joinedRequestedBy := swag.JoinByFormat(valuesRequestedBy, "multi") - // query array param requestedBy - if err := r.SetQueryParam("requestedBy", joinedRequestedBy...); err != nil { - return err + // binding items for requestedBy + joinedRequestedBy := o.bindParamRequestedBy(reg) + + // query array param requestedBy + if err := r.SetQueryParam("requestedBy", joinedRequestedBy...); err != nil { + return err + } } - valuesResourceTypes := o.ResourceTypes + if o.ResourceTypes != nil { - joinedResourceTypes := swag.JoinByFormat(valuesResourceTypes, "multi") - // query array param resourceTypes - if err := r.SetQueryParam("resourceTypes", joinedResourceTypes...); err != nil { - return err + // binding items for resourceTypes + joinedResourceTypes := o.bindParamResourceTypes(reg) + + // query array param resourceTypes + if err := r.SetQueryParam("resourceTypes", joinedResourceTypes...); err != nil { + return err + } } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } - valuesStatus := o.Status + if o.Status != nil { - joinedStatus := swag.JoinByFormat(valuesStatus, "multi") - // query array param status - if err := r.SetQueryParam("status", joinedStatus...); err != nil { - return err + // binding items for status + joinedStatus := o.bindParamStatus(reg) + + // query array param status + if err := r.SetQueryParam("status", joinedStatus...); err != nil { + return err + } } - valuesTags := o.Tags + if o.Tags != nil { - joinedTags := swag.JoinByFormat(valuesTags, "multi") - // query array param tags - if err := r.SetQueryParam("tags", joinedTags...); err != nil { - return err + // binding items for tags + joinedTags := o.bindParamTags(reg) + + // query array param tags + if err := r.SetQueryParam("tags", joinedTags...); err != nil { + return err + } } if len(res) > 0 { @@ -764,3 +846,190 @@ func (o *GetDeploymentsUsingGETParams) WriteToRequest(r runtime.ClientRequest, r } return nil } + +// bindParamGetDeploymentsUsingGET binds the parameter $orderby +func (o *GetDeploymentsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter cloudAccounts +func (o *GetDeploymentsUsingGETParams) bindParamCloudAccounts(formats strfmt.Registry) []string { + cloudAccountsIR := o.CloudAccounts + + var cloudAccountsIC []string + for _, cloudAccountsIIR := range cloudAccountsIR { // explode []string + + cloudAccountsIIV := cloudAccountsIIR // string as string + cloudAccountsIC = append(cloudAccountsIC, cloudAccountsIIV) + } + + // items.CollectionFormat: "multi" + cloudAccountsIS := swag.JoinByFormat(cloudAccountsIC, "multi") + + return cloudAccountsIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter cloudTypes +func (o *GetDeploymentsUsingGETParams) bindParamCloudTypes(formats strfmt.Registry) []string { + cloudTypesIR := o.CloudTypes + + var cloudTypesIC []string + for _, cloudTypesIIR := range cloudTypesIR { // explode []string + + cloudTypesIIV := cloudTypesIIR // string as string + cloudTypesIC = append(cloudTypesIC, cloudTypesIIV) + } + + // items.CollectionFormat: "multi" + cloudTypesIS := swag.JoinByFormat(cloudTypesIC, "multi") + + return cloudTypesIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter expand +func (o *GetDeploymentsUsingGETParams) bindParamExpand(formats strfmt.Registry) []string { + expandIR := o.Expand + + var expandIC []string + for _, expandIIR := range expandIR { // explode []string + + expandIIV := expandIIR // string as string + expandIC = append(expandIC, expandIIV) + } + + // items.CollectionFormat: "multi" + expandIS := swag.JoinByFormat(expandIC, "multi") + + return expandIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter ids +func (o *GetDeploymentsUsingGETParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []strfmt.UUID + + idsIIV := idsIIR.String() // strfmt.UUID as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter ownedBy +func (o *GetDeploymentsUsingGETParams) bindParamOwnedBy(formats strfmt.Registry) []string { + ownedByIR := o.OwnedBy + + var ownedByIC []string + for _, ownedByIIR := range ownedByIR { // explode []string + + ownedByIIV := ownedByIIR // string as string + ownedByIC = append(ownedByIC, ownedByIIV) + } + + // items.CollectionFormat: "multi" + ownedByIS := swag.JoinByFormat(ownedByIC, "multi") + + return ownedByIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter projects +func (o *GetDeploymentsUsingGETParams) bindParamProjects(formats strfmt.Registry) []string { + projectsIR := o.Projects + + var projectsIC []string + for _, projectsIIR := range projectsIR { // explode []string + + projectsIIV := projectsIIR // string as string + projectsIC = append(projectsIC, projectsIIV) + } + + // items.CollectionFormat: "multi" + projectsIS := swag.JoinByFormat(projectsIC, "multi") + + return projectsIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter requestedBy +func (o *GetDeploymentsUsingGETParams) bindParamRequestedBy(formats strfmt.Registry) []string { + requestedByIR := o.RequestedBy + + var requestedByIC []string + for _, requestedByIIR := range requestedByIR { // explode []string + + requestedByIIV := requestedByIIR // string as string + requestedByIC = append(requestedByIC, requestedByIIV) + } + + // items.CollectionFormat: "multi" + requestedByIS := swag.JoinByFormat(requestedByIC, "multi") + + return requestedByIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter resourceTypes +func (o *GetDeploymentsUsingGETParams) bindParamResourceTypes(formats strfmt.Registry) []string { + resourceTypesIR := o.ResourceTypes + + var resourceTypesIC []string + for _, resourceTypesIIR := range resourceTypesIR { // explode []string + + resourceTypesIIV := resourceTypesIIR // string as string + resourceTypesIC = append(resourceTypesIC, resourceTypesIIV) + } + + // items.CollectionFormat: "multi" + resourceTypesIS := swag.JoinByFormat(resourceTypesIC, "multi") + + return resourceTypesIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter status +func (o *GetDeploymentsUsingGETParams) bindParamStatus(formats strfmt.Registry) []string { + statusIR := o.Status + + var statusIC []string + for _, statusIIR := range statusIR { // explode []string + + statusIIV := statusIIR // string as string + statusIC = append(statusIC, statusIIV) + } + + // items.CollectionFormat: "multi" + statusIS := swag.JoinByFormat(statusIC, "multi") + + return statusIS +} + +// bindParamGetDeploymentsUsingGET binds the parameter tags +func (o *GetDeploymentsUsingGETParams) bindParamTags(formats strfmt.Registry) []string { + tagsIR := o.Tags + + var tagsIC []string + for _, tagsIIR := range tagsIR { // explode []string + + tagsIIV := tagsIIR // string as string + tagsIC = append(tagsIC, tagsIIV) + } + + // items.CollectionFormat: "multi" + tagsIS := swag.JoinByFormat(tagsIC, "multi") + + return tagsIS +} diff --git a/pkg/client/deployments/get_deployments_using_get_responses.go b/pkg/client/deployments/get_deployments_using_get_responses.go index 3e964539..e564999c 100644 --- a/pkg/client/deployments/get_deployments_using_get_responses.go +++ b/pkg/client/deployments/get_deployments_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetDeploymentsUsingGETReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDeploymentsUsingGETOK() *GetDeploymentsUsingGETOK { return &GetDeploymentsUsingGETOK{} } -/*GetDeploymentsUsingGETOK handles this case with default header values. +/* GetDeploymentsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetDeploymentsUsingGETOK struct { func (o *GetDeploymentsUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments][%d] getDeploymentsUsingGETOK %+v", 200, o.Payload) } - func (o *GetDeploymentsUsingGETOK) GetPayload() *models.PageOfDeployment { return o.Payload } @@ -79,7 +77,7 @@ func NewGetDeploymentsUsingGETUnauthorized() *GetDeploymentsUsingGETUnauthorized return &GetDeploymentsUsingGETUnauthorized{} } -/*GetDeploymentsUsingGETUnauthorized handles this case with default header values. +/* GetDeploymentsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/deployments/get_resource_by_id_using_get_parameters.go b/pkg/client/deployments/get_resource_by_id_using_get_parameters.go index 31f73247..e76f7fb8 100644 --- a/pkg/client/deployments/get_resource_by_id_using_get_parameters.go +++ b/pkg/client/deployments/get_resource_by_id_using_get_parameters.go @@ -16,63 +16,68 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourceByIDUsingGETParams creates a new GetResourceByIDUsingGETParams object -// with the default values initialized. +// NewGetResourceByIDUsingGETParams creates a new GetResourceByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetResourceByIDUsingGETParams() *GetResourceByIDUsingGETParams { - var () return &GetResourceByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetResourceByIDUsingGETParamsWithTimeout creates a new GetResourceByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourceByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetResourceByIDUsingGETParams { - var () return &GetResourceByIDUsingGETParams{ - timeout: timeout, } } // NewGetResourceByIDUsingGETParamsWithContext creates a new GetResourceByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourceByIDUsingGETParamsWithContext(ctx context.Context) *GetResourceByIDUsingGETParams { - var () return &GetResourceByIDUsingGETParams{ - Context: ctx, } } // NewGetResourceByIDUsingGETParamsWithHTTPClient creates a new GetResourceByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourceByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetResourceByIDUsingGETParams { - var () return &GetResourceByIDUsingGETParams{ HTTPClient: client, } } -/*GetResourceByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get resource by Id using g e t operation typically these are written to a http.Request +/* GetResourceByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get resource by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetResourceByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*ResourceID - Resource ID + /* ResourceID. + + Resource ID + + Format: uuid */ ResourceID strfmt.UUID @@ -81,6 +86,21 @@ type GetResourceByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resource by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceByIDUsingGETParams) WithDefaults() *GetResourceByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resource by Id using get params func (o *GetResourceByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetResourceByIDUsingGETParams { o.SetTimeout(timeout) @@ -159,16 +179,17 @@ func (o *GetResourceByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId diff --git a/pkg/client/deployments/get_resource_by_id_using_get_responses.go b/pkg/client/deployments/get_resource_by_id_using_get_responses.go index 1ceed485..17dab493 100644 --- a/pkg/client/deployments/get_resource_by_id_using_get_responses.go +++ b/pkg/client/deployments/get_resource_by_id_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetResourceByIDUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetResourceByIDUsingGETOK() *GetResourceByIDUsingGETOK { return &GetResourceByIDUsingGETOK{} } -/*GetResourceByIDUsingGETOK handles this case with default header values. +/* GetResourceByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetResourceByIDUsingGETOK struct { func (o *GetResourceByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}][%d] getResourceByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetResourceByIDUsingGETOK) GetPayload() *models.Resource { return o.Payload } @@ -85,7 +83,7 @@ func NewGetResourceByIDUsingGETUnauthorized() *GetResourceByIDUsingGETUnauthoriz return &GetResourceByIDUsingGETUnauthorized{} } -/*GetResourceByIDUsingGETUnauthorized handles this case with default header values. +/* GetResourceByIDUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetResourceByIDUsingGETNotFound() *GetResourceByIDUsingGETNotFound { return &GetResourceByIDUsingGETNotFound{} } -/*GetResourceByIDUsingGETNotFound handles this case with default header values. +/* GetResourceByIDUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetResourceByIDUsingGETNotFound struct { func (o *GetResourceByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/deployments/{depId}/resources/{resourceId}][%d] getResourceByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetResourceByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/deployments/patch_deployment_using_patch_parameters.go b/pkg/client/deployments/patch_deployment_using_patch_parameters.go index 0bc5caf2..ddbd6893 100644 --- a/pkg/client/deployments/patch_deployment_using_patch_parameters.go +++ b/pkg/client/deployments/patch_deployment_using_patch_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewPatchDeploymentUsingPATCHParams creates a new PatchDeploymentUsingPATCHParams object -// with the default values initialized. +// NewPatchDeploymentUsingPATCHParams creates a new PatchDeploymentUsingPATCHParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPatchDeploymentUsingPATCHParams() *PatchDeploymentUsingPATCHParams { - var () return &PatchDeploymentUsingPATCHParams{ - timeout: cr.DefaultTimeout, } } // NewPatchDeploymentUsingPATCHParamsWithTimeout creates a new PatchDeploymentUsingPATCHParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchDeploymentUsingPATCHParamsWithTimeout(timeout time.Duration) *PatchDeploymentUsingPATCHParams { - var () return &PatchDeploymentUsingPATCHParams{ - timeout: timeout, } } // NewPatchDeploymentUsingPATCHParamsWithContext creates a new PatchDeploymentUsingPATCHParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchDeploymentUsingPATCHParamsWithContext(ctx context.Context) *PatchDeploymentUsingPATCHParams { - var () return &PatchDeploymentUsingPATCHParams{ - Context: ctx, } } // NewPatchDeploymentUsingPATCHParamsWithHTTPClient creates a new PatchDeploymentUsingPATCHParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchDeploymentUsingPATCHParamsWithHTTPClient(client *http.Client) *PatchDeploymentUsingPATCHParams { - var () return &PatchDeploymentUsingPATCHParams{ HTTPClient: client, } } -/*PatchDeploymentUsingPATCHParams contains all the parameters to send to the API endpoint -for the patch deployment using p a t c h operation typically these are written to a http.Request +/* PatchDeploymentUsingPATCHParams contains all the parameters to send to the API endpoint + for the patch deployment using p a t c h operation. + + Typically these are written to a http.Request. */ type PatchDeploymentUsingPATCHParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DepID - Deployment ID + /* DepID. + + Deployment ID + + Format: uuid */ DepID strfmt.UUID - /*Update - A set of fields to overwrite the corresponding fields in the deployment + /* Update. + + A set of fields to overwrite the corresponding fields in the deployment */ Update *models.DeploymentUpdate @@ -83,6 +86,21 @@ type PatchDeploymentUsingPATCHParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the patch deployment using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchDeploymentUsingPATCHParams) WithDefaults() *PatchDeploymentUsingPATCHParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch deployment using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchDeploymentUsingPATCHParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the patch deployment using p a t c h params func (o *PatchDeploymentUsingPATCHParams) WithTimeout(timeout time.Duration) *PatchDeploymentUsingPATCHParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *PatchDeploymentUsingPATCHParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param depId if err := r.SetPathParam("depId", o.DepID.String()); err != nil { return err } - if o.Update != nil { if err := r.SetBodyParam(o.Update); err != nil { return err diff --git a/pkg/client/deployments/patch_deployment_using_patch_responses.go b/pkg/client/deployments/patch_deployment_using_patch_responses.go index fa6c3c3f..48fcfd8a 100644 --- a/pkg/client/deployments/patch_deployment_using_patch_responses.go +++ b/pkg/client/deployments/patch_deployment_using_patch_responses.go @@ -47,7 +47,6 @@ func (o *PatchDeploymentUsingPATCHReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewPatchDeploymentUsingPATCHOK() *PatchDeploymentUsingPATCHOK { return &PatchDeploymentUsingPATCHOK{} } -/*PatchDeploymentUsingPATCHOK handles this case with default header values. +/* PatchDeploymentUsingPATCHOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type PatchDeploymentUsingPATCHOK struct { func (o *PatchDeploymentUsingPATCHOK) Error() string { return fmt.Sprintf("[PATCH /deployment/api/deployments/{depId}][%d] patchDeploymentUsingPATCHOK %+v", 200, o.Payload) } - func (o *PatchDeploymentUsingPATCHOK) GetPayload() *models.Deployment { return o.Payload } @@ -91,7 +89,7 @@ func NewPatchDeploymentUsingPATCHUnauthorized() *PatchDeploymentUsingPATCHUnauth return &PatchDeploymentUsingPATCHUnauthorized{} } -/*PatchDeploymentUsingPATCHUnauthorized handles this case with default header values. +/* PatchDeploymentUsingPATCHUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewPatchDeploymentUsingPATCHForbidden() *PatchDeploymentUsingPATCHForbidden return &PatchDeploymentUsingPATCHForbidden{} } -/*PatchDeploymentUsingPATCHForbidden handles this case with default header values. +/* PatchDeploymentUsingPATCHForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewPatchDeploymentUsingPATCHNotFound() *PatchDeploymentUsingPATCHNotFound { return &PatchDeploymentUsingPATCHNotFound{} } -/*PatchDeploymentUsingPATCHNotFound handles this case with default header values. +/* PatchDeploymentUsingPATCHNotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type PatchDeploymentUsingPATCHNotFound struct { func (o *PatchDeploymentUsingPATCHNotFound) Error() string { return fmt.Sprintf("[PATCH /deployment/api/deployments/{depId}][%d] patchDeploymentUsingPATCHNotFound %+v", 404, o.Payload) } - func (o *PatchDeploymentUsingPATCHNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/attach_machine_disk_parameters.go b/pkg/client/disk/attach_machine_disk_parameters.go index cf3ef311..635d0264 100644 --- a/pkg/client/disk/attach_machine_disk_parameters.go +++ b/pkg/client/disk/attach_machine_disk_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewAttachMachineDiskParams creates a new AttachMachineDiskParams object -// with the default values initialized. +// NewAttachMachineDiskParams creates a new AttachMachineDiskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewAttachMachineDiskParams() *AttachMachineDiskParams { - var () return &AttachMachineDiskParams{ - timeout: cr.DefaultTimeout, } } // NewAttachMachineDiskParamsWithTimeout creates a new AttachMachineDiskParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAttachMachineDiskParamsWithTimeout(timeout time.Duration) *AttachMachineDiskParams { - var () return &AttachMachineDiskParams{ - timeout: timeout, } } // NewAttachMachineDiskParamsWithContext creates a new AttachMachineDiskParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAttachMachineDiskParamsWithContext(ctx context.Context) *AttachMachineDiskParams { - var () return &AttachMachineDiskParams{ - Context: ctx, } } // NewAttachMachineDiskParamsWithHTTPClient creates a new AttachMachineDiskParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAttachMachineDiskParamsWithHTTPClient(client *http.Client) *AttachMachineDiskParams { - var () return &AttachMachineDiskParams{ HTTPClient: client, } } -/*AttachMachineDiskParams contains all the parameters to send to the API endpoint -for the attach machine disk operation typically these are written to a http.Request +/* AttachMachineDiskParams contains all the parameters to send to the API endpoint + for the attach machine disk operation. + + Typically these are written to a http.Request. */ type AttachMachineDiskParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Disk Specification instance + /* Body. + + Disk Specification instance */ Body *models.DiskAttachmentSpecification - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string @@ -83,6 +84,21 @@ type AttachMachineDiskParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the attach machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AttachMachineDiskParams) WithDefaults() *AttachMachineDiskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the attach machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AttachMachineDiskParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the attach machine disk params func (o *AttachMachineDiskParams) WithTimeout(timeout time.Duration) *AttachMachineDiskParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *AttachMachineDiskParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/disk/attach_machine_disk_responses.go b/pkg/client/disk/attach_machine_disk_responses.go index 90cd159f..bba778da 100644 --- a/pkg/client/disk/attach_machine_disk_responses.go +++ b/pkg/client/disk/attach_machine_disk_responses.go @@ -47,7 +47,6 @@ func (o *AttachMachineDiskReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewAttachMachineDiskOK() *AttachMachineDiskOK { return &AttachMachineDiskOK{} } -/*AttachMachineDiskOK handles this case with default header values. +/* AttachMachineDiskOK describes a response with status code 200, with default header values. successful operation */ @@ -69,7 +68,6 @@ type AttachMachineDiskOK struct { func (o *AttachMachineDiskOK) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/disks][%d] attachMachineDiskOK %+v", 200, o.Payload) } - func (o *AttachMachineDiskOK) GetPayload() *models.RequestTracker { return o.Payload } @@ -91,7 +89,7 @@ func NewAttachMachineDiskBadRequest() *AttachMachineDiskBadRequest { return &AttachMachineDiskBadRequest{} } -/*AttachMachineDiskBadRequest handles this case with default header values. +/* AttachMachineDiskBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -102,7 +100,6 @@ type AttachMachineDiskBadRequest struct { func (o *AttachMachineDiskBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/disks][%d] attachMachineDiskBadRequest %+v", 400, o.Payload) } - func (o *AttachMachineDiskBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,19 +121,30 @@ func NewAttachMachineDiskForbidden() *AttachMachineDiskForbidden { return &AttachMachineDiskForbidden{} } -/*AttachMachineDiskForbidden handles this case with default header values. +/* AttachMachineDiskForbidden describes a response with status code 403, with default header values. Forbidden */ type AttachMachineDiskForbidden struct { + Payload *models.ServiceErrorResponse } func (o *AttachMachineDiskForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/disks][%d] attachMachineDiskForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/disks][%d] attachMachineDiskForbidden %+v", 403, o.Payload) +} +func (o *AttachMachineDiskForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *AttachMachineDiskForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -145,7 +153,7 @@ func NewAttachMachineDiskNotFound() *AttachMachineDiskNotFound { return &AttachMachineDiskNotFound{} } -/*AttachMachineDiskNotFound handles this case with default header values. +/* AttachMachineDiskNotFound describes a response with status code 404, with default header values. Not Found */ @@ -156,7 +164,6 @@ type AttachMachineDiskNotFound struct { func (o *AttachMachineDiskNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/disks][%d] attachMachineDiskNotFound %+v", 404, o.Payload) } - func (o *AttachMachineDiskNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/create_block_device_parameters.go b/pkg/client/disk/create_block_device_parameters.go index 05008cdd..4f199d6f 100644 --- a/pkg/client/disk/create_block_device_parameters.go +++ b/pkg/client/disk/create_block_device_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateBlockDeviceParams creates a new CreateBlockDeviceParams object -// with the default values initialized. +// NewCreateBlockDeviceParams creates a new CreateBlockDeviceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateBlockDeviceParams() *CreateBlockDeviceParams { - var () return &CreateBlockDeviceParams{ - timeout: cr.DefaultTimeout, } } // NewCreateBlockDeviceParamsWithTimeout creates a new CreateBlockDeviceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateBlockDeviceParamsWithTimeout(timeout time.Duration) *CreateBlockDeviceParams { - var () return &CreateBlockDeviceParams{ - timeout: timeout, } } // NewCreateBlockDeviceParamsWithContext creates a new CreateBlockDeviceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateBlockDeviceParamsWithContext(ctx context.Context) *CreateBlockDeviceParams { - var () return &CreateBlockDeviceParams{ - Context: ctx, } } // NewCreateBlockDeviceParamsWithHTTPClient creates a new CreateBlockDeviceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateBlockDeviceParamsWithHTTPClient(client *http.Client) *CreateBlockDeviceParams { - var () return &CreateBlockDeviceParams{ HTTPClient: client, } } -/*CreateBlockDeviceParams contains all the parameters to send to the API endpoint -for the create block device operation typically these are written to a http.Request +/* CreateBlockDeviceParams contains all the parameters to send to the API endpoint + for the create block device operation. + + Typically these are written to a http.Request. */ type CreateBlockDeviceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Disk Specification instance + /* Body. + + Disk Specification instance */ Body *models.BlockDeviceSpecification @@ -78,6 +78,21 @@ type CreateBlockDeviceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlockDeviceParams) WithDefaults() *CreateBlockDeviceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlockDeviceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create block device params func (o *CreateBlockDeviceParams) WithTimeout(timeout time.Duration) *CreateBlockDeviceParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateBlockDeviceParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/disk/create_block_device_responses.go b/pkg/client/disk/create_block_device_responses.go index 02c3814f..6ff91826 100644 --- a/pkg/client/disk/create_block_device_responses.go +++ b/pkg/client/disk/create_block_device_responses.go @@ -41,7 +41,6 @@ func (o *CreateBlockDeviceReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateBlockDeviceAccepted() *CreateBlockDeviceAccepted { return &CreateBlockDeviceAccepted{} } -/*CreateBlockDeviceAccepted handles this case with default header values. +/* CreateBlockDeviceAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateBlockDeviceAccepted struct { func (o *CreateBlockDeviceAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices][%d] createBlockDeviceAccepted %+v", 202, o.Payload) } - func (o *CreateBlockDeviceAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateBlockDeviceBadRequest() *CreateBlockDeviceBadRequest { return &CreateBlockDeviceBadRequest{} } -/*CreateBlockDeviceBadRequest handles this case with default header values. +/* CreateBlockDeviceBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateBlockDeviceBadRequest struct { func (o *CreateBlockDeviceBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices][%d] createBlockDeviceBadRequest %+v", 400, o.Payload) } - func (o *CreateBlockDeviceBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateBlockDeviceForbidden() *CreateBlockDeviceForbidden { return &CreateBlockDeviceForbidden{} } -/*CreateBlockDeviceForbidden handles this case with default header values. +/* CreateBlockDeviceForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateBlockDeviceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateBlockDeviceForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices][%d] createBlockDeviceForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/block-devices][%d] createBlockDeviceForbidden %+v", 403, o.Payload) +} +func (o *CreateBlockDeviceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateBlockDeviceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/disk/create_block_device_snapshot_parameters.go b/pkg/client/disk/create_block_device_snapshot_parameters.go new file mode 100644 index 00000000..13c4b411 --- /dev/null +++ b/pkg/client/disk/create_block_device_snapshot_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package disk + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// NewCreateBlockDeviceSnapshotParams creates a new CreateBlockDeviceSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateBlockDeviceSnapshotParams() *CreateBlockDeviceSnapshotParams { + return &CreateBlockDeviceSnapshotParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateBlockDeviceSnapshotParamsWithTimeout creates a new CreateBlockDeviceSnapshotParams object +// with the ability to set a timeout on a request. +func NewCreateBlockDeviceSnapshotParamsWithTimeout(timeout time.Duration) *CreateBlockDeviceSnapshotParams { + return &CreateBlockDeviceSnapshotParams{ + timeout: timeout, + } +} + +// NewCreateBlockDeviceSnapshotParamsWithContext creates a new CreateBlockDeviceSnapshotParams object +// with the ability to set a context for a request. +func NewCreateBlockDeviceSnapshotParamsWithContext(ctx context.Context) *CreateBlockDeviceSnapshotParams { + return &CreateBlockDeviceSnapshotParams{ + Context: ctx, + } +} + +// NewCreateBlockDeviceSnapshotParamsWithHTTPClient creates a new CreateBlockDeviceSnapshotParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateBlockDeviceSnapshotParamsWithHTTPClient(client *http.Client) *CreateBlockDeviceSnapshotParams { + return &CreateBlockDeviceSnapshotParams{ + HTTPClient: client, + } +} + +/* CreateBlockDeviceSnapshotParams contains all the parameters to send to the API endpoint + for the create block device snapshot operation. + + Typically these are written to a http.Request. +*/ +type CreateBlockDeviceSnapshotParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* Body. + + Disk Snapshot Specification details + */ + Body *models.DiskSnapshotSpecification + + /* ID. + + The ID of the block device. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create block device snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlockDeviceSnapshotParams) WithDefaults() *CreateBlockDeviceSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create block device snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateBlockDeviceSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithTimeout(timeout time.Duration) *CreateBlockDeviceSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithContext(ctx context.Context) *CreateBlockDeviceSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithHTTPClient(client *http.Client) *CreateBlockDeviceSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithAPIVersion(aPIVersion *string) *CreateBlockDeviceSnapshotParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithBody adds the body to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithBody(body *models.DiskSnapshotSpecification) *CreateBlockDeviceSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetBody(body *models.DiskSnapshotSpecification) { + o.Body = body +} + +// WithID adds the id to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) WithID(id string) *CreateBlockDeviceSnapshotParams { + o.SetID(id) + return o +} + +// SetID adds the id to the create block device snapshot params +func (o *CreateBlockDeviceSnapshotParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateBlockDeviceSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // 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/pkg/client/disk/create_block_device_snapshot_responses.go b/pkg/client/disk/create_block_device_snapshot_responses.go new file mode 100644 index 00000000..96128bb8 --- /dev/null +++ b/pkg/client/disk/create_block_device_snapshot_responses.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package disk + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// CreateBlockDeviceSnapshotReader is a Reader for the CreateBlockDeviceSnapshot structure. +type CreateBlockDeviceSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateBlockDeviceSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewCreateBlockDeviceSnapshotAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewCreateBlockDeviceSnapshotNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewCreateBlockDeviceSnapshotForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateBlockDeviceSnapshotAccepted creates a CreateBlockDeviceSnapshotAccepted with default headers values +func NewCreateBlockDeviceSnapshotAccepted() *CreateBlockDeviceSnapshotAccepted { + return &CreateBlockDeviceSnapshotAccepted{} +} + +/* CreateBlockDeviceSnapshotAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type CreateBlockDeviceSnapshotAccepted struct { + Payload *models.RequestTracker +} + +func (o *CreateBlockDeviceSnapshotAccepted) Error() string { + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createBlockDeviceSnapshotAccepted %+v", 202, o.Payload) +} +func (o *CreateBlockDeviceSnapshotAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *CreateBlockDeviceSnapshotAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateBlockDeviceSnapshotNoContent creates a CreateBlockDeviceSnapshotNoContent with default headers values +func NewCreateBlockDeviceSnapshotNoContent() *CreateBlockDeviceSnapshotNoContent { + return &CreateBlockDeviceSnapshotNoContent{} +} + +/* CreateBlockDeviceSnapshotNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type CreateBlockDeviceSnapshotNoContent struct { +} + +func (o *CreateBlockDeviceSnapshotNoContent) Error() string { + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createBlockDeviceSnapshotNoContent ", 204) +} + +func (o *CreateBlockDeviceSnapshotNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateBlockDeviceSnapshotForbidden creates a CreateBlockDeviceSnapshotForbidden with default headers values +func NewCreateBlockDeviceSnapshotForbidden() *CreateBlockDeviceSnapshotForbidden { + return &CreateBlockDeviceSnapshotForbidden{} +} + +/* CreateBlockDeviceSnapshotForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CreateBlockDeviceSnapshotForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *CreateBlockDeviceSnapshotForbidden) Error() string { + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createBlockDeviceSnapshotForbidden %+v", 403, o.Payload) +} +func (o *CreateBlockDeviceSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *CreateBlockDeviceSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/disk/create_first_class_disk_snapshot_parameters.go b/pkg/client/disk/create_first_class_disk_snapshot_parameters.go deleted file mode 100644 index 286b7f37..00000000 --- a/pkg/client/disk/create_first_class_disk_snapshot_parameters.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package disk - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/vmware/vra-sdk-go/pkg/models" -) - -// NewCreateFirstClassDiskSnapshotParams creates a new CreateFirstClassDiskSnapshotParams object -// with the default values initialized. -func NewCreateFirstClassDiskSnapshotParams() *CreateFirstClassDiskSnapshotParams { - var () - return &CreateFirstClassDiskSnapshotParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewCreateFirstClassDiskSnapshotParamsWithTimeout creates a new CreateFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewCreateFirstClassDiskSnapshotParamsWithTimeout(timeout time.Duration) *CreateFirstClassDiskSnapshotParams { - var () - return &CreateFirstClassDiskSnapshotParams{ - - timeout: timeout, - } -} - -// NewCreateFirstClassDiskSnapshotParamsWithContext creates a new CreateFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a context for a request -func NewCreateFirstClassDiskSnapshotParamsWithContext(ctx context.Context) *CreateFirstClassDiskSnapshotParams { - var () - return &CreateFirstClassDiskSnapshotParams{ - - Context: ctx, - } -} - -// NewCreateFirstClassDiskSnapshotParamsWithHTTPClient creates a new CreateFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewCreateFirstClassDiskSnapshotParamsWithHTTPClient(client *http.Client) *CreateFirstClassDiskSnapshotParams { - var () - return &CreateFirstClassDiskSnapshotParams{ - HTTPClient: client, - } -} - -/*CreateFirstClassDiskSnapshotParams contains all the parameters to send to the API endpoint -for the create first class disk snapshot operation typically these are written to a http.Request -*/ -type CreateFirstClassDiskSnapshotParams struct { - - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about - - */ - APIVersion *string - /*Body - Disk Snapshot Specification details - - */ - Body *models.DiskSnapshotSpecification - /*ID - The ID of the block device. - - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithTimeout(timeout time.Duration) *CreateFirstClassDiskSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithContext(ctx context.Context) *CreateFirstClassDiskSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithHTTPClient(client *http.Client) *CreateFirstClassDiskSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAPIVersion adds the aPIVersion to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithAPIVersion(aPIVersion *string) *CreateFirstClassDiskSnapshotParams { - o.SetAPIVersion(aPIVersion) - return o -} - -// SetAPIVersion adds the apiVersion to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetAPIVersion(aPIVersion *string) { - o.APIVersion = aPIVersion -} - -// WithBody adds the body to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithBody(body *models.DiskSnapshotSpecification) *CreateFirstClassDiskSnapshotParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetBody(body *models.DiskSnapshotSpecification) { - o.Body = body -} - -// WithID adds the id to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) WithID(id string) *CreateFirstClassDiskSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the create first class disk snapshot params -func (o *CreateFirstClassDiskSnapshotParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateFirstClassDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.APIVersion != nil { - - // query param apiVersion - var qrAPIVersion string - if o.APIVersion != nil { - qrAPIVersion = *o.APIVersion - } - qAPIVersion := qrAPIVersion - if qAPIVersion != "" { - if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { - return err - } - } - - } - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // 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/pkg/client/disk/create_first_class_disk_snapshot_responses.go b/pkg/client/disk/create_first_class_disk_snapshot_responses.go deleted file mode 100644 index 5cb58310..00000000 --- a/pkg/client/disk/create_first_class_disk_snapshot_responses.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package disk - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/vmware/vra-sdk-go/pkg/models" -) - -// CreateFirstClassDiskSnapshotReader is a Reader for the CreateFirstClassDiskSnapshot structure. -type CreateFirstClassDiskSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateFirstClassDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewCreateFirstClassDiskSnapshotAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 204: - result := NewCreateFirstClassDiskSnapshotNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewCreateFirstClassDiskSnapshotForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateFirstClassDiskSnapshotAccepted creates a CreateFirstClassDiskSnapshotAccepted with default headers values -func NewCreateFirstClassDiskSnapshotAccepted() *CreateFirstClassDiskSnapshotAccepted { - return &CreateFirstClassDiskSnapshotAccepted{} -} - -/*CreateFirstClassDiskSnapshotAccepted handles this case with default header values. - -successful operation -*/ -type CreateFirstClassDiskSnapshotAccepted struct { - Payload *models.RequestTracker -} - -func (o *CreateFirstClassDiskSnapshotAccepted) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createFirstClassDiskSnapshotAccepted %+v", 202, o.Payload) -} - -func (o *CreateFirstClassDiskSnapshotAccepted) GetPayload() *models.RequestTracker { - return o.Payload -} - -func (o *CreateFirstClassDiskSnapshotAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RequestTracker) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateFirstClassDiskSnapshotNoContent creates a CreateFirstClassDiskSnapshotNoContent with default headers values -func NewCreateFirstClassDiskSnapshotNoContent() *CreateFirstClassDiskSnapshotNoContent { - return &CreateFirstClassDiskSnapshotNoContent{} -} - -/*CreateFirstClassDiskSnapshotNoContent handles this case with default header values. - -No Content -*/ -type CreateFirstClassDiskSnapshotNoContent struct { -} - -func (o *CreateFirstClassDiskSnapshotNoContent) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createFirstClassDiskSnapshotNoContent ", 204) -} - -func (o *CreateFirstClassDiskSnapshotNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateFirstClassDiskSnapshotForbidden creates a CreateFirstClassDiskSnapshotForbidden with default headers values -func NewCreateFirstClassDiskSnapshotForbidden() *CreateFirstClassDiskSnapshotForbidden { - return &CreateFirstClassDiskSnapshotForbidden{} -} - -/*CreateFirstClassDiskSnapshotForbidden handles this case with default header values. - -Forbidden -*/ -type CreateFirstClassDiskSnapshotForbidden struct { -} - -func (o *CreateFirstClassDiskSnapshotForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/snapshots][%d] createFirstClassDiskSnapshotForbidden ", 403) -} - -func (o *CreateFirstClassDiskSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/client/disk/delete_block_device_parameters.go b/pkg/client/disk/delete_block_device_parameters.go index d8b6f33e..674f1c3e 100644 --- a/pkg/client/disk/delete_block_device_parameters.go +++ b/pkg/client/disk/delete_block_device_parameters.go @@ -17,68 +17,70 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteBlockDeviceParams creates a new DeleteBlockDeviceParams object -// with the default values initialized. +// NewDeleteBlockDeviceParams creates a new DeleteBlockDeviceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteBlockDeviceParams() *DeleteBlockDeviceParams { - var () return &DeleteBlockDeviceParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteBlockDeviceParamsWithTimeout creates a new DeleteBlockDeviceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteBlockDeviceParamsWithTimeout(timeout time.Duration) *DeleteBlockDeviceParams { - var () return &DeleteBlockDeviceParams{ - timeout: timeout, } } // NewDeleteBlockDeviceParamsWithContext creates a new DeleteBlockDeviceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteBlockDeviceParamsWithContext(ctx context.Context) *DeleteBlockDeviceParams { - var () return &DeleteBlockDeviceParams{ - Context: ctx, } } // NewDeleteBlockDeviceParamsWithHTTPClient creates a new DeleteBlockDeviceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteBlockDeviceParamsWithHTTPClient(client *http.Client) *DeleteBlockDeviceParams { - var () return &DeleteBlockDeviceParams{ HTTPClient: client, } } -/*DeleteBlockDeviceParams contains all the parameters to send to the API endpoint -for the delete block device operation typically these are written to a http.Request +/* DeleteBlockDeviceParams contains all the parameters to send to the API endpoint + for the delete block device operation. + + Typically these are written to a http.Request. */ type DeleteBlockDeviceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this block device. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this block device. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the block device. + /* ID. + + The ID of the block device. */ ID string - /*Purge - Indicates if the disk has to be completely destroyed or should be kept in the system. Valid only for block devices with 'persistent' set to true. + /* Purge. + + Indicates if the disk has to be completely destroyed or should be kept in the system. Valid only for block devices with 'persistent' set to true. */ Purge *bool @@ -87,6 +89,21 @@ type DeleteBlockDeviceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlockDeviceParams) WithDefaults() *DeleteBlockDeviceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlockDeviceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete block device params func (o *DeleteBlockDeviceParams) WithTimeout(timeout time.Duration) *DeleteBlockDeviceParams { o.SetTimeout(timeout) @@ -176,32 +193,34 @@ func (o *DeleteBlockDeviceParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id @@ -213,16 +232,17 @@ func (o *DeleteBlockDeviceParams) WriteToRequest(r runtime.ClientRequest, reg st // query param purge var qrPurge bool + if o.Purge != nil { qrPurge = *o.Purge } qPurge := swag.FormatBool(qrPurge) if qPurge != "" { + if err := r.SetQueryParam("purge", qPurge); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/disk/delete_block_device_responses.go b/pkg/client/disk/delete_block_device_responses.go index c66e3549..ec74f917 100644 --- a/pkg/client/disk/delete_block_device_responses.go +++ b/pkg/client/disk/delete_block_device_responses.go @@ -41,7 +41,6 @@ func (o *DeleteBlockDeviceReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewDeleteBlockDeviceAccepted() *DeleteBlockDeviceAccepted { return &DeleteBlockDeviceAccepted{} } -/*DeleteBlockDeviceAccepted handles this case with default header values. +/* DeleteBlockDeviceAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type DeleteBlockDeviceAccepted struct { func (o *DeleteBlockDeviceAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}][%d] deleteBlockDeviceAccepted %+v", 202, o.Payload) } - func (o *DeleteBlockDeviceAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewDeleteBlockDeviceNoContent() *DeleteBlockDeviceNoContent { return &DeleteBlockDeviceNoContent{} } -/*DeleteBlockDeviceNoContent handles this case with default header values. +/* DeleteBlockDeviceNoContent describes a response with status code 204, with default header values. No Content */ @@ -106,18 +104,29 @@ func NewDeleteBlockDeviceForbidden() *DeleteBlockDeviceForbidden { return &DeleteBlockDeviceForbidden{} } -/*DeleteBlockDeviceForbidden handles this case with default header values. +/* DeleteBlockDeviceForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteBlockDeviceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteBlockDeviceForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}][%d] deleteBlockDeviceForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}][%d] deleteBlockDeviceForbidden %+v", 403, o.Payload) +} +func (o *DeleteBlockDeviceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteBlockDeviceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/disk/delete_block_device_snapshot_parameters.go b/pkg/client/disk/delete_block_device_snapshot_parameters.go new file mode 100644 index 00000000..eef31eea --- /dev/null +++ b/pkg/client/disk/delete_block_device_snapshot_parameters.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package disk + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteBlockDeviceSnapshotParams creates a new DeleteBlockDeviceSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteBlockDeviceSnapshotParams() *DeleteBlockDeviceSnapshotParams { + return &DeleteBlockDeviceSnapshotParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteBlockDeviceSnapshotParamsWithTimeout creates a new DeleteBlockDeviceSnapshotParams object +// with the ability to set a timeout on a request. +func NewDeleteBlockDeviceSnapshotParamsWithTimeout(timeout time.Duration) *DeleteBlockDeviceSnapshotParams { + return &DeleteBlockDeviceSnapshotParams{ + timeout: timeout, + } +} + +// NewDeleteBlockDeviceSnapshotParamsWithContext creates a new DeleteBlockDeviceSnapshotParams object +// with the ability to set a context for a request. +func NewDeleteBlockDeviceSnapshotParamsWithContext(ctx context.Context) *DeleteBlockDeviceSnapshotParams { + return &DeleteBlockDeviceSnapshotParams{ + Context: ctx, + } +} + +// NewDeleteBlockDeviceSnapshotParamsWithHTTPClient creates a new DeleteBlockDeviceSnapshotParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteBlockDeviceSnapshotParamsWithHTTPClient(client *http.Client) *DeleteBlockDeviceSnapshotParams { + return &DeleteBlockDeviceSnapshotParams{ + HTTPClient: client, + } +} + +/* DeleteBlockDeviceSnapshotParams contains all the parameters to send to the API endpoint + for the delete block device snapshot operation. + + Typically these are written to a http.Request. +*/ +type DeleteBlockDeviceSnapshotParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* ID. + + The ID of the block device. + */ + ID string + + /* Id1. + + Snapshot id to delete. + */ + Id1 string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete block device snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlockDeviceSnapshotParams) WithDefaults() *DeleteBlockDeviceSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete block device snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBlockDeviceSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithTimeout(timeout time.Duration) *DeleteBlockDeviceSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithContext(ctx context.Context) *DeleteBlockDeviceSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithHTTPClient(client *http.Client) *DeleteBlockDeviceSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithAPIVersion(aPIVersion *string) *DeleteBlockDeviceSnapshotParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithID adds the id to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithID(id string) *DeleteBlockDeviceSnapshotParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetID(id string) { + o.ID = id +} + +// WithId1 adds the id1 to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) WithId1(id1 string) *DeleteBlockDeviceSnapshotParams { + o.SetId1(id1) + return o +} + +// SetId1 adds the id1 to the delete block device snapshot params +func (o *DeleteBlockDeviceSnapshotParams) SetId1(id1 string) { + o.Id1 = id1 +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteBlockDeviceSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param id1 + if err := r.SetPathParam("id1", o.Id1); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/client/disk/delete_block_device_snapshot_responses.go b/pkg/client/disk/delete_block_device_snapshot_responses.go new file mode 100644 index 00000000..ff3dce86 --- /dev/null +++ b/pkg/client/disk/delete_block_device_snapshot_responses.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package disk + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// DeleteBlockDeviceSnapshotReader is a Reader for the DeleteBlockDeviceSnapshot structure. +type DeleteBlockDeviceSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteBlockDeviceSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewDeleteBlockDeviceSnapshotAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewDeleteBlockDeviceSnapshotNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewDeleteBlockDeviceSnapshotForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteBlockDeviceSnapshotAccepted creates a DeleteBlockDeviceSnapshotAccepted with default headers values +func NewDeleteBlockDeviceSnapshotAccepted() *DeleteBlockDeviceSnapshotAccepted { + return &DeleteBlockDeviceSnapshotAccepted{} +} + +/* DeleteBlockDeviceSnapshotAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type DeleteBlockDeviceSnapshotAccepted struct { + Payload *models.RequestTracker +} + +func (o *DeleteBlockDeviceSnapshotAccepted) Error() string { + return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteBlockDeviceSnapshotAccepted %+v", 202, o.Payload) +} +func (o *DeleteBlockDeviceSnapshotAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *DeleteBlockDeviceSnapshotAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBlockDeviceSnapshotNoContent creates a DeleteBlockDeviceSnapshotNoContent with default headers values +func NewDeleteBlockDeviceSnapshotNoContent() *DeleteBlockDeviceSnapshotNoContent { + return &DeleteBlockDeviceSnapshotNoContent{} +} + +/* DeleteBlockDeviceSnapshotNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type DeleteBlockDeviceSnapshotNoContent struct { +} + +func (o *DeleteBlockDeviceSnapshotNoContent) Error() string { + return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteBlockDeviceSnapshotNoContent ", 204) +} + +func (o *DeleteBlockDeviceSnapshotNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteBlockDeviceSnapshotForbidden creates a DeleteBlockDeviceSnapshotForbidden with default headers values +func NewDeleteBlockDeviceSnapshotForbidden() *DeleteBlockDeviceSnapshotForbidden { + return &DeleteBlockDeviceSnapshotForbidden{} +} + +/* DeleteBlockDeviceSnapshotForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteBlockDeviceSnapshotForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *DeleteBlockDeviceSnapshotForbidden) Error() string { + return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteBlockDeviceSnapshotForbidden %+v", 403, o.Payload) +} +func (o *DeleteBlockDeviceSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *DeleteBlockDeviceSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/disk/delete_first_class_disk_snapshot_parameters.go b/pkg/client/disk/delete_first_class_disk_snapshot_parameters.go deleted file mode 100644 index f86b870d..00000000 --- a/pkg/client/disk/delete_first_class_disk_snapshot_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package disk - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteFirstClassDiskSnapshotParams creates a new DeleteFirstClassDiskSnapshotParams object -// with the default values initialized. -func NewDeleteFirstClassDiskSnapshotParams() *DeleteFirstClassDiskSnapshotParams { - var () - return &DeleteFirstClassDiskSnapshotParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteFirstClassDiskSnapshotParamsWithTimeout creates a new DeleteFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeleteFirstClassDiskSnapshotParamsWithTimeout(timeout time.Duration) *DeleteFirstClassDiskSnapshotParams { - var () - return &DeleteFirstClassDiskSnapshotParams{ - - timeout: timeout, - } -} - -// NewDeleteFirstClassDiskSnapshotParamsWithContext creates a new DeleteFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeleteFirstClassDiskSnapshotParamsWithContext(ctx context.Context) *DeleteFirstClassDiskSnapshotParams { - var () - return &DeleteFirstClassDiskSnapshotParams{ - - Context: ctx, - } -} - -// NewDeleteFirstClassDiskSnapshotParamsWithHTTPClient creates a new DeleteFirstClassDiskSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeleteFirstClassDiskSnapshotParamsWithHTTPClient(client *http.Client) *DeleteFirstClassDiskSnapshotParams { - var () - return &DeleteFirstClassDiskSnapshotParams{ - HTTPClient: client, - } -} - -/*DeleteFirstClassDiskSnapshotParams contains all the parameters to send to the API endpoint -for the delete first class disk snapshot operation typically these are written to a http.Request -*/ -type DeleteFirstClassDiskSnapshotParams struct { - - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about - - */ - APIVersion *string - /*ID - The ID of the block device. - - */ - ID string - /*Id1 - Snapshot id to delete. - - */ - Id1 string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithTimeout(timeout time.Duration) *DeleteFirstClassDiskSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithContext(ctx context.Context) *DeleteFirstClassDiskSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithHTTPClient(client *http.Client) *DeleteFirstClassDiskSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAPIVersion adds the aPIVersion to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithAPIVersion(aPIVersion *string) *DeleteFirstClassDiskSnapshotParams { - o.SetAPIVersion(aPIVersion) - return o -} - -// SetAPIVersion adds the apiVersion to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetAPIVersion(aPIVersion *string) { - o.APIVersion = aPIVersion -} - -// WithID adds the id to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithID(id string) *DeleteFirstClassDiskSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetID(id string) { - o.ID = id -} - -// WithId1 adds the id1 to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) WithId1(id1 string) *DeleteFirstClassDiskSnapshotParams { - o.SetId1(id1) - return o -} - -// SetId1 adds the id1 to the delete first class disk snapshot params -func (o *DeleteFirstClassDiskSnapshotParams) SetId1(id1 string) { - o.Id1 = id1 -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteFirstClassDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.APIVersion != nil { - - // query param apiVersion - var qrAPIVersion string - if o.APIVersion != nil { - qrAPIVersion = *o.APIVersion - } - qAPIVersion := qrAPIVersion - if qAPIVersion != "" { - if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { - return err - } - } - - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param id1 - if err := r.SetPathParam("id1", o.Id1); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/client/disk/delete_first_class_disk_snapshot_responses.go b/pkg/client/disk/delete_first_class_disk_snapshot_responses.go deleted file mode 100644 index 66d6fff5..00000000 --- a/pkg/client/disk/delete_first_class_disk_snapshot_responses.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package disk - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/vmware/vra-sdk-go/pkg/models" -) - -// DeleteFirstClassDiskSnapshotReader is a Reader for the DeleteFirstClassDiskSnapshot structure. -type DeleteFirstClassDiskSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteFirstClassDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewDeleteFirstClassDiskSnapshotAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 204: - result := NewDeleteFirstClassDiskSnapshotNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeleteFirstClassDiskSnapshotForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteFirstClassDiskSnapshotAccepted creates a DeleteFirstClassDiskSnapshotAccepted with default headers values -func NewDeleteFirstClassDiskSnapshotAccepted() *DeleteFirstClassDiskSnapshotAccepted { - return &DeleteFirstClassDiskSnapshotAccepted{} -} - -/*DeleteFirstClassDiskSnapshotAccepted handles this case with default header values. - -successful operation -*/ -type DeleteFirstClassDiskSnapshotAccepted struct { - Payload *models.RequestTracker -} - -func (o *DeleteFirstClassDiskSnapshotAccepted) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteFirstClassDiskSnapshotAccepted %+v", 202, o.Payload) -} - -func (o *DeleteFirstClassDiskSnapshotAccepted) GetPayload() *models.RequestTracker { - return o.Payload -} - -func (o *DeleteFirstClassDiskSnapshotAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RequestTracker) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteFirstClassDiskSnapshotNoContent creates a DeleteFirstClassDiskSnapshotNoContent with default headers values -func NewDeleteFirstClassDiskSnapshotNoContent() *DeleteFirstClassDiskSnapshotNoContent { - return &DeleteFirstClassDiskSnapshotNoContent{} -} - -/*DeleteFirstClassDiskSnapshotNoContent handles this case with default header values. - -No Content -*/ -type DeleteFirstClassDiskSnapshotNoContent struct { -} - -func (o *DeleteFirstClassDiskSnapshotNoContent) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteFirstClassDiskSnapshotNoContent ", 204) -} - -func (o *DeleteFirstClassDiskSnapshotNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteFirstClassDiskSnapshotForbidden creates a DeleteFirstClassDiskSnapshotForbidden with default headers values -func NewDeleteFirstClassDiskSnapshotForbidden() *DeleteFirstClassDiskSnapshotForbidden { - return &DeleteFirstClassDiskSnapshotForbidden{} -} - -/*DeleteFirstClassDiskSnapshotForbidden handles this case with default header values. - -Forbidden -*/ -type DeleteFirstClassDiskSnapshotForbidden struct { -} - -func (o *DeleteFirstClassDiskSnapshotForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/block-devices/{id}/snapshots/{id1}][%d] deleteFirstClassDiskSnapshotForbidden ", 403) -} - -func (o *DeleteFirstClassDiskSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/client/disk/delete_machine_disk_parameters.go b/pkg/client/disk/delete_machine_disk_parameters.go index d52fb35f..cac93b1b 100644 --- a/pkg/client/disk/delete_machine_disk_parameters.go +++ b/pkg/client/disk/delete_machine_disk_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteMachineDiskParams creates a new DeleteMachineDiskParams object -// with the default values initialized. +// NewDeleteMachineDiskParams creates a new DeleteMachineDiskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteMachineDiskParams() *DeleteMachineDiskParams { - var () return &DeleteMachineDiskParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteMachineDiskParamsWithTimeout creates a new DeleteMachineDiskParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteMachineDiskParamsWithTimeout(timeout time.Duration) *DeleteMachineDiskParams { - var () return &DeleteMachineDiskParams{ - timeout: timeout, } } // NewDeleteMachineDiskParamsWithContext creates a new DeleteMachineDiskParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteMachineDiskParamsWithContext(ctx context.Context) *DeleteMachineDiskParams { - var () return &DeleteMachineDiskParams{ - Context: ctx, } } // NewDeleteMachineDiskParamsWithHTTPClient creates a new DeleteMachineDiskParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteMachineDiskParamsWithHTTPClient(client *http.Client) *DeleteMachineDiskParams { - var () return &DeleteMachineDiskParams{ HTTPClient: client, } } -/*DeleteMachineDiskParams contains all the parameters to send to the API endpoint -for the delete machine disk operation typically these are written to a http.Request +/* DeleteMachineDiskParams contains all the parameters to send to the API endpoint + for the delete machine disk operation. + + Typically these are written to a http.Request. */ type DeleteMachineDiskParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string - /*Id1 - The ID of the disk. + /* Id1. + + The ID of the disk. */ Id1 string @@ -81,6 +82,21 @@ type DeleteMachineDiskParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineDiskParams) WithDefaults() *DeleteMachineDiskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMachineDiskParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete machine disk params func (o *DeleteMachineDiskParams) WithTimeout(timeout time.Duration) *DeleteMachineDiskParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *DeleteMachineDiskParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/delete_machine_disk_responses.go b/pkg/client/disk/delete_machine_disk_responses.go index 98f730d7..c249a6c8 100644 --- a/pkg/client/disk/delete_machine_disk_responses.go +++ b/pkg/client/disk/delete_machine_disk_responses.go @@ -29,19 +29,12 @@ func (o *DeleteMachineDiskReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 204: - result := NewDeleteMachineDiskNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil case 403: result := NewDeleteMachineDiskForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +45,7 @@ func NewDeleteMachineDiskAccepted() *DeleteMachineDiskAccepted { return &DeleteMachineDiskAccepted{} } -/*DeleteMachineDiskAccepted handles this case with default header values. +/* DeleteMachineDiskAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +56,6 @@ type DeleteMachineDiskAccepted struct { func (o *DeleteMachineDiskAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/disks/{id1}][%d] deleteMachineDiskAccepted %+v", 202, o.Payload) } - func (o *DeleteMachineDiskAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -80,44 +72,34 @@ func (o *DeleteMachineDiskAccepted) readResponse(response runtime.ClientResponse return nil } -// NewDeleteMachineDiskNoContent creates a DeleteMachineDiskNoContent with default headers values -func NewDeleteMachineDiskNoContent() *DeleteMachineDiskNoContent { - return &DeleteMachineDiskNoContent{} -} - -/*DeleteMachineDiskNoContent handles this case with default header values. - -No Content -*/ -type DeleteMachineDiskNoContent struct { -} - -func (o *DeleteMachineDiskNoContent) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/disks/{id1}][%d] deleteMachineDiskNoContent ", 204) -} - -func (o *DeleteMachineDiskNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - // NewDeleteMachineDiskForbidden creates a DeleteMachineDiskForbidden with default headers values func NewDeleteMachineDiskForbidden() *DeleteMachineDiskForbidden { return &DeleteMachineDiskForbidden{} } -/*DeleteMachineDiskForbidden handles this case with default header values. +/* DeleteMachineDiskForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteMachineDiskForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteMachineDiskForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/disks/{id1}][%d] deleteMachineDiskForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/machines/{id}/disks/{id1}][%d] deleteMachineDiskForbidden %+v", 403, o.Payload) +} +func (o *DeleteMachineDiskForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteMachineDiskForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/disk/disk_client.go b/pkg/client/disk/disk_client.go index 641631c5..ce175bf2 100644 --- a/pkg/client/disk/disk_client.go +++ b/pkg/client/disk/disk_client.go @@ -25,37 +25,40 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - PromoteDisk(params *PromoteDiskParams) (*PromoteDiskAccepted, error) + PromoteDisk(params *PromoteDiskParams, opts ...ClientOption) (*PromoteDiskAccepted, error) - AttachMachineDisk(params *AttachMachineDiskParams) (*AttachMachineDiskOK, error) + AttachMachineDisk(params *AttachMachineDiskParams, opts ...ClientOption) (*AttachMachineDiskOK, error) - CreateBlockDevice(params *CreateBlockDeviceParams) (*CreateBlockDeviceAccepted, error) + CreateBlockDevice(params *CreateBlockDeviceParams, opts ...ClientOption) (*CreateBlockDeviceAccepted, error) - CreateFirstClassDiskSnapshot(params *CreateFirstClassDiskSnapshotParams) (*CreateFirstClassDiskSnapshotAccepted, *CreateFirstClassDiskSnapshotNoContent, error) + CreateBlockDeviceSnapshot(params *CreateBlockDeviceSnapshotParams, opts ...ClientOption) (*CreateBlockDeviceSnapshotAccepted, *CreateBlockDeviceSnapshotNoContent, error) - DeleteBlockDevice(params *DeleteBlockDeviceParams) (*DeleteBlockDeviceAccepted, *DeleteBlockDeviceNoContent, error) + DeleteBlockDevice(params *DeleteBlockDeviceParams, opts ...ClientOption) (*DeleteBlockDeviceAccepted, *DeleteBlockDeviceNoContent, error) - DeleteFirstClassDiskSnapshot(params *DeleteFirstClassDiskSnapshotParams) (*DeleteFirstClassDiskSnapshotAccepted, *DeleteFirstClassDiskSnapshotNoContent, error) + DeleteBlockDeviceSnapshot(params *DeleteBlockDeviceSnapshotParams, opts ...ClientOption) (*DeleteBlockDeviceSnapshotAccepted, *DeleteBlockDeviceSnapshotNoContent, error) - DeleteMachineDisk(params *DeleteMachineDiskParams) (*DeleteMachineDiskAccepted, *DeleteMachineDiskNoContent, error) + DeleteMachineDisk(params *DeleteMachineDiskParams, opts ...ClientOption) (*DeleteMachineDiskAccepted, error) - GetBlockDevice(params *GetBlockDeviceParams) (*GetBlockDeviceOK, error) + GetBlockDevice(params *GetBlockDeviceParams, opts ...ClientOption) (*GetBlockDeviceOK, error) - GetBlockDevices(params *GetBlockDevicesParams) (*GetBlockDevicesOK, error) + GetBlockDevices(params *GetBlockDevicesParams, opts ...ClientOption) (*GetBlockDevicesOK, error) - GetDiskSnapshot(params *GetDiskSnapshotParams) (*GetDiskSnapshotOK, error) + GetDiskSnapshot(params *GetDiskSnapshotParams, opts ...ClientOption) (*GetDiskSnapshotOK, error) - GetDiskSnapshots(params *GetDiskSnapshotsParams) (*GetDiskSnapshotsOK, error) + GetDiskSnapshots(params *GetDiskSnapshotsParams, opts ...ClientOption) (*GetDiskSnapshotsOK, error) - GetMachineDisk(params *GetMachineDiskParams) (*GetMachineDiskOK, error) + GetMachineDisk(params *GetMachineDiskParams, opts ...ClientOption) (*GetMachineDiskOK, error) - GetMachineDisks(params *GetMachineDisksParams) (*GetMachineDisksOK, error) + GetMachineDisks(params *GetMachineDisksParams, opts ...ClientOption) (*GetMachineDisksOK, error) - ResizeBlockDevice(params *ResizeBlockDeviceParams) (*ResizeBlockDeviceAccepted, *ResizeBlockDeviceNoContent, error) + ResizeBlockDevice(params *ResizeBlockDeviceParams, opts ...ClientOption) (*ResizeBlockDeviceAccepted, *ResizeBlockDeviceNoContent, error) - RevertDiskSnapshot(params *RevertDiskSnapshotParams) (*RevertDiskSnapshotAccepted, error) + RevertDiskSnapshot(params *RevertDiskSnapshotParams, opts ...ClientOption) (*RevertDiskSnapshotAccepted, error) SetTransport(transport runtime.ClientTransport) } @@ -63,15 +66,14 @@ type ClientService interface { /* PromoteDisk promotes operation on disk - Second day promote operation on disk + Second day promote operation on disk. Applicable for vSphere Block Devices only */ -func (a *Client) PromoteDisk(params *PromoteDiskParams) (*PromoteDiskAccepted, error) { +func (a *Client) PromoteDisk(params *PromoteDiskParams, opts ...ClientOption) (*PromoteDiskAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPromoteDiskParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "PromoteDisk", Method: "POST", PathPattern: "/iaas/api/block-devices/{id}/operations/promote", @@ -82,7 +84,12 @@ func (a *Client) PromoteDisk(params *PromoteDiskParams) (*PromoteDiskAccepted, e Reader: &PromoteDiskReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -101,13 +108,12 @@ func (a *Client) PromoteDisk(params *PromoteDiskParams) (*PromoteDiskAccepted, e Attach a disk to a machine. */ -func (a *Client) AttachMachineDisk(params *AttachMachineDiskParams) (*AttachMachineDiskOK, error) { +func (a *Client) AttachMachineDisk(params *AttachMachineDiskParams, opts ...ClientOption) (*AttachMachineDiskOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAttachMachineDiskParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "attachMachineDisk", Method: "POST", PathPattern: "/iaas/api/machines/{id}/disks", @@ -118,7 +124,12 @@ func (a *Client) AttachMachineDisk(params *AttachMachineDiskParams) (*AttachMach Reader: &AttachMachineDiskReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -142,13 +153,12 @@ func (a *Client) AttachMachineDisk(params *AttachMachineDiskParams) (*AttachMach 3. provisioningType: Defines the type of provisioning. For eg. thick/thin. 4. resourceGroupName: Defines the Azure resource group name where the disk needs to be provisioned. */ -func (a *Client) CreateBlockDevice(params *CreateBlockDeviceParams) (*CreateBlockDeviceAccepted, error) { +func (a *Client) CreateBlockDevice(params *CreateBlockDeviceParams, opts ...ClientOption) (*CreateBlockDeviceAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateBlockDeviceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createBlockDevice", Method: "POST", PathPattern: "/iaas/api/block-devices", @@ -159,7 +169,12 @@ func (a *Client) CreateBlockDevice(params *CreateBlockDeviceParams) (*CreateBloc Reader: &CreateBlockDeviceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -174,35 +189,39 @@ func (a *Client) CreateBlockDevice(params *CreateBlockDeviceParams) (*CreateBloc } /* - CreateFirstClassDiskSnapshot creates snapshot operation for first class disk + CreateBlockDeviceSnapshot creates snapshot operation for block device - Second day create snapshot operation for first class disk + Second day create snapshot operation for Block device */ -func (a *Client) CreateFirstClassDiskSnapshot(params *CreateFirstClassDiskSnapshotParams) (*CreateFirstClassDiskSnapshotAccepted, *CreateFirstClassDiskSnapshotNoContent, error) { +func (a *Client) CreateBlockDeviceSnapshot(params *CreateBlockDeviceSnapshotParams, opts ...ClientOption) (*CreateBlockDeviceSnapshotAccepted, *CreateBlockDeviceSnapshotNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewCreateFirstClassDiskSnapshotParams() + params = NewCreateBlockDeviceSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "createFirstClassDiskSnapshot", + op := &runtime.ClientOperation{ + ID: "createBlockDeviceSnapshot", Method: "POST", PathPattern: "/iaas/api/block-devices/{id}/operations/snapshots", ProducesMediaTypes: []string{"app/json", "application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &CreateFirstClassDiskSnapshotReader{formats: a.formats}, + Reader: &CreateBlockDeviceSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } switch value := result.(type) { - case *CreateFirstClassDiskSnapshotAccepted: + case *CreateBlockDeviceSnapshotAccepted: return value, nil, nil - case *CreateFirstClassDiskSnapshotNoContent: + case *CreateBlockDeviceSnapshotNoContent: return nil, value, nil } // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue @@ -218,13 +237,12 @@ func (a *Client) CreateFirstClassDiskSnapshot(params *CreateFirstClassDiskSnapsh 2. A block device with persistent property set to 'false' is deleted. 3. A block device with persistent property set to 'true' needs an additional parameter 'purge' to be set to true, for deletion. */ -func (a *Client) DeleteBlockDevice(params *DeleteBlockDeviceParams) (*DeleteBlockDeviceAccepted, *DeleteBlockDeviceNoContent, error) { +func (a *Client) DeleteBlockDevice(params *DeleteBlockDeviceParams, opts ...ClientOption) (*DeleteBlockDeviceAccepted, *DeleteBlockDeviceNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteBlockDeviceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteBlockDevice", Method: "DELETE", PathPattern: "/iaas/api/block-devices/{id}", @@ -235,7 +253,12 @@ func (a *Client) DeleteBlockDevice(params *DeleteBlockDeviceParams) (*DeleteBloc Reader: &DeleteBlockDeviceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -251,35 +274,39 @@ func (a *Client) DeleteBlockDevice(params *DeleteBlockDeviceParams) (*DeleteBloc } /* - DeleteFirstClassDiskSnapshot deletes snapshot operation for first class disk + DeleteBlockDeviceSnapshot deletes snapshot operation for block device - Second day delete snapshot operation for first class disk + Second day delete snapshot operation for Block device */ -func (a *Client) DeleteFirstClassDiskSnapshot(params *DeleteFirstClassDiskSnapshotParams) (*DeleteFirstClassDiskSnapshotAccepted, *DeleteFirstClassDiskSnapshotNoContent, error) { +func (a *Client) DeleteBlockDeviceSnapshot(params *DeleteBlockDeviceSnapshotParams, opts ...ClientOption) (*DeleteBlockDeviceSnapshotAccepted, *DeleteBlockDeviceSnapshotNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteFirstClassDiskSnapshotParams() + params = NewDeleteBlockDeviceSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "deleteFirstClassDiskSnapshot", + op := &runtime.ClientOperation{ + ID: "deleteBlockDeviceSnapshot", Method: "DELETE", PathPattern: "/iaas/api/block-devices/{id}/snapshots/{id1}", ProducesMediaTypes: []string{"app/json", "application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteFirstClassDiskSnapshotReader{formats: a.formats}, + Reader: &DeleteBlockDeviceSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } switch value := result.(type) { - case *DeleteFirstClassDiskSnapshotAccepted: + case *DeleteBlockDeviceSnapshotAccepted: return value, nil, nil - case *DeleteFirstClassDiskSnapshotNoContent: + case *DeleteBlockDeviceSnapshotNoContent: return nil, value, nil } // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue @@ -292,13 +319,12 @@ func (a *Client) DeleteFirstClassDiskSnapshot(params *DeleteFirstClassDiskSnapsh Remove a disk from a given machine. */ -func (a *Client) DeleteMachineDisk(params *DeleteMachineDiskParams) (*DeleteMachineDiskAccepted, *DeleteMachineDiskNoContent, error) { +func (a *Client) DeleteMachineDisk(params *DeleteMachineDiskParams, opts ...ClientOption) (*DeleteMachineDiskAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteMachineDiskParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteMachineDisk", Method: "DELETE", PathPattern: "/iaas/api/machines/{id}/disks/{id1}", @@ -309,18 +335,22 @@ func (a *Client) DeleteMachineDisk(params *DeleteMachineDiskParams) (*DeleteMach Reader: &DeleteMachineDiskReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { - return nil, nil, err + return nil, err } - switch value := result.(type) { - case *DeleteMachineDiskAccepted: - return value, nil, nil - case *DeleteMachineDiskNoContent: - return nil, value, nil + success, ok := result.(*DeleteMachineDiskAccepted) + if ok { + return success, nil } + // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for disk: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for deleteMachineDisk: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -329,13 +359,12 @@ func (a *Client) DeleteMachineDisk(params *DeleteMachineDiskParams) (*DeleteMach Get a single BlockDevice */ -func (a *Client) GetBlockDevice(params *GetBlockDeviceParams) (*GetBlockDeviceOK, error) { +func (a *Client) GetBlockDevice(params *GetBlockDeviceParams, opts ...ClientOption) (*GetBlockDeviceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlockDeviceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlockDevice", Method: "GET", PathPattern: "/iaas/api/block-devices/{id}", @@ -346,7 +375,12 @@ func (a *Client) GetBlockDevice(params *GetBlockDeviceParams) (*GetBlockDeviceOK Reader: &GetBlockDeviceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -365,13 +399,12 @@ func (a *Client) GetBlockDevice(params *GetBlockDeviceParams) (*GetBlockDeviceOK Get all BlockDevices */ -func (a *Client) GetBlockDevices(params *GetBlockDevicesParams) (*GetBlockDevicesOK, error) { +func (a *Client) GetBlockDevices(params *GetBlockDevicesParams, opts ...ClientOption) (*GetBlockDevicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetBlockDevicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getBlockDevices", Method: "GET", PathPattern: "/iaas/api/block-devices", @@ -382,7 +415,12 @@ func (a *Client) GetBlockDevices(params *GetBlockDevicesParams) (*GetBlockDevice Reader: &GetBlockDevicesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -401,13 +439,12 @@ func (a *Client) GetBlockDevices(params *GetBlockDevicesParams) (*GetBlockDevice Get snapshot with a given id for specific disk */ -func (a *Client) GetDiskSnapshot(params *GetDiskSnapshotParams) (*GetDiskSnapshotOK, error) { +func (a *Client) GetDiskSnapshot(params *GetDiskSnapshotParams, opts ...ClientOption) (*GetDiskSnapshotOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDiskSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDiskSnapshot", Method: "GET", PathPattern: "/iaas/api/block-devices/{id}/snapshots/{id1}", @@ -418,7 +455,12 @@ func (a *Client) GetDiskSnapshot(params *GetDiskSnapshotParams) (*GetDiskSnapsho Reader: &GetDiskSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -437,13 +479,12 @@ func (a *Client) GetDiskSnapshot(params *GetDiskSnapshotParams) (*GetDiskSnapsho Get disk snapshots information */ -func (a *Client) GetDiskSnapshots(params *GetDiskSnapshotsParams) (*GetDiskSnapshotsOK, error) { +func (a *Client) GetDiskSnapshots(params *GetDiskSnapshotsParams, opts ...ClientOption) (*GetDiskSnapshotsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDiskSnapshotsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDiskSnapshots", Method: "GET", PathPattern: "/iaas/api/block-devices/{id}/snapshots", @@ -454,7 +495,12 @@ func (a *Client) GetDiskSnapshots(params *GetDiskSnapshotsParams) (*GetDiskSnaps Reader: &GetDiskSnapshotsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -473,13 +519,12 @@ func (a *Client) GetDiskSnapshots(params *GetDiskSnapshotsParams) (*GetDiskSnaps Get disk with a given id for specific machine */ -func (a *Client) GetMachineDisk(params *GetMachineDiskParams) (*GetMachineDiskOK, error) { +func (a *Client) GetMachineDisk(params *GetMachineDiskParams, opts ...ClientOption) (*GetMachineDiskOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineDiskParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachineDisk", Method: "GET", PathPattern: "/iaas/api/machines/{id}/disks/{id1}", @@ -490,7 +535,12 @@ func (a *Client) GetMachineDisk(params *GetMachineDiskParams) (*GetMachineDiskOK Reader: &GetMachineDiskReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -509,13 +559,12 @@ func (a *Client) GetMachineDisk(params *GetMachineDiskParams) (*GetMachineDiskOK Get all machine disks */ -func (a *Client) GetMachineDisks(params *GetMachineDisksParams) (*GetMachineDisksOK, error) { +func (a *Client) GetMachineDisks(params *GetMachineDisksParams, opts ...ClientOption) (*GetMachineDisksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineDisksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachineDisks", Method: "GET", PathPattern: "/iaas/api/machines/{id}/disks", @@ -526,7 +575,12 @@ func (a *Client) GetMachineDisks(params *GetMachineDisksParams) (*GetMachineDisk Reader: &GetMachineDisksReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -545,13 +599,12 @@ func (a *Client) GetMachineDisks(params *GetMachineDisksParams) (*GetMachineDisk Resize operation on block device. */ -func (a *Client) ResizeBlockDevice(params *ResizeBlockDeviceParams) (*ResizeBlockDeviceAccepted, *ResizeBlockDeviceNoContent, error) { +func (a *Client) ResizeBlockDevice(params *ResizeBlockDeviceParams, opts ...ClientOption) (*ResizeBlockDeviceAccepted, *ResizeBlockDeviceNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewResizeBlockDeviceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "resizeBlockDevice", Method: "POST", PathPattern: "/iaas/api/block-devices/{id}", @@ -562,7 +615,12 @@ func (a *Client) ResizeBlockDevice(params *ResizeBlockDeviceParams) (*ResizeBloc Reader: &ResizeBlockDeviceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -578,17 +636,16 @@ func (a *Client) ResizeBlockDevice(params *ResizeBlockDeviceParams) (*ResizeBloc } /* - RevertDiskSnapshot reverts snapshot operation for disk + RevertDiskSnapshot reverts snapshot operation for block device - Second day revert snapshot operation for disk + Second day revert snapshot operation for Block device */ -func (a *Client) RevertDiskSnapshot(params *RevertDiskSnapshotParams) (*RevertDiskSnapshotAccepted, error) { +func (a *Client) RevertDiskSnapshot(params *RevertDiskSnapshotParams, opts ...ClientOption) (*RevertDiskSnapshotAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewRevertDiskSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "revertDiskSnapshot", Method: "POST", PathPattern: "/iaas/api/block-devices/{id}/operations/revert", @@ -599,7 +656,12 @@ func (a *Client) RevertDiskSnapshot(params *RevertDiskSnapshotParams) (*RevertDi Reader: &RevertDiskSnapshotReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/disk/get_block_device_parameters.go b/pkg/client/disk/get_block_device_parameters.go index bac74aad..1594edb6 100644 --- a/pkg/client/disk/get_block_device_parameters.go +++ b/pkg/client/disk/get_block_device_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetBlockDeviceParams creates a new GetBlockDeviceParams object -// with the default values initialized. +// NewGetBlockDeviceParams creates a new GetBlockDeviceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlockDeviceParams() *GetBlockDeviceParams { - var () return &GetBlockDeviceParams{ - timeout: cr.DefaultTimeout, } } // NewGetBlockDeviceParamsWithTimeout creates a new GetBlockDeviceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlockDeviceParamsWithTimeout(timeout time.Duration) *GetBlockDeviceParams { - var () return &GetBlockDeviceParams{ - timeout: timeout, } } // NewGetBlockDeviceParamsWithContext creates a new GetBlockDeviceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlockDeviceParamsWithContext(ctx context.Context) *GetBlockDeviceParams { - var () return &GetBlockDeviceParams{ - Context: ctx, } } // NewGetBlockDeviceParamsWithHTTPClient creates a new GetBlockDeviceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlockDeviceParamsWithHTTPClient(client *http.Client) *GetBlockDeviceParams { - var () return &GetBlockDeviceParams{ HTTPClient: client, } } -/*GetBlockDeviceParams contains all the parameters to send to the API endpoint -for the get block device operation typically these are written to a http.Request +/* GetBlockDeviceParams contains all the parameters to send to the API endpoint + for the get block device operation. + + Typically these are written to a http.Request. */ type GetBlockDeviceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the block device. + /* ID. + + The ID of the block device. */ ID string @@ -76,6 +76,21 @@ type GetBlockDeviceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlockDeviceParams) WithDefaults() *GetBlockDeviceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlockDeviceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get block device params func (o *GetBlockDeviceParams) WithTimeout(timeout time.Duration) *GetBlockDeviceParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetBlockDeviceParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/get_block_device_responses.go b/pkg/client/disk/get_block_device_responses.go index f2884798..197f924c 100644 --- a/pkg/client/disk/get_block_device_responses.go +++ b/pkg/client/disk/get_block_device_responses.go @@ -41,7 +41,6 @@ func (o *GetBlockDeviceReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetBlockDeviceOK() *GetBlockDeviceOK { return &GetBlockDeviceOK{} } -/*GetBlockDeviceOK handles this case with default header values. +/* GetBlockDeviceOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetBlockDeviceOK struct { func (o *GetBlockDeviceOK) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}][%d] getBlockDeviceOK %+v", 200, o.Payload) } - func (o *GetBlockDeviceOK) GetPayload() *models.BlockDevice { return o.Payload } @@ -85,19 +83,30 @@ func NewGetBlockDeviceForbidden() *GetBlockDeviceForbidden { return &GetBlockDeviceForbidden{} } -/*GetBlockDeviceForbidden handles this case with default header values. +/* GetBlockDeviceForbidden describes a response with status code 403, with default header values. Forbidden */ type GetBlockDeviceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetBlockDeviceForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/block-devices/{id}][%d] getBlockDeviceForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/block-devices/{id}][%d] getBlockDeviceForbidden %+v", 403, o.Payload) +} +func (o *GetBlockDeviceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetBlockDeviceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetBlockDeviceNotFound() *GetBlockDeviceNotFound { return &GetBlockDeviceNotFound{} } -/*GetBlockDeviceNotFound handles this case with default header values. +/* GetBlockDeviceNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetBlockDeviceNotFound struct { func (o *GetBlockDeviceNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}][%d] getBlockDeviceNotFound %+v", 404, o.Payload) } - func (o *GetBlockDeviceNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/get_block_devices_parameters.go b/pkg/client/disk/get_block_devices_parameters.go index a02f10fe..ab251e5b 100644 --- a/pkg/client/disk/get_block_devices_parameters.go +++ b/pkg/client/disk/get_block_devices_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetBlockDevicesParams creates a new GetBlockDevicesParams object -// with the default values initialized. +// NewGetBlockDevicesParams creates a new GetBlockDevicesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetBlockDevicesParams() *GetBlockDevicesParams { - var () return &GetBlockDevicesParams{ - timeout: cr.DefaultTimeout, } } // NewGetBlockDevicesParamsWithTimeout creates a new GetBlockDevicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetBlockDevicesParamsWithTimeout(timeout time.Duration) *GetBlockDevicesParams { - var () return &GetBlockDevicesParams{ - timeout: timeout, } } // NewGetBlockDevicesParamsWithContext creates a new GetBlockDevicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetBlockDevicesParamsWithContext(ctx context.Context) *GetBlockDevicesParams { - var () return &GetBlockDevicesParams{ - Context: ctx, } } // NewGetBlockDevicesParamsWithHTTPClient creates a new GetBlockDevicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetBlockDevicesParamsWithHTTPClient(client *http.Client) *GetBlockDevicesParams { - var () return &GetBlockDevicesParams{ HTTPClient: client, } } -/*GetBlockDevicesParams contains all the parameters to send to the API endpoint -for the get block devices operation typically these are written to a http.Request +/* GetBlockDevicesParams contains all the parameters to send to the API endpoint + for the get block devices operation. + + Typically these are written to a http.Request. */ type GetBlockDevicesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetBlockDevicesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get block devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlockDevicesParams) WithDefaults() *GetBlockDevicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get block devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBlockDevicesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get block devices params func (o *GetBlockDevicesParams) WithTimeout(timeout time.Duration) *GetBlockDevicesParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetBlockDevicesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get block devices params +func (o *GetBlockDevicesParams) WithDollarCount(dollarCount *bool) *GetBlockDevicesParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get block devices params +func (o *GetBlockDevicesParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get block devices params func (o *GetBlockDevicesParams) WithDollarFilter(dollarFilter *string) *GetBlockDevicesParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetBlockDevicesParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get block devices params +func (o *GetBlockDevicesParams) WithDollarSelect(dollarSelect *string) *GetBlockDevicesParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get block devices params +func (o *GetBlockDevicesParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get block devices params +func (o *GetBlockDevicesParams) WithDollarSkip(dollarSkip *int64) *GetBlockDevicesParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get block devices params +func (o *GetBlockDevicesParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get block devices params +func (o *GetBlockDevicesParams) WithDollarTop(dollarTop *int64) *GetBlockDevicesParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get block devices params +func (o *GetBlockDevicesParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get block devices params func (o *GetBlockDevicesParams) WithAPIVersion(aPIVersion *string) *GetBlockDevicesParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetBlockDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/disk/get_block_devices_responses.go b/pkg/client/disk/get_block_devices_responses.go index 6b272f51..5d53d861 100644 --- a/pkg/client/disk/get_block_devices_responses.go +++ b/pkg/client/disk/get_block_devices_responses.go @@ -35,7 +35,6 @@ func (o *GetBlockDevicesReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetBlockDevicesOK() *GetBlockDevicesOK { return &GetBlockDevicesOK{} } -/*GetBlockDevicesOK handles this case with default header values. +/* GetBlockDevicesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetBlockDevicesOK struct { func (o *GetBlockDevicesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices][%d] getBlockDevicesOK %+v", 200, o.Payload) } - func (o *GetBlockDevicesOK) GetPayload() *models.BlockDeviceResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetBlockDevicesForbidden() *GetBlockDevicesForbidden { return &GetBlockDevicesForbidden{} } -/*GetBlockDevicesForbidden handles this case with default header values. +/* GetBlockDevicesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetBlockDevicesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetBlockDevicesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/block-devices][%d] getBlockDevicesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/block-devices][%d] getBlockDevicesForbidden %+v", 403, o.Payload) +} +func (o *GetBlockDevicesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetBlockDevicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/disk/get_disk_snapshot_parameters.go b/pkg/client/disk/get_disk_snapshot_parameters.go index 7c79caa0..4442fb81 100644 --- a/pkg/client/disk/get_disk_snapshot_parameters.go +++ b/pkg/client/disk/get_disk_snapshot_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDiskSnapshotParams creates a new GetDiskSnapshotParams object -// with the default values initialized. +// NewGetDiskSnapshotParams creates a new GetDiskSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDiskSnapshotParams() *GetDiskSnapshotParams { - var () return &GetDiskSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewGetDiskSnapshotParamsWithTimeout creates a new GetDiskSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDiskSnapshotParamsWithTimeout(timeout time.Duration) *GetDiskSnapshotParams { - var () return &GetDiskSnapshotParams{ - timeout: timeout, } } // NewGetDiskSnapshotParamsWithContext creates a new GetDiskSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDiskSnapshotParamsWithContext(ctx context.Context) *GetDiskSnapshotParams { - var () return &GetDiskSnapshotParams{ - Context: ctx, } } // NewGetDiskSnapshotParamsWithHTTPClient creates a new GetDiskSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDiskSnapshotParamsWithHTTPClient(client *http.Client) *GetDiskSnapshotParams { - var () return &GetDiskSnapshotParams{ HTTPClient: client, } } -/*GetDiskSnapshotParams contains all the parameters to send to the API endpoint -for the get disk snapshot operation typically these are written to a http.Request +/* GetDiskSnapshotParams contains all the parameters to send to the API endpoint + for the get disk snapshot operation. + + Typically these are written to a http.Request. */ type GetDiskSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the disk. */ ID string - /*Id1 - The ID of the snapshot. + /* Id1. + + The ID of the snapshot. */ Id1 string @@ -81,6 +82,21 @@ type GetDiskSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get disk snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDiskSnapshotParams) WithDefaults() *GetDiskSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get disk snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDiskSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get disk snapshot params func (o *GetDiskSnapshotParams) WithTimeout(timeout time.Duration) *GetDiskSnapshotParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/get_disk_snapshot_responses.go b/pkg/client/disk/get_disk_snapshot_responses.go index 7391d730..c1fc9643 100644 --- a/pkg/client/disk/get_disk_snapshot_responses.go +++ b/pkg/client/disk/get_disk_snapshot_responses.go @@ -41,7 +41,6 @@ func (o *GetDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDiskSnapshotOK() *GetDiskSnapshotOK { return &GetDiskSnapshotOK{} } -/*GetDiskSnapshotOK handles this case with default header values. +/* GetDiskSnapshotOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetDiskSnapshotOK struct { func (o *GetDiskSnapshotOK) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots/{id1}][%d] getDiskSnapshotOK %+v", 200, o.Payload) } - func (o *GetDiskSnapshotOK) GetPayload() *models.DiskSnapshot { return o.Payload } @@ -85,19 +83,30 @@ func NewGetDiskSnapshotForbidden() *GetDiskSnapshotForbidden { return &GetDiskSnapshotForbidden{} } -/*GetDiskSnapshotForbidden handles this case with default header values. +/* GetDiskSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type GetDiskSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetDiskSnapshotForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots/{id1}][%d] getDiskSnapshotForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots/{id1}][%d] getDiskSnapshotForbidden %+v", 403, o.Payload) +} +func (o *GetDiskSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetDiskSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetDiskSnapshotNotFound() *GetDiskSnapshotNotFound { return &GetDiskSnapshotNotFound{} } -/*GetDiskSnapshotNotFound handles this case with default header values. +/* GetDiskSnapshotNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetDiskSnapshotNotFound struct { func (o *GetDiskSnapshotNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots/{id1}][%d] getDiskSnapshotNotFound %+v", 404, o.Payload) } - func (o *GetDiskSnapshotNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/get_disk_snapshots_parameters.go b/pkg/client/disk/get_disk_snapshots_parameters.go index c141e3a3..5e137a13 100644 --- a/pkg/client/disk/get_disk_snapshots_parameters.go +++ b/pkg/client/disk/get_disk_snapshots_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDiskSnapshotsParams creates a new GetDiskSnapshotsParams object -// with the default values initialized. +// NewGetDiskSnapshotsParams creates a new GetDiskSnapshotsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDiskSnapshotsParams() *GetDiskSnapshotsParams { - var () return &GetDiskSnapshotsParams{ - timeout: cr.DefaultTimeout, } } // NewGetDiskSnapshotsParamsWithTimeout creates a new GetDiskSnapshotsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDiskSnapshotsParamsWithTimeout(timeout time.Duration) *GetDiskSnapshotsParams { - var () return &GetDiskSnapshotsParams{ - timeout: timeout, } } // NewGetDiskSnapshotsParamsWithContext creates a new GetDiskSnapshotsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDiskSnapshotsParamsWithContext(ctx context.Context) *GetDiskSnapshotsParams { - var () return &GetDiskSnapshotsParams{ - Context: ctx, } } // NewGetDiskSnapshotsParamsWithHTTPClient creates a new GetDiskSnapshotsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDiskSnapshotsParamsWithHTTPClient(client *http.Client) *GetDiskSnapshotsParams { - var () return &GetDiskSnapshotsParams{ HTTPClient: client, } } -/*GetDiskSnapshotsParams contains all the parameters to send to the API endpoint -for the get disk snapshots operation typically these are written to a http.Request +/* GetDiskSnapshotsParams contains all the parameters to send to the API endpoint + for the get disk snapshots operation. + + Typically these are written to a http.Request. */ type GetDiskSnapshotsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the disk. + /* ID. + + The ID of the disk. */ ID string @@ -76,6 +76,21 @@ type GetDiskSnapshotsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get disk snapshots params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDiskSnapshotsParams) WithDefaults() *GetDiskSnapshotsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get disk snapshots params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDiskSnapshotsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get disk snapshots params func (o *GetDiskSnapshotsParams) WithTimeout(timeout time.Duration) *GetDiskSnapshotsParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetDiskSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/get_disk_snapshots_responses.go b/pkg/client/disk/get_disk_snapshots_responses.go index 89a0cfd5..ecdbfca7 100644 --- a/pkg/client/disk/get_disk_snapshots_responses.go +++ b/pkg/client/disk/get_disk_snapshots_responses.go @@ -41,7 +41,6 @@ func (o *GetDiskSnapshotsReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetDiskSnapshotsOK() *GetDiskSnapshotsOK { return &GetDiskSnapshotsOK{} } -/*GetDiskSnapshotsOK handles this case with default header values. +/* GetDiskSnapshotsOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetDiskSnapshotsOK struct { func (o *GetDiskSnapshotsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots][%d] getDiskSnapshotsOK %+v", 200, o.Payload) } - func (o *GetDiskSnapshotsOK) GetPayload() []*models.DiskSnapshot { return o.Payload } @@ -83,19 +81,30 @@ func NewGetDiskSnapshotsForbidden() *GetDiskSnapshotsForbidden { return &GetDiskSnapshotsForbidden{} } -/*GetDiskSnapshotsForbidden handles this case with default header values. +/* GetDiskSnapshotsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetDiskSnapshotsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetDiskSnapshotsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots][%d] getDiskSnapshotsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots][%d] getDiskSnapshotsForbidden %+v", 403, o.Payload) +} +func (o *GetDiskSnapshotsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetDiskSnapshotsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -104,7 +113,7 @@ func NewGetDiskSnapshotsNotFound() *GetDiskSnapshotsNotFound { return &GetDiskSnapshotsNotFound{} } -/*GetDiskSnapshotsNotFound handles this case with default header values. +/* GetDiskSnapshotsNotFound describes a response with status code 404, with default header values. Not Found */ @@ -115,7 +124,6 @@ type GetDiskSnapshotsNotFound struct { func (o *GetDiskSnapshotsNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/block-devices/{id}/snapshots][%d] getDiskSnapshotsNotFound %+v", 404, o.Payload) } - func (o *GetDiskSnapshotsNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/get_machine_disk_parameters.go b/pkg/client/disk/get_machine_disk_parameters.go index 144bafaf..702157b1 100644 --- a/pkg/client/disk/get_machine_disk_parameters.go +++ b/pkg/client/disk/get_machine_disk_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineDiskParams creates a new GetMachineDiskParams object -// with the default values initialized. +// NewGetMachineDiskParams creates a new GetMachineDiskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineDiskParams() *GetMachineDiskParams { - var () return &GetMachineDiskParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineDiskParamsWithTimeout creates a new GetMachineDiskParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineDiskParamsWithTimeout(timeout time.Duration) *GetMachineDiskParams { - var () return &GetMachineDiskParams{ - timeout: timeout, } } // NewGetMachineDiskParamsWithContext creates a new GetMachineDiskParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineDiskParamsWithContext(ctx context.Context) *GetMachineDiskParams { - var () return &GetMachineDiskParams{ - Context: ctx, } } // NewGetMachineDiskParamsWithHTTPClient creates a new GetMachineDiskParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineDiskParamsWithHTTPClient(client *http.Client) *GetMachineDiskParams { - var () return &GetMachineDiskParams{ HTTPClient: client, } } -/*GetMachineDiskParams contains all the parameters to send to the API endpoint -for the get machine disk operation typically these are written to a http.Request +/* GetMachineDiskParams contains all the parameters to send to the API endpoint + for the get machine disk operation. + + Typically these are written to a http.Request. */ type GetMachineDiskParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string - /*Id1 - The ID of the disk. + /* Id1. + + The ID of the disk. */ Id1 string @@ -81,6 +82,21 @@ type GetMachineDiskParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineDiskParams) WithDefaults() *GetMachineDiskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineDiskParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine disk params func (o *GetMachineDiskParams) WithTimeout(timeout time.Duration) *GetMachineDiskParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetMachineDiskParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/get_machine_disk_responses.go b/pkg/client/disk/get_machine_disk_responses.go index 1025ca23..4c57df76 100644 --- a/pkg/client/disk/get_machine_disk_responses.go +++ b/pkg/client/disk/get_machine_disk_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineDiskReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineDiskOK() *GetMachineDiskOK { return &GetMachineDiskOK{} } -/*GetMachineDiskOK handles this case with default header values. +/* GetMachineDiskOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineDiskOK struct { func (o *GetMachineDiskOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks/{id1}][%d] getMachineDiskOK %+v", 200, o.Payload) } - func (o *GetMachineDiskOK) GetPayload() *models.BlockDevice { return o.Payload } @@ -85,19 +83,30 @@ func NewGetMachineDiskForbidden() *GetMachineDiskForbidden { return &GetMachineDiskForbidden{} } -/*GetMachineDiskForbidden handles this case with default header values. +/* GetMachineDiskForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineDiskForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineDiskForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks/{id1}][%d] getMachineDiskForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks/{id1}][%d] getMachineDiskForbidden %+v", 403, o.Payload) +} +func (o *GetMachineDiskForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineDiskForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetMachineDiskNotFound() *GetMachineDiskNotFound { return &GetMachineDiskNotFound{} } -/*GetMachineDiskNotFound handles this case with default header values. +/* GetMachineDiskNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetMachineDiskNotFound struct { func (o *GetMachineDiskNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks/{id1}][%d] getMachineDiskNotFound %+v", 404, o.Payload) } - func (o *GetMachineDiskNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/get_machine_disks_parameters.go b/pkg/client/disk/get_machine_disks_parameters.go index abf635ec..26267223 100644 --- a/pkg/client/disk/get_machine_disks_parameters.go +++ b/pkg/client/disk/get_machine_disks_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineDisksParams creates a new GetMachineDisksParams object -// with the default values initialized. +// NewGetMachineDisksParams creates a new GetMachineDisksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineDisksParams() *GetMachineDisksParams { - var () return &GetMachineDisksParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineDisksParamsWithTimeout creates a new GetMachineDisksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineDisksParamsWithTimeout(timeout time.Duration) *GetMachineDisksParams { - var () return &GetMachineDisksParams{ - timeout: timeout, } } // NewGetMachineDisksParamsWithContext creates a new GetMachineDisksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineDisksParamsWithContext(ctx context.Context) *GetMachineDisksParams { - var () return &GetMachineDisksParams{ - Context: ctx, } } // NewGetMachineDisksParamsWithHTTPClient creates a new GetMachineDisksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineDisksParamsWithHTTPClient(client *http.Client) *GetMachineDisksParams { - var () return &GetMachineDisksParams{ HTTPClient: client, } } -/*GetMachineDisksParams contains all the parameters to send to the API endpoint -for the get machine disks operation typically these are written to a http.Request +/* GetMachineDisksParams contains all the parameters to send to the API endpoint + for the get machine disks operation. + + Typically these are written to a http.Request. */ type GetMachineDisksParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string @@ -76,6 +76,21 @@ type GetMachineDisksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine disks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineDisksParams) WithDefaults() *GetMachineDisksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine disks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineDisksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine disks params func (o *GetMachineDisksParams) WithTimeout(timeout time.Duration) *GetMachineDisksParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetMachineDisksParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/get_machine_disks_responses.go b/pkg/client/disk/get_machine_disks_responses.go index 1737c9fd..4cbf9860 100644 --- a/pkg/client/disk/get_machine_disks_responses.go +++ b/pkg/client/disk/get_machine_disks_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineDisksReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineDisksOK() *GetMachineDisksOK { return &GetMachineDisksOK{} } -/*GetMachineDisksOK handles this case with default header values. +/* GetMachineDisksOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineDisksOK struct { func (o *GetMachineDisksOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks][%d] getMachineDisksOK %+v", 200, o.Payload) } - func (o *GetMachineDisksOK) GetPayload() *models.BlockDeviceResult { return o.Payload } @@ -85,19 +83,30 @@ func NewGetMachineDisksForbidden() *GetMachineDisksForbidden { return &GetMachineDisksForbidden{} } -/*GetMachineDisksForbidden handles this case with default header values. +/* GetMachineDisksForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineDisksForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineDisksForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks][%d] getMachineDisksForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks][%d] getMachineDisksForbidden %+v", 403, o.Payload) +} +func (o *GetMachineDisksForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineDisksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetMachineDisksNotFound() *GetMachineDisksNotFound { return &GetMachineDisksNotFound{} } -/*GetMachineDisksNotFound handles this case with default header values. +/* GetMachineDisksNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetMachineDisksNotFound struct { func (o *GetMachineDisksNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/disks][%d] getMachineDisksNotFound %+v", 404, o.Payload) } - func (o *GetMachineDisksNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/promote_disk_parameters.go b/pkg/client/disk/promote_disk_parameters.go index f4540bd6..0de60d81 100644 --- a/pkg/client/disk/promote_disk_parameters.go +++ b/pkg/client/disk/promote_disk_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPromoteDiskParams creates a new PromoteDiskParams object -// with the default values initialized. +// NewPromoteDiskParams creates a new PromoteDiskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPromoteDiskParams() *PromoteDiskParams { - var () return &PromoteDiskParams{ - timeout: cr.DefaultTimeout, } } // NewPromoteDiskParamsWithTimeout creates a new PromoteDiskParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPromoteDiskParamsWithTimeout(timeout time.Duration) *PromoteDiskParams { - var () return &PromoteDiskParams{ - timeout: timeout, } } // NewPromoteDiskParamsWithContext creates a new PromoteDiskParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPromoteDiskParamsWithContext(ctx context.Context) *PromoteDiskParams { - var () return &PromoteDiskParams{ - Context: ctx, } } // NewPromoteDiskParamsWithHTTPClient creates a new PromoteDiskParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPromoteDiskParamsWithHTTPClient(client *http.Client) *PromoteDiskParams { - var () return &PromoteDiskParams{ HTTPClient: client, } } -/*PromoteDiskParams contains all the parameters to send to the API endpoint -for the promote disk operation typically these are written to a http.Request +/* PromoteDiskParams contains all the parameters to send to the API endpoint + for the promote disk operation. + + Typically these are written to a http.Request. */ type PromoteDiskParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Disk. + /* ID. + + The id of the Disk. */ ID string @@ -76,6 +76,21 @@ type PromoteDiskParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the promote disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PromoteDiskParams) WithDefaults() *PromoteDiskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the promote disk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PromoteDiskParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the promote disk params func (o *PromoteDiskParams) WithTimeout(timeout time.Duration) *PromoteDiskParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *PromoteDiskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/disk/promote_disk_responses.go b/pkg/client/disk/promote_disk_responses.go index 195ca939..724fd98f 100644 --- a/pkg/client/disk/promote_disk_responses.go +++ b/pkg/client/disk/promote_disk_responses.go @@ -41,7 +41,6 @@ func (o *PromoteDiskReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewPromoteDiskAccepted() *PromoteDiskAccepted { return &PromoteDiskAccepted{} } -/*PromoteDiskAccepted handles this case with default header values. +/* PromoteDiskAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type PromoteDiskAccepted struct { func (o *PromoteDiskAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/promote][%d] promoteDiskAccepted %+v", 202, o.Payload) } - func (o *PromoteDiskAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewPromoteDiskForbidden() *PromoteDiskForbidden { return &PromoteDiskForbidden{} } -/*PromoteDiskForbidden handles this case with default header values. +/* PromoteDiskForbidden describes a response with status code 403, with default header values. Forbidden */ type PromoteDiskForbidden struct { + Payload *models.ServiceErrorResponse } func (o *PromoteDiskForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/promote][%d] promoteDiskForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/promote][%d] promoteDiskForbidden %+v", 403, o.Payload) +} +func (o *PromoteDiskForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *PromoteDiskForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewPromoteDiskNotFound() *PromoteDiskNotFound { return &PromoteDiskNotFound{} } -/*PromoteDiskNotFound handles this case with default header values. +/* PromoteDiskNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type PromoteDiskNotFound struct { func (o *PromoteDiskNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/promote][%d] promoteDiskNotFound %+v", 404, o.Payload) } - func (o *PromoteDiskNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/disk/resize_block_device_parameters.go b/pkg/client/disk/resize_block_device_parameters.go index 4da3c3d1..19ba8b82 100644 --- a/pkg/client/disk/resize_block_device_parameters.go +++ b/pkg/client/disk/resize_block_device_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewResizeBlockDeviceParams creates a new ResizeBlockDeviceParams object -// with the default values initialized. +// NewResizeBlockDeviceParams creates a new ResizeBlockDeviceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewResizeBlockDeviceParams() *ResizeBlockDeviceParams { - var () return &ResizeBlockDeviceParams{ - timeout: cr.DefaultTimeout, } } // NewResizeBlockDeviceParamsWithTimeout creates a new ResizeBlockDeviceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewResizeBlockDeviceParamsWithTimeout(timeout time.Duration) *ResizeBlockDeviceParams { - var () return &ResizeBlockDeviceParams{ - timeout: timeout, } } // NewResizeBlockDeviceParamsWithContext creates a new ResizeBlockDeviceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewResizeBlockDeviceParamsWithContext(ctx context.Context) *ResizeBlockDeviceParams { - var () return &ResizeBlockDeviceParams{ - Context: ctx, } } // NewResizeBlockDeviceParamsWithHTTPClient creates a new ResizeBlockDeviceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewResizeBlockDeviceParamsWithHTTPClient(client *http.Client) *ResizeBlockDeviceParams { - var () return &ResizeBlockDeviceParams{ HTTPClient: client, } } -/*ResizeBlockDeviceParams contains all the parameters to send to the API endpoint -for the resize block device operation typically these are written to a http.Request +/* ResizeBlockDeviceParams contains all the parameters to send to the API endpoint + for the resize block device operation. + + Typically these are written to a http.Request. */ type ResizeBlockDeviceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*CapacityInGB - Resize Capacity in GB + /* CapacityInGB. + + Resize Capacity in GB + + Format: int32 */ CapacityInGB int32 - /*ID - The ID of the block device. + /* ID. + + The ID of the block device. */ ID string @@ -82,6 +85,21 @@ type ResizeBlockDeviceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the resize block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResizeBlockDeviceParams) WithDefaults() *ResizeBlockDeviceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resize block device params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResizeBlockDeviceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the resize block device params func (o *ResizeBlockDeviceParams) WithTimeout(timeout time.Duration) *ResizeBlockDeviceParams { o.SetTimeout(timeout) @@ -160,22 +178,24 @@ func (o *ResizeBlockDeviceParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // query param capacityInGB qrCapacityInGB := o.CapacityInGB qCapacityInGB := swag.FormatInt32(qrCapacityInGB) if qCapacityInGB != "" { + if err := r.SetQueryParam("capacityInGB", qCapacityInGB); err != nil { return err } diff --git a/pkg/client/disk/resize_block_device_responses.go b/pkg/client/disk/resize_block_device_responses.go index b54390e7..237633a5 100644 --- a/pkg/client/disk/resize_block_device_responses.go +++ b/pkg/client/disk/resize_block_device_responses.go @@ -41,7 +41,6 @@ func (o *ResizeBlockDeviceReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewResizeBlockDeviceAccepted() *ResizeBlockDeviceAccepted { return &ResizeBlockDeviceAccepted{} } -/*ResizeBlockDeviceAccepted handles this case with default header values. +/* ResizeBlockDeviceAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ResizeBlockDeviceAccepted struct { func (o *ResizeBlockDeviceAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices/{id}][%d] resizeBlockDeviceAccepted %+v", 202, o.Payload) } - func (o *ResizeBlockDeviceAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewResizeBlockDeviceNoContent() *ResizeBlockDeviceNoContent { return &ResizeBlockDeviceNoContent{} } -/*ResizeBlockDeviceNoContent handles this case with default header values. +/* ResizeBlockDeviceNoContent describes a response with status code 204, with default header values. No Content */ @@ -106,18 +104,29 @@ func NewResizeBlockDeviceForbidden() *ResizeBlockDeviceForbidden { return &ResizeBlockDeviceForbidden{} } -/*ResizeBlockDeviceForbidden handles this case with default header values. +/* ResizeBlockDeviceForbidden describes a response with status code 403, with default header values. Forbidden */ type ResizeBlockDeviceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ResizeBlockDeviceForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}][%d] resizeBlockDeviceForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}][%d] resizeBlockDeviceForbidden %+v", 403, o.Payload) +} +func (o *ResizeBlockDeviceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ResizeBlockDeviceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/disk/revert_disk_snapshot_parameters.go b/pkg/client/disk/revert_disk_snapshot_parameters.go index f6958ced..3c6a5e6c 100644 --- a/pkg/client/disk/revert_disk_snapshot_parameters.go +++ b/pkg/client/disk/revert_disk_snapshot_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevertDiskSnapshotParams creates a new RevertDiskSnapshotParams object -// with the default values initialized. +// NewRevertDiskSnapshotParams creates a new RevertDiskSnapshotParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRevertDiskSnapshotParams() *RevertDiskSnapshotParams { - var () return &RevertDiskSnapshotParams{ - timeout: cr.DefaultTimeout, } } // NewRevertDiskSnapshotParamsWithTimeout creates a new RevertDiskSnapshotParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRevertDiskSnapshotParamsWithTimeout(timeout time.Duration) *RevertDiskSnapshotParams { - var () return &RevertDiskSnapshotParams{ - timeout: timeout, } } // NewRevertDiskSnapshotParamsWithContext creates a new RevertDiskSnapshotParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRevertDiskSnapshotParamsWithContext(ctx context.Context) *RevertDiskSnapshotParams { - var () return &RevertDiskSnapshotParams{ - Context: ctx, } } // NewRevertDiskSnapshotParamsWithHTTPClient creates a new RevertDiskSnapshotParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRevertDiskSnapshotParamsWithHTTPClient(client *http.Client) *RevertDiskSnapshotParams { - var () return &RevertDiskSnapshotParams{ HTTPClient: client, } } -/*RevertDiskSnapshotParams contains all the parameters to send to the API endpoint -for the revert disk snapshot operation typically these are written to a http.Request +/* RevertDiskSnapshotParams contains all the parameters to send to the API endpoint + for the revert disk snapshot operation. + + Typically these are written to a http.Request. */ type RevertDiskSnapshotParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The id of the Disk. + /* ID. + + The id of the Disk. */ PathID string - /*ID - Snapshot id to revert. + /* ID. + + Snapshot id to revert. */ QueryID string @@ -81,6 +82,21 @@ type RevertDiskSnapshotParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the revert disk snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertDiskSnapshotParams) WithDefaults() *RevertDiskSnapshotParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revert disk snapshot params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertDiskSnapshotParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the revert disk snapshot params func (o *RevertDiskSnapshotParams) WithTimeout(timeout time.Duration) *RevertDiskSnapshotParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *RevertDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id @@ -180,6 +197,7 @@ func (o *RevertDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg s qrID := o.QueryID qID := qrID if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/pkg/client/disk/revert_disk_snapshot_responses.go b/pkg/client/disk/revert_disk_snapshot_responses.go index 83c3740e..1924ac55 100644 --- a/pkg/client/disk/revert_disk_snapshot_responses.go +++ b/pkg/client/disk/revert_disk_snapshot_responses.go @@ -41,7 +41,6 @@ func (o *RevertDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewRevertDiskSnapshotAccepted() *RevertDiskSnapshotAccepted { return &RevertDiskSnapshotAccepted{} } -/*RevertDiskSnapshotAccepted handles this case with default header values. +/* RevertDiskSnapshotAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type RevertDiskSnapshotAccepted struct { func (o *RevertDiskSnapshotAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/revert][%d] revertDiskSnapshotAccepted %+v", 202, o.Payload) } - func (o *RevertDiskSnapshotAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewRevertDiskSnapshotForbidden() *RevertDiskSnapshotForbidden { return &RevertDiskSnapshotForbidden{} } -/*RevertDiskSnapshotForbidden handles this case with default header values. +/* RevertDiskSnapshotForbidden describes a response with status code 403, with default header values. Forbidden */ type RevertDiskSnapshotForbidden struct { + Payload *models.ServiceErrorResponse } func (o *RevertDiskSnapshotForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/revert][%d] revertDiskSnapshotForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/revert][%d] revertDiskSnapshotForbidden %+v", 403, o.Payload) +} +func (o *RevertDiskSnapshotForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *RevertDiskSnapshotForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewRevertDiskSnapshotNotFound() *RevertDiskSnapshotNotFound { return &RevertDiskSnapshotNotFound{} } -/*RevertDiskSnapshotNotFound handles this case with default header values. +/* RevertDiskSnapshotNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type RevertDiskSnapshotNotFound struct { func (o *RevertDiskSnapshotNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/block-devices/{id}/operations/revert][%d] revertDiskSnapshotNotFound %+v", 404, o.Payload) } - func (o *RevertDiskSnapshotNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_aws_volume_types/fabricaws_volume_types_client.go b/pkg/client/fabric_aws_volume_types/fabricaws_volume_types_client.go index e743ee41..0d2b082c 100644 --- a/pkg/client/fabric_aws_volume_types/fabricaws_volume_types_client.go +++ b/pkg/client/fabric_aws_volume_types/fabricaws_volume_types_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricAwsVolumeTypes(params *GetFabricAwsVolumeTypesParams) (*GetFabricAwsVolumeTypesOK, error) + GetFabricAwsVolumeTypes(params *GetFabricAwsVolumeTypesParams, opts ...ClientOption) (*GetFabricAwsVolumeTypesOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Get all fabric AWS volume types. */ -func (a *Client) GetFabricAwsVolumeTypes(params *GetFabricAwsVolumeTypesParams) (*GetFabricAwsVolumeTypesOK, error) { +func (a *Client) GetFabricAwsVolumeTypes(params *GetFabricAwsVolumeTypesParams, opts ...ClientOption) (*GetFabricAwsVolumeTypesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricAwsVolumeTypesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricAwsVolumeTypes", Method: "GET", PathPattern: "/iaas/api/fabric-aws-volume-types", @@ -54,7 +56,12 @@ func (a *Client) GetFabricAwsVolumeTypes(params *GetFabricAwsVolumeTypesParams) Reader: &GetFabricAwsVolumeTypesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_parameters.go b/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_parameters.go index ef20fb95..7d329c7c 100644 --- a/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_parameters.go +++ b/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricAwsVolumeTypesParams creates a new GetFabricAwsVolumeTypesParams object -// with the default values initialized. +// NewGetFabricAwsVolumeTypesParams creates a new GetFabricAwsVolumeTypesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricAwsVolumeTypesParams() *GetFabricAwsVolumeTypesParams { - var () return &GetFabricAwsVolumeTypesParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricAwsVolumeTypesParamsWithTimeout creates a new GetFabricAwsVolumeTypesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricAwsVolumeTypesParamsWithTimeout(timeout time.Duration) *GetFabricAwsVolumeTypesParams { - var () return &GetFabricAwsVolumeTypesParams{ - timeout: timeout, } } // NewGetFabricAwsVolumeTypesParamsWithContext creates a new GetFabricAwsVolumeTypesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricAwsVolumeTypesParamsWithContext(ctx context.Context) *GetFabricAwsVolumeTypesParams { - var () return &GetFabricAwsVolumeTypesParams{ - Context: ctx, } } // NewGetFabricAwsVolumeTypesParamsWithHTTPClient creates a new GetFabricAwsVolumeTypesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricAwsVolumeTypesParamsWithHTTPClient(client *http.Client) *GetFabricAwsVolumeTypesParams { - var () return &GetFabricAwsVolumeTypesParams{ HTTPClient: client, } } -/*GetFabricAwsVolumeTypesParams contains all the parameters to send to the API endpoint -for the get fabric aws volume types operation typically these are written to a http.Request +/* GetFabricAwsVolumeTypesParams contains all the parameters to send to the API endpoint + for the get fabric aws volume types operation. + + Typically these are written to a http.Request. */ type GetFabricAwsVolumeTypesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetFabricAwsVolumeTypesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric aws volume types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAwsVolumeTypesParams) WithDefaults() *GetFabricAwsVolumeTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric aws volume types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAwsVolumeTypesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric aws volume types params func (o *GetFabricAwsVolumeTypesParams) WithTimeout(timeout time.Duration) *GetFabricAwsVolumeTypesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetFabricAwsVolumeTypesParams) WriteToRequest(r runtime.ClientRequest, // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_responses.go b/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_responses.go index 7978ceb9..9bdda71e 100644 --- a/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_responses.go +++ b/pkg/client/fabric_aws_volume_types/get_fabric_aws_volume_types_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricAwsVolumeTypesReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricAwsVolumeTypesOK() *GetFabricAwsVolumeTypesOK { return &GetFabricAwsVolumeTypesOK{} } -/*GetFabricAwsVolumeTypesOK handles this case with default header values. +/* GetFabricAwsVolumeTypesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricAwsVolumeTypesOK struct { func (o *GetFabricAwsVolumeTypesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-aws-volume-types][%d] getFabricAwsVolumeTypesOK %+v", 200, o.Payload) } - func (o *GetFabricAwsVolumeTypesOK) GetPayload() *models.VolumeTypeList { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricAwsVolumeTypesForbidden() *GetFabricAwsVolumeTypesForbidden { return &GetFabricAwsVolumeTypesForbidden{} } -/*GetFabricAwsVolumeTypesForbidden handles this case with default header values. +/* GetFabricAwsVolumeTypesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricAwsVolumeTypesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricAwsVolumeTypesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-aws-volume-types][%d] getFabricAwsVolumeTypesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-aws-volume-types][%d] getFabricAwsVolumeTypesForbidden %+v", 403, o.Payload) +} +func (o *GetFabricAwsVolumeTypesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricAwsVolumeTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_azure_storage_account/fabric_azure_storage_account_client.go b/pkg/client/fabric_azure_storage_account/fabric_azure_storage_account_client.go index 76ffccdf..2c8af999 100644 --- a/pkg/client/fabric_azure_storage_account/fabric_azure_storage_account_client.go +++ b/pkg/client/fabric_azure_storage_account/fabric_azure_storage_account_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccountParams) (*GetFabricAzureStorageAccountOK, error) + GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccountParams, opts ...ClientOption) (*GetFabricAzureStorageAccountOK, error) - GetFabricAzureStorageAccounts(params *GetFabricAzureStorageAccountsParams) (*GetFabricAzureStorageAccountsOK, error) + GetFabricAzureStorageAccounts(params *GetFabricAzureStorageAccountsParams, opts ...ClientOption) (*GetFabricAzureStorageAccountsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Get fabric Azure storage account with a given id */ -func (a *Client) GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccountParams) (*GetFabricAzureStorageAccountOK, error) { +func (a *Client) GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccountParams, opts ...ClientOption) (*GetFabricAzureStorageAccountOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricAzureStorageAccountParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricAzureStorageAccount", Method: "GET", PathPattern: "/iaas/api/fabric-azure-storage-accounts/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccou Reader: &GetFabricAzureStorageAccountReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetFabricAzureStorageAccount(params *GetFabricAzureStorageAccou Get all fabric Azure storage accounts. */ -func (a *Client) GetFabricAzureStorageAccounts(params *GetFabricAzureStorageAccountsParams) (*GetFabricAzureStorageAccountsOK, error) { +func (a *Client) GetFabricAzureStorageAccounts(params *GetFabricAzureStorageAccountsParams, opts ...ClientOption) (*GetFabricAzureStorageAccountsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricAzureStorageAccountsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricAzureStorageAccounts", Method: "GET", PathPattern: "/iaas/api/fabric-azure-storage-accounts", @@ -92,7 +98,12 @@ func (a *Client) GetFabricAzureStorageAccounts(params *GetFabricAzureStorageAcco Reader: &GetFabricAzureStorageAccountsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_parameters.go b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_parameters.go index 5bfe6694..aae57fee 100644 --- a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_parameters.go +++ b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricAzureStorageAccountParams creates a new GetFabricAzureStorageAccountParams object -// with the default values initialized. +// NewGetFabricAzureStorageAccountParams creates a new GetFabricAzureStorageAccountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricAzureStorageAccountParams() *GetFabricAzureStorageAccountParams { - var () return &GetFabricAzureStorageAccountParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricAzureStorageAccountParamsWithTimeout creates a new GetFabricAzureStorageAccountParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricAzureStorageAccountParamsWithTimeout(timeout time.Duration) *GetFabricAzureStorageAccountParams { - var () return &GetFabricAzureStorageAccountParams{ - timeout: timeout, } } // NewGetFabricAzureStorageAccountParamsWithContext creates a new GetFabricAzureStorageAccountParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricAzureStorageAccountParamsWithContext(ctx context.Context) *GetFabricAzureStorageAccountParams { - var () return &GetFabricAzureStorageAccountParams{ - Context: ctx, } } // NewGetFabricAzureStorageAccountParamsWithHTTPClient creates a new GetFabricAzureStorageAccountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricAzureStorageAccountParamsWithHTTPClient(client *http.Client) *GetFabricAzureStorageAccountParams { - var () return &GetFabricAzureStorageAccountParams{ HTTPClient: client, } } -/*GetFabricAzureStorageAccountParams contains all the parameters to send to the API endpoint -for the get fabric azure storage account operation typically these are written to a http.Request +/* GetFabricAzureStorageAccountParams contains all the parameters to send to the API endpoint + for the get fabric azure storage account operation. + + Typically these are written to a http.Request. */ type GetFabricAzureStorageAccountParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Fabric Azure Storage Account. + /* ID. + + The ID of the Fabric Azure Storage Account. */ ID string @@ -76,6 +82,21 @@ type GetFabricAzureStorageAccountParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric azure storage account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAzureStorageAccountParams) WithDefaults() *GetFabricAzureStorageAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric azure storage account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAzureStorageAccountParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric azure storage account params func (o *GetFabricAzureStorageAccountParams) WithTimeout(timeout time.Duration) *GetFabricAzureStorageAccountParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetFabricAzureStorageAccountParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get fabric azure storage account params +func (o *GetFabricAzureStorageAccountParams) WithDollarSelect(dollarSelect *string) *GetFabricAzureStorageAccountParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric azure storage account params +func (o *GetFabricAzureStorageAccountParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get fabric azure storage account params func (o *GetFabricAzureStorageAccountParams) WithAPIVersion(aPIVersion *string) *GetFabricAzureStorageAccountParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetFabricAzureStorageAccountParams) WriteToRequest(r runtime.ClientRequ } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_responses.go b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_responses.go index 7a8c3043..ec010c60 100644 --- a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_responses.go +++ b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_account_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricAzureStorageAccountReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricAzureStorageAccountOK() *GetFabricAzureStorageAccountOK { return &GetFabricAzureStorageAccountOK{} } -/*GetFabricAzureStorageAccountOK handles this case with default header values. +/* GetFabricAzureStorageAccountOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricAzureStorageAccountOK struct { func (o *GetFabricAzureStorageAccountOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts/{id}][%d] getFabricAzureStorageAccountOK %+v", 200, o.Payload) } - func (o *GetFabricAzureStorageAccountOK) GetPayload() *models.FabricAzureStorageAccount { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricAzureStorageAccountForbidden() *GetFabricAzureStorageAccountFor return &GetFabricAzureStorageAccountForbidden{} } -/*GetFabricAzureStorageAccountForbidden handles this case with default header values. +/* GetFabricAzureStorageAccountForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricAzureStorageAccountForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricAzureStorageAccountForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts/{id}][%d] getFabricAzureStorageAccountForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts/{id}][%d] getFabricAzureStorageAccountForbidden %+v", 403, o.Payload) +} +func (o *GetFabricAzureStorageAccountForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricAzureStorageAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricAzureStorageAccountNotFound() *GetFabricAzureStorageAccountNotF return &GetFabricAzureStorageAccountNotFound{} } -/*GetFabricAzureStorageAccountNotFound handles this case with default header values. +/* GetFabricAzureStorageAccountNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricAzureStorageAccountNotFound struct { func (o *GetFabricAzureStorageAccountNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts/{id}][%d] getFabricAzureStorageAccountNotFound %+v", 404, o.Payload) } - func (o *GetFabricAzureStorageAccountNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_parameters.go b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_parameters.go index a1f582ab..bcd04f8c 100644 --- a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_parameters.go +++ b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricAzureStorageAccountsParams creates a new GetFabricAzureStorageAccountsParams object -// with the default values initialized. +// NewGetFabricAzureStorageAccountsParams creates a new GetFabricAzureStorageAccountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricAzureStorageAccountsParams() *GetFabricAzureStorageAccountsParams { - var () return &GetFabricAzureStorageAccountsParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricAzureStorageAccountsParamsWithTimeout creates a new GetFabricAzureStorageAccountsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricAzureStorageAccountsParamsWithTimeout(timeout time.Duration) *GetFabricAzureStorageAccountsParams { - var () return &GetFabricAzureStorageAccountsParams{ - timeout: timeout, } } // NewGetFabricAzureStorageAccountsParamsWithContext creates a new GetFabricAzureStorageAccountsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricAzureStorageAccountsParamsWithContext(ctx context.Context) *GetFabricAzureStorageAccountsParams { - var () return &GetFabricAzureStorageAccountsParams{ - Context: ctx, } } // NewGetFabricAzureStorageAccountsParamsWithHTTPClient creates a new GetFabricAzureStorageAccountsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricAzureStorageAccountsParamsWithHTTPClient(client *http.Client) *GetFabricAzureStorageAccountsParams { - var () return &GetFabricAzureStorageAccountsParams{ HTTPClient: client, } } -/*GetFabricAzureStorageAccountsParams contains all the parameters to send to the API endpoint -for the get fabric azure storage accounts operation typically these are written to a http.Request +/* GetFabricAzureStorageAccountsParams contains all the parameters to send to the API endpoint + for the get fabric azure storage accounts operation. + + Typically these are written to a http.Request. */ type GetFabricAzureStorageAccountsParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetFabricAzureStorageAccountsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric azure storage accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAzureStorageAccountsParams) WithDefaults() *GetFabricAzureStorageAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric azure storage accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricAzureStorageAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric azure storage accounts params func (o *GetFabricAzureStorageAccountsParams) WithTimeout(timeout time.Duration) *GetFabricAzureStorageAccountsParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetFabricAzureStorageAccountsParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) WithDollarCount(dollarCount *bool) *GetFabricAzureStorageAccountsParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric azure storage accounts params func (o *GetFabricAzureStorageAccountsParams) WithDollarFilter(dollarFilter *string) *GetFabricAzureStorageAccountsParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetFabricAzureStorageAccountsParams) SetDollarFilter(dollarFilter *stri o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) WithDollarSelect(dollarSelect *string) *GetFabricAzureStorageAccountsParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) WithDollarSkip(dollarSkip *int64) *GetFabricAzureStorageAccountsParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) WithDollarTop(dollarTop *int64) *GetFabricAzureStorageAccountsParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric azure storage accounts params +func (o *GetFabricAzureStorageAccountsParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric azure storage accounts params func (o *GetFabricAzureStorageAccountsParams) WithAPIVersion(aPIVersion *string) *GetFabricAzureStorageAccountsParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetFabricAzureStorageAccountsParams) WriteToRequest(r runtime.ClientReq } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_responses.go b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_responses.go index 6d725b43..c1ec639e 100644 --- a/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_responses.go +++ b/pkg/client/fabric_azure_storage_account/get_fabric_azure_storage_accounts_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricAzureStorageAccountsReader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricAzureStorageAccountsOK() *GetFabricAzureStorageAccountsOK { return &GetFabricAzureStorageAccountsOK{} } -/*GetFabricAzureStorageAccountsOK handles this case with default header values. +/* GetFabricAzureStorageAccountsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricAzureStorageAccountsOK struct { func (o *GetFabricAzureStorageAccountsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts][%d] getFabricAzureStorageAccountsOK %+v", 200, o.Payload) } - func (o *GetFabricAzureStorageAccountsOK) GetPayload() *models.FabricAzureStorageAccountResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricAzureStorageAccountsForbidden() *GetFabricAzureStorageAccountsF return &GetFabricAzureStorageAccountsForbidden{} } -/*GetFabricAzureStorageAccountsForbidden handles this case with default header values. +/* GetFabricAzureStorageAccountsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricAzureStorageAccountsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricAzureStorageAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts][%d] getFabricAzureStorageAccountsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-azure-storage-accounts][%d] getFabricAzureStorageAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetFabricAzureStorageAccountsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricAzureStorageAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_compute/fabric_compute_client.go b/pkg/client/fabric_compute/fabric_compute_client.go index 451b9189..eb51f055 100644 --- a/pkg/client/fabric_compute/fabric_compute_client.go +++ b/pkg/client/fabric_compute/fabric_compute_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricCompute(params *GetFabricComputeParams) (*GetFabricComputeOK, error) + GetFabricCompute(params *GetFabricComputeParams, opts ...ClientOption) (*GetFabricComputeOK, error) - GetFabricComputes(params *GetFabricComputesParams) (*GetFabricComputesOK, error) + GetFabricComputes(params *GetFabricComputesParams, opts ...ClientOption) (*GetFabricComputesOK, error) - UpdateFabricCompute(params *UpdateFabricComputeParams) (*UpdateFabricComputeOK, error) + UpdateFabricCompute(params *UpdateFabricComputeParams, opts ...ClientOption) (*UpdateFabricComputeOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Get fabric compute with a given id */ -func (a *Client) GetFabricCompute(params *GetFabricComputeParams) (*GetFabricComputeOK, error) { +func (a *Client) GetFabricCompute(params *GetFabricComputeParams, opts ...ClientOption) (*GetFabricComputeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricComputeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricCompute", Method: "GET", PathPattern: "/iaas/api/fabric-computes/{id}", @@ -58,7 +60,12 @@ func (a *Client) GetFabricCompute(params *GetFabricComputeParams) (*GetFabricCom Reader: &GetFabricComputeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) GetFabricCompute(params *GetFabricComputeParams) (*GetFabricCom Get all fabric computes. */ -func (a *Client) GetFabricComputes(params *GetFabricComputesParams) (*GetFabricComputesOK, error) { +func (a *Client) GetFabricComputes(params *GetFabricComputesParams, opts ...ClientOption) (*GetFabricComputesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricComputesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricComputes", Method: "GET", PathPattern: "/iaas/api/fabric-computes", @@ -94,7 +100,12 @@ func (a *Client) GetFabricComputes(params *GetFabricComputesParams) (*GetFabricC Reader: &GetFabricComputesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) GetFabricComputes(params *GetFabricComputesParams) (*GetFabricC Update fabric compute. Only tag updates are supported. */ -func (a *Client) UpdateFabricCompute(params *UpdateFabricComputeParams) (*UpdateFabricComputeOK, error) { +func (a *Client) UpdateFabricCompute(params *UpdateFabricComputeParams, opts ...ClientOption) (*UpdateFabricComputeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateFabricComputeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateFabricCompute", Method: "PATCH", PathPattern: "/iaas/api/fabric-computes/{id}", @@ -130,7 +140,12 @@ func (a *Client) UpdateFabricCompute(params *UpdateFabricComputeParams) (*Update Reader: &UpdateFabricComputeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_compute/get_fabric_compute_parameters.go b/pkg/client/fabric_compute/get_fabric_compute_parameters.go index 2e9bde03..d1543182 100644 --- a/pkg/client/fabric_compute/get_fabric_compute_parameters.go +++ b/pkg/client/fabric_compute/get_fabric_compute_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricComputeParams creates a new GetFabricComputeParams object -// with the default values initialized. +// NewGetFabricComputeParams creates a new GetFabricComputeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricComputeParams() *GetFabricComputeParams { - var () return &GetFabricComputeParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricComputeParamsWithTimeout creates a new GetFabricComputeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricComputeParamsWithTimeout(timeout time.Duration) *GetFabricComputeParams { - var () return &GetFabricComputeParams{ - timeout: timeout, } } // NewGetFabricComputeParamsWithContext creates a new GetFabricComputeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricComputeParamsWithContext(ctx context.Context) *GetFabricComputeParams { - var () return &GetFabricComputeParams{ - Context: ctx, } } // NewGetFabricComputeParamsWithHTTPClient creates a new GetFabricComputeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricComputeParamsWithHTTPClient(client *http.Client) *GetFabricComputeParams { - var () return &GetFabricComputeParams{ HTTPClient: client, } } -/*GetFabricComputeParams contains all the parameters to send to the API endpoint -for the get fabric compute operation typically these are written to a http.Request +/* GetFabricComputeParams contains all the parameters to send to the API endpoint + for the get fabric compute operation. + + Typically these are written to a http.Request. */ type GetFabricComputeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the fabric compute. + /* ID. + + The ID of the fabric compute. */ ID string @@ -76,6 +76,21 @@ type GetFabricComputeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric compute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricComputeParams) WithDefaults() *GetFabricComputeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric compute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricComputeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric compute params func (o *GetFabricComputeParams) WithTimeout(timeout time.Duration) *GetFabricComputeParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetFabricComputeParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_compute/get_fabric_compute_responses.go b/pkg/client/fabric_compute/get_fabric_compute_responses.go index e3b755a7..9ff279ac 100644 --- a/pkg/client/fabric_compute/get_fabric_compute_responses.go +++ b/pkg/client/fabric_compute/get_fabric_compute_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricComputeReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricComputeOK() *GetFabricComputeOK { return &GetFabricComputeOK{} } -/*GetFabricComputeOK handles this case with default header values. +/* GetFabricComputeOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricComputeOK struct { func (o *GetFabricComputeOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-computes/{id}][%d] getFabricComputeOK %+v", 200, o.Payload) } - func (o *GetFabricComputeOK) GetPayload() *models.FabricCompute { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricComputeForbidden() *GetFabricComputeForbidden { return &GetFabricComputeForbidden{} } -/*GetFabricComputeForbidden handles this case with default header values. +/* GetFabricComputeForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricComputeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricComputeForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-computes/{id}][%d] getFabricComputeForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-computes/{id}][%d] getFabricComputeForbidden %+v", 403, o.Payload) +} +func (o *GetFabricComputeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricComputeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricComputeNotFound() *GetFabricComputeNotFound { return &GetFabricComputeNotFound{} } -/*GetFabricComputeNotFound handles this case with default header values. +/* GetFabricComputeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricComputeNotFound struct { func (o *GetFabricComputeNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-computes/{id}][%d] getFabricComputeNotFound %+v", 404, o.Payload) } - func (o *GetFabricComputeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_compute/get_fabric_computes_parameters.go b/pkg/client/fabric_compute/get_fabric_computes_parameters.go index d7ecc286..8a139d67 100644 --- a/pkg/client/fabric_compute/get_fabric_computes_parameters.go +++ b/pkg/client/fabric_compute/get_fabric_computes_parameters.go @@ -14,60 +14,79 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricComputesParams creates a new GetFabricComputesParams object -// with the default values initialized. +// NewGetFabricComputesParams creates a new GetFabricComputesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricComputesParams() *GetFabricComputesParams { - var () return &GetFabricComputesParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricComputesParamsWithTimeout creates a new GetFabricComputesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricComputesParamsWithTimeout(timeout time.Duration) *GetFabricComputesParams { - var () return &GetFabricComputesParams{ - timeout: timeout, } } // NewGetFabricComputesParamsWithContext creates a new GetFabricComputesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricComputesParamsWithContext(ctx context.Context) *GetFabricComputesParams { - var () return &GetFabricComputesParams{ - Context: ctx, } } // NewGetFabricComputesParamsWithHTTPClient creates a new GetFabricComputesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricComputesParamsWithHTTPClient(client *http.Client) *GetFabricComputesParams { - var () return &GetFabricComputesParams{ HTTPClient: client, } } -/*GetFabricComputesParams contains all the parameters to send to the API endpoint -for the get fabric computes operation typically these are written to a http.Request +/* GetFabricComputesParams contains all the parameters to send to the API endpoint + for the get fabric computes operation. + + Typically these are written to a http.Request. */ type GetFabricComputesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +95,21 @@ type GetFabricComputesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric computes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricComputesParams) WithDefaults() *GetFabricComputesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric computes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricComputesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric computes params func (o *GetFabricComputesParams) WithTimeout(timeout time.Duration) *GetFabricComputesParams { o.SetTimeout(timeout) @@ -109,6 +143,17 @@ func (o *GetFabricComputesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric computes params +func (o *GetFabricComputesParams) WithDollarCount(dollarCount *bool) *GetFabricComputesParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric computes params +func (o *GetFabricComputesParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric computes params func (o *GetFabricComputesParams) WithDollarFilter(dollarFilter *string) *GetFabricComputesParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +165,28 @@ func (o *GetFabricComputesParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarSkip adds the dollarSkip to the get fabric computes params +func (o *GetFabricComputesParams) WithDollarSkip(dollarSkip *int64) *GetFabricComputesParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric computes params +func (o *GetFabricComputesParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric computes params +func (o *GetFabricComputesParams) WithDollarTop(dollarTop *int64) *GetFabricComputesParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric computes params +func (o *GetFabricComputesParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric computes params func (o *GetFabricComputesParams) WithAPIVersion(aPIVersion *string) *GetFabricComputesParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +206,89 @@ func (o *GetFabricComputesParams) WriteToRequest(r runtime.ClientRequest, reg st } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_compute/get_fabric_computes_responses.go b/pkg/client/fabric_compute/get_fabric_computes_responses.go index 28607f41..6b666a7c 100644 --- a/pkg/client/fabric_compute/get_fabric_computes_responses.go +++ b/pkg/client/fabric_compute/get_fabric_computes_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricComputesReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricComputesOK() *GetFabricComputesOK { return &GetFabricComputesOK{} } -/*GetFabricComputesOK handles this case with default header values. +/* GetFabricComputesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricComputesOK struct { func (o *GetFabricComputesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-computes][%d] getFabricComputesOK %+v", 200, o.Payload) } - func (o *GetFabricComputesOK) GetPayload() *models.FabricComputeResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricComputesForbidden() *GetFabricComputesForbidden { return &GetFabricComputesForbidden{} } -/*GetFabricComputesForbidden handles this case with default header values. +/* GetFabricComputesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricComputesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricComputesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-computes][%d] getFabricComputesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-computes][%d] getFabricComputesForbidden %+v", 403, o.Payload) +} +func (o *GetFabricComputesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricComputesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_compute/update_fabric_compute_parameters.go b/pkg/client/fabric_compute/update_fabric_compute_parameters.go index b17093f5..b7ea057c 100644 --- a/pkg/client/fabric_compute/update_fabric_compute_parameters.go +++ b/pkg/client/fabric_compute/update_fabric_compute_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateFabricComputeParams creates a new UpdateFabricComputeParams object -// with the default values initialized. +// NewUpdateFabricComputeParams creates a new UpdateFabricComputeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateFabricComputeParams() *UpdateFabricComputeParams { - var () return &UpdateFabricComputeParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateFabricComputeParamsWithTimeout creates a new UpdateFabricComputeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateFabricComputeParamsWithTimeout(timeout time.Duration) *UpdateFabricComputeParams { - var () return &UpdateFabricComputeParams{ - timeout: timeout, } } // NewUpdateFabricComputeParamsWithContext creates a new UpdateFabricComputeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateFabricComputeParamsWithContext(ctx context.Context) *UpdateFabricComputeParams { - var () return &UpdateFabricComputeParams{ - Context: ctx, } } // NewUpdateFabricComputeParamsWithHTTPClient creates a new UpdateFabricComputeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateFabricComputeParamsWithHTTPClient(client *http.Client) *UpdateFabricComputeParams { - var () return &UpdateFabricComputeParams{ HTTPClient: client, } } -/*UpdateFabricComputeParams contains all the parameters to send to the API endpoint -for the update fabric compute operation typically these are written to a http.Request +/* UpdateFabricComputeParams contains all the parameters to send to the API endpoint + for the update fabric compute operation. + + Typically these are written to a http.Request. */ type UpdateFabricComputeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Fabric Compute Specification + /* Body. + + Fabric Compute Specification */ Body *models.FabricComputeSpecification - /*ID - The ID of the Fabric Compute. + /* ID. + + The ID of the Fabric Compute. */ ID string @@ -83,6 +84,21 @@ type UpdateFabricComputeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update fabric compute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFabricComputeParams) WithDefaults() *UpdateFabricComputeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update fabric compute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFabricComputeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update fabric compute params func (o *UpdateFabricComputeParams) WithTimeout(timeout time.Duration) *UpdateFabricComputeParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateFabricComputeParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/fabric_compute/update_fabric_compute_responses.go b/pkg/client/fabric_compute/update_fabric_compute_responses.go index 95d703ae..6ad27f8a 100644 --- a/pkg/client/fabric_compute/update_fabric_compute_responses.go +++ b/pkg/client/fabric_compute/update_fabric_compute_responses.go @@ -41,7 +41,6 @@ func (o *UpdateFabricComputeReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateFabricComputeOK() *UpdateFabricComputeOK { return &UpdateFabricComputeOK{} } -/*UpdateFabricComputeOK handles this case with default header values. +/* UpdateFabricComputeOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateFabricComputeOK struct { func (o *UpdateFabricComputeOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-computes/{id}][%d] updateFabricComputeOK %+v", 200, o.Payload) } - func (o *UpdateFabricComputeOK) GetPayload() *models.FabricCompute { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateFabricComputeForbidden() *UpdateFabricComputeForbidden { return &UpdateFabricComputeForbidden{} } -/*UpdateFabricComputeForbidden handles this case with default header values. +/* UpdateFabricComputeForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateFabricComputeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateFabricComputeForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/fabric-computes/{id}][%d] updateFabricComputeForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/fabric-computes/{id}][%d] updateFabricComputeForbidden %+v", 403, o.Payload) +} +func (o *UpdateFabricComputeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateFabricComputeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateFabricComputeNotFound() *UpdateFabricComputeNotFound { return &UpdateFabricComputeNotFound{} } -/*UpdateFabricComputeNotFound handles this case with default header values. +/* UpdateFabricComputeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateFabricComputeNotFound struct { func (o *UpdateFabricComputeNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-computes/{id}][%d] updateFabricComputeNotFound %+v", 404, o.Payload) } - func (o *UpdateFabricComputeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_flavors/fabric_flavors_client.go b/pkg/client/fabric_flavors/fabric_flavors_client.go index c25ba5c0..7bd1a4b0 100644 --- a/pkg/client/fabric_flavors/fabric_flavors_client.go +++ b/pkg/client/fabric_flavors/fabric_flavors_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricFlavors(params *GetFabricFlavorsParams) (*GetFabricFlavorsOK, error) + GetFabricFlavors(params *GetFabricFlavorsParams, opts ...ClientOption) (*GetFabricFlavorsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Get all fabric flavors */ -func (a *Client) GetFabricFlavors(params *GetFabricFlavorsParams) (*GetFabricFlavorsOK, error) { +func (a *Client) GetFabricFlavors(params *GetFabricFlavorsParams, opts ...ClientOption) (*GetFabricFlavorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricFlavorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricFlavors", Method: "GET", PathPattern: "/iaas/api/fabric-flavors", @@ -54,7 +56,12 @@ func (a *Client) GetFabricFlavors(params *GetFabricFlavorsParams) (*GetFabricFla Reader: &GetFabricFlavorsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_flavors/get_fabric_flavors_parameters.go b/pkg/client/fabric_flavors/get_fabric_flavors_parameters.go index aa496144..281c99c8 100644 --- a/pkg/client/fabric_flavors/get_fabric_flavors_parameters.go +++ b/pkg/client/fabric_flavors/get_fabric_flavors_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricFlavorsParams creates a new GetFabricFlavorsParams object -// with the default values initialized. +// NewGetFabricFlavorsParams creates a new GetFabricFlavorsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricFlavorsParams() *GetFabricFlavorsParams { - var () return &GetFabricFlavorsParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricFlavorsParamsWithTimeout creates a new GetFabricFlavorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricFlavorsParamsWithTimeout(timeout time.Duration) *GetFabricFlavorsParams { - var () return &GetFabricFlavorsParams{ - timeout: timeout, } } // NewGetFabricFlavorsParamsWithContext creates a new GetFabricFlavorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricFlavorsParamsWithContext(ctx context.Context) *GetFabricFlavorsParams { - var () return &GetFabricFlavorsParams{ - Context: ctx, } } // NewGetFabricFlavorsParamsWithHTTPClient creates a new GetFabricFlavorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricFlavorsParamsWithHTTPClient(client *http.Client) *GetFabricFlavorsParams { - var () return &GetFabricFlavorsParams{ HTTPClient: client, } } -/*GetFabricFlavorsParams contains all the parameters to send to the API endpoint -for the get fabric flavors operation typically these are written to a http.Request +/* GetFabricFlavorsParams contains all the parameters to send to the API endpoint + for the get fabric flavors operation. + + Typically these are written to a http.Request. */ type GetFabricFlavorsParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetFabricFlavorsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric flavors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricFlavorsParams) WithDefaults() *GetFabricFlavorsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric flavors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricFlavorsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric flavors params func (o *GetFabricFlavorsParams) WithTimeout(timeout time.Duration) *GetFabricFlavorsParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetFabricFlavorsParams) WriteToRequest(r runtime.ClientRequest, reg str // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_flavors/get_fabric_flavors_responses.go b/pkg/client/fabric_flavors/get_fabric_flavors_responses.go index 0c706b39..a1470d08 100644 --- a/pkg/client/fabric_flavors/get_fabric_flavors_responses.go +++ b/pkg/client/fabric_flavors/get_fabric_flavors_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricFlavorsReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricFlavorsOK() *GetFabricFlavorsOK { return &GetFabricFlavorsOK{} } -/*GetFabricFlavorsOK handles this case with default header values. +/* GetFabricFlavorsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricFlavorsOK struct { func (o *GetFabricFlavorsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-flavors][%d] getFabricFlavorsOK %+v", 200, o.Payload) } - func (o *GetFabricFlavorsOK) GetPayload() *models.FabricFlavorResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricFlavorsForbidden() *GetFabricFlavorsForbidden { return &GetFabricFlavorsForbidden{} } -/*GetFabricFlavorsForbidden handles this case with default header values. +/* GetFabricFlavorsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricFlavorsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricFlavorsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-flavors][%d] getFabricFlavorsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-flavors][%d] getFabricFlavorsForbidden %+v", 403, o.Payload) +} +func (o *GetFabricFlavorsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricFlavorsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_images/fabric_images_client.go b/pkg/client/fabric_images/fabric_images_client.go index 219cf28e..8b0cce73 100644 --- a/pkg/client/fabric_images/fabric_images_client.go +++ b/pkg/client/fabric_images/fabric_images_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricImage(params *GetFabricImageParams) (*GetFabricImageOK, error) + GetFabricImage(params *GetFabricImageParams, opts ...ClientOption) (*GetFabricImageOK, error) - GetFabricImages(params *GetFabricImagesParams) (*GetFabricImagesOK, error) + GetFabricImages(params *GetFabricImagesParams, opts ...ClientOption) (*GetFabricImagesOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Get fabric image with a given id */ -func (a *Client) GetFabricImage(params *GetFabricImageParams) (*GetFabricImageOK, error) { +func (a *Client) GetFabricImage(params *GetFabricImageParams, opts ...ClientOption) (*GetFabricImageOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricImageParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricImage", Method: "GET", PathPattern: "/iaas/api/fabric-images/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetFabricImage(params *GetFabricImageParams) (*GetFabricImageOK Reader: &GetFabricImageReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetFabricImage(params *GetFabricImageParams) (*GetFabricImageOK Get all fabric images */ -func (a *Client) GetFabricImages(params *GetFabricImagesParams) (*GetFabricImagesOK, error) { +func (a *Client) GetFabricImages(params *GetFabricImagesParams, opts ...ClientOption) (*GetFabricImagesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricImagesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricImages", Method: "GET", PathPattern: "/iaas/api/fabric-images", @@ -92,7 +98,12 @@ func (a *Client) GetFabricImages(params *GetFabricImagesParams) (*GetFabricImage Reader: &GetFabricImagesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_images/get_fabric_image_parameters.go b/pkg/client/fabric_images/get_fabric_image_parameters.go index 1b472e56..c92bc5ad 100644 --- a/pkg/client/fabric_images/get_fabric_image_parameters.go +++ b/pkg/client/fabric_images/get_fabric_image_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricImageParams creates a new GetFabricImageParams object -// with the default values initialized. +// NewGetFabricImageParams creates a new GetFabricImageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricImageParams() *GetFabricImageParams { - var () return &GetFabricImageParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricImageParamsWithTimeout creates a new GetFabricImageParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricImageParamsWithTimeout(timeout time.Duration) *GetFabricImageParams { - var () return &GetFabricImageParams{ - timeout: timeout, } } // NewGetFabricImageParamsWithContext creates a new GetFabricImageParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricImageParamsWithContext(ctx context.Context) *GetFabricImageParams { - var () return &GetFabricImageParams{ - Context: ctx, } } // NewGetFabricImageParamsWithHTTPClient creates a new GetFabricImageParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricImageParamsWithHTTPClient(client *http.Client) *GetFabricImageParams { - var () return &GetFabricImageParams{ HTTPClient: client, } } -/*GetFabricImageParams contains all the parameters to send to the API endpoint -for the get fabric image operation typically these are written to a http.Request +/* GetFabricImageParams contains all the parameters to send to the API endpoint + for the get fabric image operation. + + Typically these are written to a http.Request. */ type GetFabricImageParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the image. + /* ID. + + The ID of the image. */ ID string @@ -76,6 +82,21 @@ type GetFabricImageParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricImageParams) WithDefaults() *GetFabricImageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricImageParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric image params func (o *GetFabricImageParams) WithTimeout(timeout time.Duration) *GetFabricImageParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetFabricImageParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get fabric image params +func (o *GetFabricImageParams) WithDollarSelect(dollarSelect *string) *GetFabricImageParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric image params +func (o *GetFabricImageParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get fabric image params func (o *GetFabricImageParams) WithAPIVersion(aPIVersion *string) *GetFabricImageParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetFabricImageParams) WriteToRequest(r runtime.ClientRequest, reg strfm } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_images/get_fabric_image_responses.go b/pkg/client/fabric_images/get_fabric_image_responses.go index a5816b3b..8d4cb319 100644 --- a/pkg/client/fabric_images/get_fabric_image_responses.go +++ b/pkg/client/fabric_images/get_fabric_image_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricImageReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricImageOK() *GetFabricImageOK { return &GetFabricImageOK{} } -/*GetFabricImageOK handles this case with default header values. +/* GetFabricImageOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricImageOK struct { func (o *GetFabricImageOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-images/{id}][%d] getFabricImageOK %+v", 200, o.Payload) } - func (o *GetFabricImageOK) GetPayload() *models.FabricImage { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricImageForbidden() *GetFabricImageForbidden { return &GetFabricImageForbidden{} } -/*GetFabricImageForbidden handles this case with default header values. +/* GetFabricImageForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricImageForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricImageForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-images/{id}][%d] getFabricImageForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-images/{id}][%d] getFabricImageForbidden %+v", 403, o.Payload) +} +func (o *GetFabricImageForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricImageForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricImageNotFound() *GetFabricImageNotFound { return &GetFabricImageNotFound{} } -/*GetFabricImageNotFound handles this case with default header values. +/* GetFabricImageNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricImageNotFound struct { func (o *GetFabricImageNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-images/{id}][%d] getFabricImageNotFound %+v", 404, o.Payload) } - func (o *GetFabricImageNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_images/get_fabric_images_parameters.go b/pkg/client/fabric_images/get_fabric_images_parameters.go index 2c8f2f47..991c1bf3 100644 --- a/pkg/client/fabric_images/get_fabric_images_parameters.go +++ b/pkg/client/fabric_images/get_fabric_images_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricImagesParams creates a new GetFabricImagesParams object -// with the default values initialized. +// NewGetFabricImagesParams creates a new GetFabricImagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricImagesParams() *GetFabricImagesParams { - var () return &GetFabricImagesParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricImagesParamsWithTimeout creates a new GetFabricImagesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricImagesParamsWithTimeout(timeout time.Duration) *GetFabricImagesParams { - var () return &GetFabricImagesParams{ - timeout: timeout, } } // NewGetFabricImagesParamsWithContext creates a new GetFabricImagesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricImagesParamsWithContext(ctx context.Context) *GetFabricImagesParams { - var () return &GetFabricImagesParams{ - Context: ctx, } } // NewGetFabricImagesParamsWithHTTPClient creates a new GetFabricImagesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricImagesParamsWithHTTPClient(client *http.Client) *GetFabricImagesParams { - var () return &GetFabricImagesParams{ HTTPClient: client, } } -/*GetFabricImagesParams contains all the parameters to send to the API endpoint -for the get fabric images operation typically these are written to a http.Request +/* GetFabricImagesParams contains all the parameters to send to the API endpoint + for the get fabric images operation. + + Typically these are written to a http.Request. */ type GetFabricImagesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetFabricImagesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricImagesParams) WithDefaults() *GetFabricImagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricImagesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric images params func (o *GetFabricImagesParams) WithTimeout(timeout time.Duration) *GetFabricImagesParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetFabricImagesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric images params +func (o *GetFabricImagesParams) WithDollarCount(dollarCount *bool) *GetFabricImagesParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric images params +func (o *GetFabricImagesParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric images params func (o *GetFabricImagesParams) WithDollarFilter(dollarFilter *string) *GetFabricImagesParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetFabricImagesParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get fabric images params +func (o *GetFabricImagesParams) WithDollarSelect(dollarSelect *string) *GetFabricImagesParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric images params +func (o *GetFabricImagesParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get fabric images params +func (o *GetFabricImagesParams) WithDollarSkip(dollarSkip *int64) *GetFabricImagesParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric images params +func (o *GetFabricImagesParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric images params +func (o *GetFabricImagesParams) WithDollarTop(dollarTop *int64) *GetFabricImagesParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric images params +func (o *GetFabricImagesParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric images params func (o *GetFabricImagesParams) WithAPIVersion(aPIVersion *string) *GetFabricImagesParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetFabricImagesParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_images/get_fabric_images_responses.go b/pkg/client/fabric_images/get_fabric_images_responses.go index 5d35e14c..bf3b676a 100644 --- a/pkg/client/fabric_images/get_fabric_images_responses.go +++ b/pkg/client/fabric_images/get_fabric_images_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricImagesReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricImagesOK() *GetFabricImagesOK { return &GetFabricImagesOK{} } -/*GetFabricImagesOK handles this case with default header values. +/* GetFabricImagesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricImagesOK struct { func (o *GetFabricImagesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-images][%d] getFabricImagesOK %+v", 200, o.Payload) } - func (o *GetFabricImagesOK) GetPayload() *models.FabricImageResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricImagesForbidden() *GetFabricImagesForbidden { return &GetFabricImagesForbidden{} } -/*GetFabricImagesForbidden handles this case with default header values. +/* GetFabricImagesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricImagesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricImagesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-images][%d] getFabricImagesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-images][%d] getFabricImagesForbidden %+v", 403, o.Payload) +} +func (o *GetFabricImagesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricImagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_network/fabric_network_client.go b/pkg/client/fabric_network/fabric_network_client.go index 7c7ca3c8..467a2848 100644 --- a/pkg/client/fabric_network/fabric_network_client.go +++ b/pkg/client/fabric_network/fabric_network_client.go @@ -25,19 +25,22 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricNetwork(params *GetFabricNetworkParams) (*GetFabricNetworkOK, error) + GetFabricNetwork(params *GetFabricNetworkParams, opts ...ClientOption) (*GetFabricNetworkOK, error) - GetFabricNetworks(params *GetFabricNetworksParams) (*GetFabricNetworksOK, error) + GetFabricNetworks(params *GetFabricNetworksParams, opts ...ClientOption) (*GetFabricNetworksOK, error) - GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams) (*GetVsphereFabricNetworkOK, error) + GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams, opts ...ClientOption) (*GetVsphereFabricNetworkOK, error) - GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams) (*GetVsphereFabricNetworksOK, error) + GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams, opts ...ClientOption) (*GetVsphereFabricNetworksOK, error) - UpdateFabricNetwork(params *UpdateFabricNetworkParams) (*UpdateFabricNetworkOK, error) + UpdateFabricNetwork(params *UpdateFabricNetworkParams, opts ...ClientOption) (*UpdateFabricNetworkOK, error) - UpdatevSphereFabricNetwork(params *UpdatevSphereFabricNetworkParams) (*UpdatevSphereFabricNetworkOK, error) + UpdatevSphereFabricNetwork(params *UpdatevSphereFabricNetworkParams, opts ...ClientOption) (*UpdatevSphereFabricNetworkOK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +50,12 @@ type ClientService interface { Get fabric network with a given id */ -func (a *Client) GetFabricNetwork(params *GetFabricNetworkParams) (*GetFabricNetworkOK, error) { +func (a *Client) GetFabricNetwork(params *GetFabricNetworkParams, opts ...ClientOption) (*GetFabricNetworkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricNetwork", Method: "GET", PathPattern: "/iaas/api/fabric-networks/{id}", @@ -64,7 +66,12 @@ func (a *Client) GetFabricNetwork(params *GetFabricNetworkParams) (*GetFabricNet Reader: &GetFabricNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -83,13 +90,12 @@ func (a *Client) GetFabricNetwork(params *GetFabricNetworkParams) (*GetFabricNet Get all fabric networks. */ -func (a *Client) GetFabricNetworks(params *GetFabricNetworksParams) (*GetFabricNetworksOK, error) { +func (a *Client) GetFabricNetworks(params *GetFabricNetworksParams, opts ...ClientOption) (*GetFabricNetworksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricNetworksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricNetworks", Method: "GET", PathPattern: "/iaas/api/fabric-networks", @@ -100,7 +106,12 @@ func (a *Client) GetFabricNetworks(params *GetFabricNetworksParams) (*GetFabricN Reader: &GetFabricNetworksReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -119,13 +130,12 @@ func (a *Client) GetFabricNetworks(params *GetFabricNetworksParams) (*GetFabricN Get vSphere fabric network with a given id */ -func (a *Client) GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams) (*GetVsphereFabricNetworkOK, error) { +func (a *Client) GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams, opts ...ClientOption) (*GetVsphereFabricNetworkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVsphereFabricNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVsphereFabricNetwork", Method: "GET", PathPattern: "/iaas/api/fabric-networks-vsphere/{id}", @@ -136,7 +146,12 @@ func (a *Client) GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams) Reader: &GetVsphereFabricNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -155,13 +170,12 @@ func (a *Client) GetVsphereFabricNetwork(params *GetVsphereFabricNetworkParams) Get all vSphere fabric networks. */ -func (a *Client) GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams) (*GetVsphereFabricNetworksOK, error) { +func (a *Client) GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams, opts ...ClientOption) (*GetVsphereFabricNetworksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVsphereFabricNetworksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVsphereFabricNetworks", Method: "GET", PathPattern: "/iaas/api/fabric-networks-vsphere", @@ -172,7 +186,12 @@ func (a *Client) GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams Reader: &GetVsphereFabricNetworksReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -191,13 +210,12 @@ func (a *Client) GetVsphereFabricNetworks(params *GetVsphereFabricNetworksParams Update fabric network. Only tag updates are supported. */ -func (a *Client) UpdateFabricNetwork(params *UpdateFabricNetworkParams) (*UpdateFabricNetworkOK, error) { +func (a *Client) UpdateFabricNetwork(params *UpdateFabricNetworkParams, opts ...ClientOption) (*UpdateFabricNetworkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateFabricNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateFabricNetwork", Method: "PATCH", PathPattern: "/iaas/api/fabric-networks/{id}", @@ -208,7 +226,12 @@ func (a *Client) UpdateFabricNetwork(params *UpdateFabricNetworkParams) (*Update Reader: &UpdateFabricNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -227,13 +250,12 @@ func (a *Client) UpdateFabricNetwork(params *UpdateFabricNetworkParams) (*Update Update vSphere fabric network. */ -func (a *Client) UpdatevSphereFabricNetwork(params *UpdatevSphereFabricNetworkParams) (*UpdatevSphereFabricNetworkOK, error) { +func (a *Client) UpdatevSphereFabricNetwork(params *UpdatevSphereFabricNetworkParams, opts ...ClientOption) (*UpdatevSphereFabricNetworkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdatevSphereFabricNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updatevSphereFabricNetwork", Method: "PATCH", PathPattern: "/iaas/api/fabric-networks-vsphere/{id}", @@ -244,7 +266,12 @@ func (a *Client) UpdatevSphereFabricNetwork(params *UpdatevSphereFabricNetworkPa Reader: &UpdatevSphereFabricNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_network/get_fabric_network_parameters.go b/pkg/client/fabric_network/get_fabric_network_parameters.go index 869865e1..3e56f8cb 100644 --- a/pkg/client/fabric_network/get_fabric_network_parameters.go +++ b/pkg/client/fabric_network/get_fabric_network_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricNetworkParams creates a new GetFabricNetworkParams object -// with the default values initialized. +// NewGetFabricNetworkParams creates a new GetFabricNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricNetworkParams() *GetFabricNetworkParams { - var () return &GetFabricNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricNetworkParamsWithTimeout creates a new GetFabricNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricNetworkParamsWithTimeout(timeout time.Duration) *GetFabricNetworkParams { - var () return &GetFabricNetworkParams{ - timeout: timeout, } } // NewGetFabricNetworkParamsWithContext creates a new GetFabricNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricNetworkParamsWithContext(ctx context.Context) *GetFabricNetworkParams { - var () return &GetFabricNetworkParams{ - Context: ctx, } } // NewGetFabricNetworkParamsWithHTTPClient creates a new GetFabricNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricNetworkParamsWithHTTPClient(client *http.Client) *GetFabricNetworkParams { - var () return &GetFabricNetworkParams{ HTTPClient: client, } } -/*GetFabricNetworkParams contains all the parameters to send to the API endpoint -for the get fabric network operation typically these are written to a http.Request +/* GetFabricNetworkParams contains all the parameters to send to the API endpoint + for the get fabric network operation. + + Typically these are written to a http.Request. */ type GetFabricNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the fabric network. + /* ID. + + The ID of the fabric network. */ ID string @@ -76,6 +82,21 @@ type GetFabricNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricNetworkParams) WithDefaults() *GetFabricNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric network params func (o *GetFabricNetworkParams) WithTimeout(timeout time.Duration) *GetFabricNetworkParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetFabricNetworkParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get fabric network params +func (o *GetFabricNetworkParams) WithDollarSelect(dollarSelect *string) *GetFabricNetworkParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric network params +func (o *GetFabricNetworkParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get fabric network params func (o *GetFabricNetworkParams) WithAPIVersion(aPIVersion *string) *GetFabricNetworkParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetFabricNetworkParams) WriteToRequest(r runtime.ClientRequest, reg str } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_network/get_fabric_network_responses.go b/pkg/client/fabric_network/get_fabric_network_responses.go index 5e9b76db..88a8e6a2 100644 --- a/pkg/client/fabric_network/get_fabric_network_responses.go +++ b/pkg/client/fabric_network/get_fabric_network_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricNetworkReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricNetworkOK() *GetFabricNetworkOK { return &GetFabricNetworkOK{} } -/*GetFabricNetworkOK handles this case with default header values. +/* GetFabricNetworkOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricNetworkOK struct { func (o *GetFabricNetworkOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks/{id}][%d] getFabricNetworkOK %+v", 200, o.Payload) } - func (o *GetFabricNetworkOK) GetPayload() *models.FabricNetwork { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricNetworkForbidden() *GetFabricNetworkForbidden { return &GetFabricNetworkForbidden{} } -/*GetFabricNetworkForbidden handles this case with default header values. +/* GetFabricNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricNetworkForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-networks/{id}][%d] getFabricNetworkForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-networks/{id}][%d] getFabricNetworkForbidden %+v", 403, o.Payload) +} +func (o *GetFabricNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricNetworkNotFound() *GetFabricNetworkNotFound { return &GetFabricNetworkNotFound{} } -/*GetFabricNetworkNotFound handles this case with default header values. +/* GetFabricNetworkNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricNetworkNotFound struct { func (o *GetFabricNetworkNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks/{id}][%d] getFabricNetworkNotFound %+v", 404, o.Payload) } - func (o *GetFabricNetworkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_network/get_fabric_networks_parameters.go b/pkg/client/fabric_network/get_fabric_networks_parameters.go index b8fac2ee..d8814124 100644 --- a/pkg/client/fabric_network/get_fabric_networks_parameters.go +++ b/pkg/client/fabric_network/get_fabric_networks_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricNetworksParams creates a new GetFabricNetworksParams object -// with the default values initialized. +// NewGetFabricNetworksParams creates a new GetFabricNetworksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricNetworksParams() *GetFabricNetworksParams { - var () return &GetFabricNetworksParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricNetworksParamsWithTimeout creates a new GetFabricNetworksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricNetworksParamsWithTimeout(timeout time.Duration) *GetFabricNetworksParams { - var () return &GetFabricNetworksParams{ - timeout: timeout, } } // NewGetFabricNetworksParamsWithContext creates a new GetFabricNetworksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricNetworksParamsWithContext(ctx context.Context) *GetFabricNetworksParams { - var () return &GetFabricNetworksParams{ - Context: ctx, } } // NewGetFabricNetworksParamsWithHTTPClient creates a new GetFabricNetworksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricNetworksParamsWithHTTPClient(client *http.Client) *GetFabricNetworksParams { - var () return &GetFabricNetworksParams{ HTTPClient: client, } } -/*GetFabricNetworksParams contains all the parameters to send to the API endpoint -for the get fabric networks operation typically these are written to a http.Request +/* GetFabricNetworksParams contains all the parameters to send to the API endpoint + for the get fabric networks operation. + + Typically these are written to a http.Request. */ type GetFabricNetworksParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetFabricNetworksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricNetworksParams) WithDefaults() *GetFabricNetworksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricNetworksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric networks params func (o *GetFabricNetworksParams) WithTimeout(timeout time.Duration) *GetFabricNetworksParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetFabricNetworksParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric networks params +func (o *GetFabricNetworksParams) WithDollarCount(dollarCount *bool) *GetFabricNetworksParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric networks params +func (o *GetFabricNetworksParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric networks params func (o *GetFabricNetworksParams) WithDollarFilter(dollarFilter *string) *GetFabricNetworksParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetFabricNetworksParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get fabric networks params +func (o *GetFabricNetworksParams) WithDollarSelect(dollarSelect *string) *GetFabricNetworksParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric networks params +func (o *GetFabricNetworksParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get fabric networks params +func (o *GetFabricNetworksParams) WithDollarSkip(dollarSkip *int64) *GetFabricNetworksParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric networks params +func (o *GetFabricNetworksParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric networks params +func (o *GetFabricNetworksParams) WithDollarTop(dollarTop *int64) *GetFabricNetworksParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric networks params +func (o *GetFabricNetworksParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric networks params func (o *GetFabricNetworksParams) WithAPIVersion(aPIVersion *string) *GetFabricNetworksParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetFabricNetworksParams) WriteToRequest(r runtime.ClientRequest, reg st } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_network/get_fabric_networks_responses.go b/pkg/client/fabric_network/get_fabric_networks_responses.go index a4f2ca11..c3274ff5 100644 --- a/pkg/client/fabric_network/get_fabric_networks_responses.go +++ b/pkg/client/fabric_network/get_fabric_networks_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricNetworksReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricNetworksOK() *GetFabricNetworksOK { return &GetFabricNetworksOK{} } -/*GetFabricNetworksOK handles this case with default header values. +/* GetFabricNetworksOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricNetworksOK struct { func (o *GetFabricNetworksOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks][%d] getFabricNetworksOK %+v", 200, o.Payload) } - func (o *GetFabricNetworksOK) GetPayload() *models.FabricNetworkResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricNetworksForbidden() *GetFabricNetworksForbidden { return &GetFabricNetworksForbidden{} } -/*GetFabricNetworksForbidden handles this case with default header values. +/* GetFabricNetworksForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricNetworksForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricNetworksForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-networks][%d] getFabricNetworksForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-networks][%d] getFabricNetworksForbidden %+v", 403, o.Payload) +} +func (o *GetFabricNetworksForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricNetworksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_network/get_vsphere_fabric_network_parameters.go b/pkg/client/fabric_network/get_vsphere_fabric_network_parameters.go index 1ac2857e..1447dca5 100644 --- a/pkg/client/fabric_network/get_vsphere_fabric_network_parameters.go +++ b/pkg/client/fabric_network/get_vsphere_fabric_network_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVsphereFabricNetworkParams creates a new GetVsphereFabricNetworkParams object -// with the default values initialized. +// NewGetVsphereFabricNetworkParams creates a new GetVsphereFabricNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVsphereFabricNetworkParams() *GetVsphereFabricNetworkParams { - var () return &GetVsphereFabricNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewGetVsphereFabricNetworkParamsWithTimeout creates a new GetVsphereFabricNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVsphereFabricNetworkParamsWithTimeout(timeout time.Duration) *GetVsphereFabricNetworkParams { - var () return &GetVsphereFabricNetworkParams{ - timeout: timeout, } } // NewGetVsphereFabricNetworkParamsWithContext creates a new GetVsphereFabricNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVsphereFabricNetworkParamsWithContext(ctx context.Context) *GetVsphereFabricNetworkParams { - var () return &GetVsphereFabricNetworkParams{ - Context: ctx, } } // NewGetVsphereFabricNetworkParamsWithHTTPClient creates a new GetVsphereFabricNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVsphereFabricNetworkParamsWithHTTPClient(client *http.Client) *GetVsphereFabricNetworkParams { - var () return &GetVsphereFabricNetworkParams{ HTTPClient: client, } } -/*GetVsphereFabricNetworkParams contains all the parameters to send to the API endpoint -for the get vsphere fabric network operation typically these are written to a http.Request +/* GetVsphereFabricNetworkParams contains all the parameters to send to the API endpoint + for the get vsphere fabric network operation. + + Typically these are written to a http.Request. */ type GetVsphereFabricNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the fabric network. + /* ID. + + The ID of the fabric network. */ ID string @@ -76,6 +82,21 @@ type GetVsphereFabricNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vsphere fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVsphereFabricNetworkParams) WithDefaults() *GetVsphereFabricNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vsphere fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVsphereFabricNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vsphere fabric network params func (o *GetVsphereFabricNetworkParams) WithTimeout(timeout time.Duration) *GetVsphereFabricNetworkParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetVsphereFabricNetworkParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get vsphere fabric network params +func (o *GetVsphereFabricNetworkParams) WithDollarSelect(dollarSelect *string) *GetVsphereFabricNetworkParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get vsphere fabric network params +func (o *GetVsphereFabricNetworkParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get vsphere fabric network params func (o *GetVsphereFabricNetworkParams) WithAPIVersion(aPIVersion *string) *GetVsphereFabricNetworkParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetVsphereFabricNetworkParams) WriteToRequest(r runtime.ClientRequest, } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_network/get_vsphere_fabric_network_responses.go b/pkg/client/fabric_network/get_vsphere_fabric_network_responses.go index b1ec1d19..4df86177 100644 --- a/pkg/client/fabric_network/get_vsphere_fabric_network_responses.go +++ b/pkg/client/fabric_network/get_vsphere_fabric_network_responses.go @@ -41,7 +41,6 @@ func (o *GetVsphereFabricNetworkReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVsphereFabricNetworkOK() *GetVsphereFabricNetworkOK { return &GetVsphereFabricNetworkOK{} } -/*GetVsphereFabricNetworkOK handles this case with default header values. +/* GetVsphereFabricNetworkOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetVsphereFabricNetworkOK struct { func (o *GetVsphereFabricNetworkOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere/{id}][%d] getVsphereFabricNetworkOK %+v", 200, o.Payload) } - func (o *GetVsphereFabricNetworkOK) GetPayload() *models.FabricNetworkVsphere { return o.Payload } @@ -85,19 +83,30 @@ func NewGetVsphereFabricNetworkForbidden() *GetVsphereFabricNetworkForbidden { return &GetVsphereFabricNetworkForbidden{} } -/*GetVsphereFabricNetworkForbidden handles this case with default header values. +/* GetVsphereFabricNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVsphereFabricNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVsphereFabricNetworkForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere/{id}][%d] getVsphereFabricNetworkForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere/{id}][%d] getVsphereFabricNetworkForbidden %+v", 403, o.Payload) +} +func (o *GetVsphereFabricNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVsphereFabricNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetVsphereFabricNetworkNotFound() *GetVsphereFabricNetworkNotFound { return &GetVsphereFabricNetworkNotFound{} } -/*GetVsphereFabricNetworkNotFound handles this case with default header values. +/* GetVsphereFabricNetworkNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetVsphereFabricNetworkNotFound struct { func (o *GetVsphereFabricNetworkNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere/{id}][%d] getVsphereFabricNetworkNotFound %+v", 404, o.Payload) } - func (o *GetVsphereFabricNetworkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_network/get_vsphere_fabric_networks_parameters.go b/pkg/client/fabric_network/get_vsphere_fabric_networks_parameters.go index 7edd8633..42e96747 100644 --- a/pkg/client/fabric_network/get_vsphere_fabric_networks_parameters.go +++ b/pkg/client/fabric_network/get_vsphere_fabric_networks_parameters.go @@ -14,55 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetVsphereFabricNetworksParams creates a new GetVsphereFabricNetworksParams object -// with the default values initialized. +// NewGetVsphereFabricNetworksParams creates a new GetVsphereFabricNetworksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVsphereFabricNetworksParams() *GetVsphereFabricNetworksParams { - var () return &GetVsphereFabricNetworksParams{ - timeout: cr.DefaultTimeout, } } // NewGetVsphereFabricNetworksParamsWithTimeout creates a new GetVsphereFabricNetworksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVsphereFabricNetworksParamsWithTimeout(timeout time.Duration) *GetVsphereFabricNetworksParams { - var () return &GetVsphereFabricNetworksParams{ - timeout: timeout, } } // NewGetVsphereFabricNetworksParamsWithContext creates a new GetVsphereFabricNetworksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVsphereFabricNetworksParamsWithContext(ctx context.Context) *GetVsphereFabricNetworksParams { - var () return &GetVsphereFabricNetworksParams{ - Context: ctx, } } // NewGetVsphereFabricNetworksParamsWithHTTPClient creates a new GetVsphereFabricNetworksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVsphereFabricNetworksParamsWithHTTPClient(client *http.Client) *GetVsphereFabricNetworksParams { - var () return &GetVsphereFabricNetworksParams{ HTTPClient: client, } } -/*GetVsphereFabricNetworksParams contains all the parameters to send to the API endpoint -for the get vsphere fabric networks operation typically these are written to a http.Request +/* GetVsphereFabricNetworksParams contains all the parameters to send to the API endpoint + for the get vsphere fabric networks operation. + + Typically these are written to a http.Request. */ type GetVsphereFabricNetworksParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarCount. + + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. + */ + DollarFilter *string + + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +101,21 @@ type GetVsphereFabricNetworksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get vsphere fabric networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVsphereFabricNetworksParams) WithDefaults() *GetVsphereFabricNetworksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vsphere fabric networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVsphereFabricNetworksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get vsphere fabric networks params func (o *GetVsphereFabricNetworksParams) WithTimeout(timeout time.Duration) *GetVsphereFabricNetworksParams { o.SetTimeout(timeout) @@ -104,6 +149,61 @@ func (o *GetVsphereFabricNetworksParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) WithDollarCount(dollarCount *bool) *GetVsphereFabricNetworksParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + +// WithDollarFilter adds the dollarFilter to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) WithDollarFilter(dollarFilter *string) *GetVsphereFabricNetworksParams { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarSelect adds the dollarSelect to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) WithDollarSelect(dollarSelect *string) *GetVsphereFabricNetworksParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) WithDollarSkip(dollarSkip *int64) *GetVsphereFabricNetworksParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) WithDollarTop(dollarTop *int64) *GetVsphereFabricNetworksParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get vsphere fabric networks params +func (o *GetVsphereFabricNetworksParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get vsphere fabric networks params func (o *GetVsphereFabricNetworksParams) WithAPIVersion(aPIVersion *string) *GetVsphereFabricNetworksParams { o.SetAPIVersion(aPIVersion) @@ -123,20 +223,106 @@ func (o *GetVsphereFabricNetworksParams) WriteToRequest(r runtime.ClientRequest, } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_network/get_vsphere_fabric_networks_responses.go b/pkg/client/fabric_network/get_vsphere_fabric_networks_responses.go index a0666360..834df0b7 100644 --- a/pkg/client/fabric_network/get_vsphere_fabric_networks_responses.go +++ b/pkg/client/fabric_network/get_vsphere_fabric_networks_responses.go @@ -35,7 +35,6 @@ func (o *GetVsphereFabricNetworksReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetVsphereFabricNetworksOK() *GetVsphereFabricNetworksOK { return &GetVsphereFabricNetworksOK{} } -/*GetVsphereFabricNetworksOK handles this case with default header values. +/* GetVsphereFabricNetworksOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetVsphereFabricNetworksOK struct { func (o *GetVsphereFabricNetworksOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere][%d] getVsphereFabricNetworksOK %+v", 200, o.Payload) } - func (o *GetVsphereFabricNetworksOK) GetPayload() *models.FabricNetworkVsphereResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetVsphereFabricNetworksForbidden() *GetVsphereFabricNetworksForbidden { return &GetVsphereFabricNetworksForbidden{} } -/*GetVsphereFabricNetworksForbidden handles this case with default header values. +/* GetVsphereFabricNetworksForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVsphereFabricNetworksForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVsphereFabricNetworksForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere][%d] getVsphereFabricNetworksForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-networks-vsphere][%d] getVsphereFabricNetworksForbidden %+v", 403, o.Payload) +} +func (o *GetVsphereFabricNetworksForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVsphereFabricNetworksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_network/update_fabric_network_parameters.go b/pkg/client/fabric_network/update_fabric_network_parameters.go index 94b40e33..4f995a0a 100644 --- a/pkg/client/fabric_network/update_fabric_network_parameters.go +++ b/pkg/client/fabric_network/update_fabric_network_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateFabricNetworkParams creates a new UpdateFabricNetworkParams object -// with the default values initialized. +// NewUpdateFabricNetworkParams creates a new UpdateFabricNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateFabricNetworkParams() *UpdateFabricNetworkParams { - var () return &UpdateFabricNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateFabricNetworkParamsWithTimeout creates a new UpdateFabricNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateFabricNetworkParamsWithTimeout(timeout time.Duration) *UpdateFabricNetworkParams { - var () return &UpdateFabricNetworkParams{ - timeout: timeout, } } // NewUpdateFabricNetworkParamsWithContext creates a new UpdateFabricNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateFabricNetworkParamsWithContext(ctx context.Context) *UpdateFabricNetworkParams { - var () return &UpdateFabricNetworkParams{ - Context: ctx, } } // NewUpdateFabricNetworkParamsWithHTTPClient creates a new UpdateFabricNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateFabricNetworkParamsWithHTTPClient(client *http.Client) *UpdateFabricNetworkParams { - var () return &UpdateFabricNetworkParams{ HTTPClient: client, } } -/*UpdateFabricNetworkParams contains all the parameters to send to the API endpoint -for the update fabric network operation typically these are written to a http.Request +/* UpdateFabricNetworkParams contains all the parameters to send to the API endpoint + for the update fabric network operation. + + Typically these are written to a http.Request. */ type UpdateFabricNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Fabric Network Specification + /* Body. + + Fabric Network Specification */ Body *models.FabricNetworkSpecification - /*ID - The ID of the Fabric Network. + /* ID. + + The ID of the Fabric Network. */ ID string @@ -83,6 +84,21 @@ type UpdateFabricNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFabricNetworkParams) WithDefaults() *UpdateFabricNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFabricNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update fabric network params func (o *UpdateFabricNetworkParams) WithTimeout(timeout time.Duration) *UpdateFabricNetworkParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateFabricNetworkParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/fabric_network/update_fabric_network_responses.go b/pkg/client/fabric_network/update_fabric_network_responses.go index ba793f0a..5da9d282 100644 --- a/pkg/client/fabric_network/update_fabric_network_responses.go +++ b/pkg/client/fabric_network/update_fabric_network_responses.go @@ -41,7 +41,6 @@ func (o *UpdateFabricNetworkReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateFabricNetworkOK() *UpdateFabricNetworkOK { return &UpdateFabricNetworkOK{} } -/*UpdateFabricNetworkOK handles this case with default header values. +/* UpdateFabricNetworkOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateFabricNetworkOK struct { func (o *UpdateFabricNetworkOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-networks/{id}][%d] updateFabricNetworkOK %+v", 200, o.Payload) } - func (o *UpdateFabricNetworkOK) GetPayload() *models.FabricNetwork { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateFabricNetworkForbidden() *UpdateFabricNetworkForbidden { return &UpdateFabricNetworkForbidden{} } -/*UpdateFabricNetworkForbidden handles this case with default header values. +/* UpdateFabricNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateFabricNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateFabricNetworkForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/fabric-networks/{id}][%d] updateFabricNetworkForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/fabric-networks/{id}][%d] updateFabricNetworkForbidden %+v", 403, o.Payload) +} +func (o *UpdateFabricNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateFabricNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateFabricNetworkNotFound() *UpdateFabricNetworkNotFound { return &UpdateFabricNetworkNotFound{} } -/*UpdateFabricNetworkNotFound handles this case with default header values. +/* UpdateFabricNetworkNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateFabricNetworkNotFound struct { func (o *UpdateFabricNetworkNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-networks/{id}][%d] updateFabricNetworkNotFound %+v", 404, o.Payload) } - func (o *UpdateFabricNetworkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_network/updatevsphere_fabric_network_parameters.go b/pkg/client/fabric_network/updatevsphere_fabric_network_parameters.go index 6c74671e..fdc6e4db 100644 --- a/pkg/client/fabric_network/updatevsphere_fabric_network_parameters.go +++ b/pkg/client/fabric_network/updatevsphere_fabric_network_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdatevSphereFabricNetworkParams creates a new UpdatevSphereFabricNetworkParams object -// with the default values initialized. +// NewUpdatevSphereFabricNetworkParams creates a new UpdatevSphereFabricNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdatevSphereFabricNetworkParams() *UpdatevSphereFabricNetworkParams { - var () return &UpdatevSphereFabricNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewUpdatevSphereFabricNetworkParamsWithTimeout creates a new UpdatevSphereFabricNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdatevSphereFabricNetworkParamsWithTimeout(timeout time.Duration) *UpdatevSphereFabricNetworkParams { - var () return &UpdatevSphereFabricNetworkParams{ - timeout: timeout, } } // NewUpdatevSphereFabricNetworkParamsWithContext creates a new UpdatevSphereFabricNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdatevSphereFabricNetworkParamsWithContext(ctx context.Context) *UpdatevSphereFabricNetworkParams { - var () return &UpdatevSphereFabricNetworkParams{ - Context: ctx, } } // NewUpdatevSphereFabricNetworkParamsWithHTTPClient creates a new UpdatevSphereFabricNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdatevSphereFabricNetworkParamsWithHTTPClient(client *http.Client) *UpdatevSphereFabricNetworkParams { - var () return &UpdatevSphereFabricNetworkParams{ HTTPClient: client, } } -/*UpdatevSphereFabricNetworkParams contains all the parameters to send to the API endpoint -for the updatev sphere fabric network operation typically these are written to a http.Request +/* UpdatevSphereFabricNetworkParams contains all the parameters to send to the API endpoint + for the updatev sphere fabric network operation. + + Typically these are written to a http.Request. */ type UpdatevSphereFabricNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Vsphere Fabric Network Specification + /* Body. + + Vsphere Fabric Network Specification */ Body *models.FabricNetworkVsphereSpecification - /*ID - The ID of the vSphere Fabric Network. + /* ID. + + The ID of the vSphere Fabric Network. */ ID string @@ -83,6 +84,21 @@ type UpdatevSphereFabricNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the updatev sphere fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatevSphereFabricNetworkParams) WithDefaults() *UpdatevSphereFabricNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the updatev sphere fabric network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatevSphereFabricNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the updatev sphere fabric network params func (o *UpdatevSphereFabricNetworkParams) WithTimeout(timeout time.Duration) *UpdatevSphereFabricNetworkParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdatevSphereFabricNetworkParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/fabric_network/updatevsphere_fabric_network_responses.go b/pkg/client/fabric_network/updatevsphere_fabric_network_responses.go index b0b384d7..939ad23b 100644 --- a/pkg/client/fabric_network/updatevsphere_fabric_network_responses.go +++ b/pkg/client/fabric_network/updatevsphere_fabric_network_responses.go @@ -41,7 +41,6 @@ func (o *UpdatevSphereFabricNetworkReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdatevSphereFabricNetworkOK() *UpdatevSphereFabricNetworkOK { return &UpdatevSphereFabricNetworkOK{} } -/*UpdatevSphereFabricNetworkOK handles this case with default header values. +/* UpdatevSphereFabricNetworkOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdatevSphereFabricNetworkOK struct { func (o *UpdatevSphereFabricNetworkOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-networks-vsphere/{id}][%d] updatevSphereFabricNetworkOK %+v", 200, o.Payload) } - func (o *UpdatevSphereFabricNetworkOK) GetPayload() *models.FabricNetworkVsphere { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdatevSphereFabricNetworkForbidden() *UpdatevSphereFabricNetworkForbidd return &UpdatevSphereFabricNetworkForbidden{} } -/*UpdatevSphereFabricNetworkForbidden handles this case with default header values. +/* UpdatevSphereFabricNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdatevSphereFabricNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdatevSphereFabricNetworkForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/fabric-networks-vsphere/{id}][%d] updatevSphereFabricNetworkForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/fabric-networks-vsphere/{id}][%d] updatevSphereFabricNetworkForbidden %+v", 403, o.Payload) +} +func (o *UpdatevSphereFabricNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdatevSphereFabricNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdatevSphereFabricNetworkNotFound() *UpdatevSphereFabricNetworkNotFound return &UpdatevSphereFabricNetworkNotFound{} } -/*UpdatevSphereFabricNetworkNotFound handles this case with default header values. +/* UpdatevSphereFabricNetworkNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdatevSphereFabricNetworkNotFound struct { func (o *UpdatevSphereFabricNetworkNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/fabric-networks-vsphere/{id}][%d] updatevSphereFabricNetworkNotFound %+v", 404, o.Payload) } - func (o *UpdatevSphereFabricNetworkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_vsphere_datastore/fabricvsphere_datastore_client.go b/pkg/client/fabric_vsphere_datastore/fabricvsphere_datastore_client.go index 8d9773f2..4f7f2199 100644 --- a/pkg/client/fabric_vsphere_datastore/fabricvsphere_datastore_client.go +++ b/pkg/client/fabric_vsphere_datastore/fabricvsphere_datastore_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricVSphereDatastore(params *GetFabricVSphereDatastoreParams) (*GetFabricVSphereDatastoreOK, error) + GetFabricVSphereDatastore(params *GetFabricVSphereDatastoreParams, opts ...ClientOption) (*GetFabricVSphereDatastoreOK, error) - GetFabricVSphereDatastores(params *GetFabricVSphereDatastoresParams) (*GetFabricVSphereDatastoresOK, error) + GetFabricVSphereDatastores(params *GetFabricVSphereDatastoresParams, opts ...ClientOption) (*GetFabricVSphereDatastoresOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Get fabric vSphere datastore with a given id */ -func (a *Client) GetFabricVSphereDatastore(params *GetFabricVSphereDatastoreParams) (*GetFabricVSphereDatastoreOK, error) { +func (a *Client) GetFabricVSphereDatastore(params *GetFabricVSphereDatastoreParams, opts ...ClientOption) (*GetFabricVSphereDatastoreOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricVSphereDatastoreParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricVSphereDatastore", Method: "GET", PathPattern: "/iaas/api/fabric-vsphere-datastores/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetFabricVSphereDatastore(params *GetFabricVSphereDatastorePara Reader: &GetFabricVSphereDatastoreReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetFabricVSphereDatastore(params *GetFabricVSphereDatastorePara Get all fabric vSphere datastores. */ -func (a *Client) GetFabricVSphereDatastores(params *GetFabricVSphereDatastoresParams) (*GetFabricVSphereDatastoresOK, error) { +func (a *Client) GetFabricVSphereDatastores(params *GetFabricVSphereDatastoresParams, opts ...ClientOption) (*GetFabricVSphereDatastoresOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricVSphereDatastoresParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricVSphereDatastores", Method: "GET", PathPattern: "/iaas/api/fabric-vsphere-datastores", @@ -92,7 +98,12 @@ func (a *Client) GetFabricVSphereDatastores(params *GetFabricVSphereDatastoresPa Reader: &GetFabricVSphereDatastoresReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_parameters.go b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_parameters.go index 0151427c..243f3dd6 100644 --- a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_parameters.go +++ b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricVSphereDatastoreParams creates a new GetFabricVSphereDatastoreParams object -// with the default values initialized. +// NewGetFabricVSphereDatastoreParams creates a new GetFabricVSphereDatastoreParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricVSphereDatastoreParams() *GetFabricVSphereDatastoreParams { - var () return &GetFabricVSphereDatastoreParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricVSphereDatastoreParamsWithTimeout creates a new GetFabricVSphereDatastoreParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricVSphereDatastoreParamsWithTimeout(timeout time.Duration) *GetFabricVSphereDatastoreParams { - var () return &GetFabricVSphereDatastoreParams{ - timeout: timeout, } } // NewGetFabricVSphereDatastoreParamsWithContext creates a new GetFabricVSphereDatastoreParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricVSphereDatastoreParamsWithContext(ctx context.Context) *GetFabricVSphereDatastoreParams { - var () return &GetFabricVSphereDatastoreParams{ - Context: ctx, } } // NewGetFabricVSphereDatastoreParamsWithHTTPClient creates a new GetFabricVSphereDatastoreParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricVSphereDatastoreParamsWithHTTPClient(client *http.Client) *GetFabricVSphereDatastoreParams { - var () return &GetFabricVSphereDatastoreParams{ HTTPClient: client, } } -/*GetFabricVSphereDatastoreParams contains all the parameters to send to the API endpoint -for the get fabric v sphere datastore operation typically these are written to a http.Request +/* GetFabricVSphereDatastoreParams contains all the parameters to send to the API endpoint + for the get fabric v sphere datastore operation. + + Typically these are written to a http.Request. */ type GetFabricVSphereDatastoreParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Fabric vSphere Datastore. + /* ID. + + The ID of the Fabric vSphere Datastore. */ ID string @@ -76,6 +82,21 @@ type GetFabricVSphereDatastoreParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric v sphere datastore params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereDatastoreParams) WithDefaults() *GetFabricVSphereDatastoreParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric v sphere datastore params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereDatastoreParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric v sphere datastore params func (o *GetFabricVSphereDatastoreParams) WithTimeout(timeout time.Duration) *GetFabricVSphereDatastoreParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetFabricVSphereDatastoreParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get fabric v sphere datastore params +func (o *GetFabricVSphereDatastoreParams) WithDollarSelect(dollarSelect *string) *GetFabricVSphereDatastoreParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric v sphere datastore params +func (o *GetFabricVSphereDatastoreParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get fabric v sphere datastore params func (o *GetFabricVSphereDatastoreParams) WithAPIVersion(aPIVersion *string) *GetFabricVSphereDatastoreParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetFabricVSphereDatastoreParams) WriteToRequest(r runtime.ClientRequest } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_responses.go b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_responses.go index 75734068..bca8a899 100644 --- a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_responses.go +++ b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastore_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricVSphereDatastoreReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricVSphereDatastoreOK() *GetFabricVSphereDatastoreOK { return &GetFabricVSphereDatastoreOK{} } -/*GetFabricVSphereDatastoreOK handles this case with default header values. +/* GetFabricVSphereDatastoreOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricVSphereDatastoreOK struct { func (o *GetFabricVSphereDatastoreOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores/{id}][%d] getFabricVSphereDatastoreOK %+v", 200, o.Payload) } - func (o *GetFabricVSphereDatastoreOK) GetPayload() *models.FabricVsphereDatastore { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricVSphereDatastoreForbidden() *GetFabricVSphereDatastoreForbidden return &GetFabricVSphereDatastoreForbidden{} } -/*GetFabricVSphereDatastoreForbidden handles this case with default header values. +/* GetFabricVSphereDatastoreForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricVSphereDatastoreForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricVSphereDatastoreForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores/{id}][%d] getFabricVSphereDatastoreForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores/{id}][%d] getFabricVSphereDatastoreForbidden %+v", 403, o.Payload) +} +func (o *GetFabricVSphereDatastoreForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricVSphereDatastoreForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricVSphereDatastoreNotFound() *GetFabricVSphereDatastoreNotFound { return &GetFabricVSphereDatastoreNotFound{} } -/*GetFabricVSphereDatastoreNotFound handles this case with default header values. +/* GetFabricVSphereDatastoreNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricVSphereDatastoreNotFound struct { func (o *GetFabricVSphereDatastoreNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores/{id}][%d] getFabricVSphereDatastoreNotFound %+v", 404, o.Payload) } - func (o *GetFabricVSphereDatastoreNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_parameters.go b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_parameters.go index 4d351e60..6161b039 100644 --- a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_parameters.go +++ b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricVSphereDatastoresParams creates a new GetFabricVSphereDatastoresParams object -// with the default values initialized. +// NewGetFabricVSphereDatastoresParams creates a new GetFabricVSphereDatastoresParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricVSphereDatastoresParams() *GetFabricVSphereDatastoresParams { - var () return &GetFabricVSphereDatastoresParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricVSphereDatastoresParamsWithTimeout creates a new GetFabricVSphereDatastoresParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricVSphereDatastoresParamsWithTimeout(timeout time.Duration) *GetFabricVSphereDatastoresParams { - var () return &GetFabricVSphereDatastoresParams{ - timeout: timeout, } } // NewGetFabricVSphereDatastoresParamsWithContext creates a new GetFabricVSphereDatastoresParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricVSphereDatastoresParamsWithContext(ctx context.Context) *GetFabricVSphereDatastoresParams { - var () return &GetFabricVSphereDatastoresParams{ - Context: ctx, } } // NewGetFabricVSphereDatastoresParamsWithHTTPClient creates a new GetFabricVSphereDatastoresParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricVSphereDatastoresParamsWithHTTPClient(client *http.Client) *GetFabricVSphereDatastoresParams { - var () return &GetFabricVSphereDatastoresParams{ HTTPClient: client, } } -/*GetFabricVSphereDatastoresParams contains all the parameters to send to the API endpoint -for the get fabric v sphere datastores operation typically these are written to a http.Request +/* GetFabricVSphereDatastoresParams contains all the parameters to send to the API endpoint + for the get fabric v sphere datastores operation. + + Typically these are written to a http.Request. */ type GetFabricVSphereDatastoresParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetFabricVSphereDatastoresParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric v sphere datastores params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereDatastoresParams) WithDefaults() *GetFabricVSphereDatastoresParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric v sphere datastores params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereDatastoresParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric v sphere datastores params func (o *GetFabricVSphereDatastoresParams) WithTimeout(timeout time.Duration) *GetFabricVSphereDatastoresParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetFabricVSphereDatastoresParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) WithDollarCount(dollarCount *bool) *GetFabricVSphereDatastoresParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric v sphere datastores params func (o *GetFabricVSphereDatastoresParams) WithDollarFilter(dollarFilter *string) *GetFabricVSphereDatastoresParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetFabricVSphereDatastoresParams) SetDollarFilter(dollarFilter *string) o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) WithDollarSelect(dollarSelect *string) *GetFabricVSphereDatastoresParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) WithDollarSkip(dollarSkip *int64) *GetFabricVSphereDatastoresParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) WithDollarTop(dollarTop *int64) *GetFabricVSphereDatastoresParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric v sphere datastores params +func (o *GetFabricVSphereDatastoresParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric v sphere datastores params func (o *GetFabricVSphereDatastoresParams) WithAPIVersion(aPIVersion *string) *GetFabricVSphereDatastoresParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetFabricVSphereDatastoresParams) WriteToRequest(r runtime.ClientReques } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_responses.go b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_responses.go index 54730f9c..ad1fdc20 100644 --- a/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_responses.go +++ b/pkg/client/fabric_vsphere_datastore/get_fabric_vsphere_datastores_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricVSphereDatastoresReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricVSphereDatastoresOK() *GetFabricVSphereDatastoresOK { return &GetFabricVSphereDatastoresOK{} } -/*GetFabricVSphereDatastoresOK handles this case with default header values. +/* GetFabricVSphereDatastoresOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricVSphereDatastoresOK struct { func (o *GetFabricVSphereDatastoresOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores][%d] getFabricVSphereDatastoresOK %+v", 200, o.Payload) } - func (o *GetFabricVSphereDatastoresOK) GetPayload() *models.FabricVsphereDatastoreResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricVSphereDatastoresForbidden() *GetFabricVSphereDatastoresForbidd return &GetFabricVSphereDatastoresForbidden{} } -/*GetFabricVSphereDatastoresForbidden handles this case with default header values. +/* GetFabricVSphereDatastoresForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricVSphereDatastoresForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricVSphereDatastoresForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores][%d] getFabricVSphereDatastoresForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-datastores][%d] getFabricVSphereDatastoresForbidden %+v", 403, o.Payload) +} +func (o *GetFabricVSphereDatastoresForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricVSphereDatastoresForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_vsphere_storage_policies/fabricvsphere_storage_policies_client.go b/pkg/client/fabric_vsphere_storage_policies/fabricvsphere_storage_policies_client.go index 00580176..4271444f 100644 --- a/pkg/client/fabric_vsphere_storage_policies/fabricvsphere_storage_policies_client.go +++ b/pkg/client/fabric_vsphere_storage_policies/fabricvsphere_storage_policies_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFabricVSphereStoragePolicies(params *GetFabricVSphereStoragePoliciesParams) (*GetFabricVSphereStoragePoliciesOK, error) + GetFabricVSphereStoragePolicies(params *GetFabricVSphereStoragePoliciesParams, opts ...ClientOption) (*GetFabricVSphereStoragePoliciesOK, error) - GetFabricVSphereStoragePolicy(params *GetFabricVSphereStoragePolicyParams) (*GetFabricVSphereStoragePolicyOK, error) + GetFabricVSphereStoragePolicy(params *GetFabricVSphereStoragePolicyParams, opts ...ClientOption) (*GetFabricVSphereStoragePolicyOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Get all fabric vSphere storage polices. */ -func (a *Client) GetFabricVSphereStoragePolicies(params *GetFabricVSphereStoragePoliciesParams) (*GetFabricVSphereStoragePoliciesOK, error) { +func (a *Client) GetFabricVSphereStoragePolicies(params *GetFabricVSphereStoragePoliciesParams, opts ...ClientOption) (*GetFabricVSphereStoragePoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricVSphereStoragePoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricVSphereStoragePolicies", Method: "GET", PathPattern: "/iaas/api/fabric-vsphere-storage-policies", @@ -56,7 +58,12 @@ func (a *Client) GetFabricVSphereStoragePolicies(params *GetFabricVSphereStorage Reader: &GetFabricVSphereStoragePoliciesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetFabricVSphereStoragePolicies(params *GetFabricVSphereStorage Get fabric vSphere storage policy with a given id */ -func (a *Client) GetFabricVSphereStoragePolicy(params *GetFabricVSphereStoragePolicyParams) (*GetFabricVSphereStoragePolicyOK, error) { +func (a *Client) GetFabricVSphereStoragePolicy(params *GetFabricVSphereStoragePolicyParams, opts ...ClientOption) (*GetFabricVSphereStoragePolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFabricVSphereStoragePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFabricVSphereStoragePolicy", Method: "GET", PathPattern: "/iaas/api/fabric-vsphere-storage-policies/{id}", @@ -92,7 +98,12 @@ func (a *Client) GetFabricVSphereStoragePolicy(params *GetFabricVSphereStoragePo Reader: &GetFabricVSphereStoragePolicyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_parameters.go b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_parameters.go index 3d572e18..9d426534 100644 --- a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_parameters.go +++ b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_parameters.go @@ -14,60 +14,85 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewGetFabricVSphereStoragePoliciesParams creates a new GetFabricVSphereStoragePoliciesParams object -// with the default values initialized. +// NewGetFabricVSphereStoragePoliciesParams creates a new GetFabricVSphereStoragePoliciesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricVSphereStoragePoliciesParams() *GetFabricVSphereStoragePoliciesParams { - var () return &GetFabricVSphereStoragePoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricVSphereStoragePoliciesParamsWithTimeout creates a new GetFabricVSphereStoragePoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricVSphereStoragePoliciesParamsWithTimeout(timeout time.Duration) *GetFabricVSphereStoragePoliciesParams { - var () return &GetFabricVSphereStoragePoliciesParams{ - timeout: timeout, } } // NewGetFabricVSphereStoragePoliciesParamsWithContext creates a new GetFabricVSphereStoragePoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricVSphereStoragePoliciesParamsWithContext(ctx context.Context) *GetFabricVSphereStoragePoliciesParams { - var () return &GetFabricVSphereStoragePoliciesParams{ - Context: ctx, } } // NewGetFabricVSphereStoragePoliciesParamsWithHTTPClient creates a new GetFabricVSphereStoragePoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricVSphereStoragePoliciesParamsWithHTTPClient(client *http.Client) *GetFabricVSphereStoragePoliciesParams { - var () return &GetFabricVSphereStoragePoliciesParams{ HTTPClient: client, } } -/*GetFabricVSphereStoragePoliciesParams contains all the parameters to send to the API endpoint -for the get fabric v sphere storage policies operation typically these are written to a http.Request +/* GetFabricVSphereStoragePoliciesParams contains all the parameters to send to the API endpoint + for the get fabric v sphere storage policies operation. + + Typically these are written to a http.Request. */ type GetFabricVSphereStoragePoliciesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. + */ + DollarCount *bool + + /* DollarFilter. + + Filter the results by a specified predicate expression. Operators: eq, ne, and, or. */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* DollarSkip. + + Number of records you want to skip. + */ + DollarSkip *int64 + + /* DollarTop. + + Number of records you want to get. + */ + DollarTop *int64 + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +101,21 @@ type GetFabricVSphereStoragePoliciesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric v sphere storage policies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereStoragePoliciesParams) WithDefaults() *GetFabricVSphereStoragePoliciesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric v sphere storage policies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereStoragePoliciesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric v sphere storage policies params func (o *GetFabricVSphereStoragePoliciesParams) WithTimeout(timeout time.Duration) *GetFabricVSphereStoragePoliciesParams { o.SetTimeout(timeout) @@ -109,6 +149,17 @@ func (o *GetFabricVSphereStoragePoliciesParams) SetHTTPClient(client *http.Clien o.HTTPClient = client } +// WithDollarCount adds the dollarCount to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) WithDollarCount(dollarCount *bool) *GetFabricVSphereStoragePoliciesParams { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + // WithDollarFilter adds the dollarFilter to the get fabric v sphere storage policies params func (o *GetFabricVSphereStoragePoliciesParams) WithDollarFilter(dollarFilter *string) *GetFabricVSphereStoragePoliciesParams { o.SetDollarFilter(dollarFilter) @@ -120,6 +171,39 @@ func (o *GetFabricVSphereStoragePoliciesParams) SetDollarFilter(dollarFilter *st o.DollarFilter = dollarFilter } +// WithDollarSelect adds the dollarSelect to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) WithDollarSelect(dollarSelect *string) *GetFabricVSphereStoragePoliciesParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) WithDollarSkip(dollarSkip *int64) *GetFabricVSphereStoragePoliciesParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) SetDollarSkip(dollarSkip *int64) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) WithDollarTop(dollarTop *int64) *GetFabricVSphereStoragePoliciesParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the get fabric v sphere storage policies params +func (o *GetFabricVSphereStoragePoliciesParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + // WithAPIVersion adds the aPIVersion to the get fabric v sphere storage policies params func (o *GetFabricVSphereStoragePoliciesParams) WithAPIVersion(aPIVersion *string) *GetFabricVSphereStoragePoliciesParams { o.SetAPIVersion(aPIVersion) @@ -139,36 +223,106 @@ func (o *GetFabricVSphereStoragePoliciesParams) WriteToRequest(r runtime.ClientR } var res []error + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip int64 + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := swag.FormatInt64(qrDollarSkip) + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_responses.go b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_responses.go index 8a3d72c9..b8dd6084 100644 --- a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_responses.go +++ b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policies_responses.go @@ -35,7 +35,6 @@ func (o *GetFabricVSphereStoragePoliciesReader) ReadResponse(response runtime.Cl return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFabricVSphereStoragePoliciesOK() *GetFabricVSphereStoragePoliciesOK { return &GetFabricVSphereStoragePoliciesOK{} } -/*GetFabricVSphereStoragePoliciesOK handles this case with default header values. +/* GetFabricVSphereStoragePoliciesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFabricVSphereStoragePoliciesOK struct { func (o *GetFabricVSphereStoragePoliciesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies][%d] getFabricVSphereStoragePoliciesOK %+v", 200, o.Payload) } - func (o *GetFabricVSphereStoragePoliciesOK) GetPayload() *models.FabricVsphereStoragePolicyResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFabricVSphereStoragePoliciesForbidden() *GetFabricVSphereStoragePolic return &GetFabricVSphereStoragePoliciesForbidden{} } -/*GetFabricVSphereStoragePoliciesForbidden handles this case with default header values. +/* GetFabricVSphereStoragePoliciesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricVSphereStoragePoliciesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricVSphereStoragePoliciesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies][%d] getFabricVSphereStoragePoliciesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies][%d] getFabricVSphereStoragePoliciesForbidden %+v", 403, o.Payload) +} +func (o *GetFabricVSphereStoragePoliciesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricVSphereStoragePoliciesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_parameters.go b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_parameters.go index 73306f71..3d06e5f3 100644 --- a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_parameters.go +++ b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_parameters.go @@ -16,58 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFabricVSphereStoragePolicyParams creates a new GetFabricVSphereStoragePolicyParams object -// with the default values initialized. +// NewGetFabricVSphereStoragePolicyParams creates a new GetFabricVSphereStoragePolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFabricVSphereStoragePolicyParams() *GetFabricVSphereStoragePolicyParams { - var () return &GetFabricVSphereStoragePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewGetFabricVSphereStoragePolicyParamsWithTimeout creates a new GetFabricVSphereStoragePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFabricVSphereStoragePolicyParamsWithTimeout(timeout time.Duration) *GetFabricVSphereStoragePolicyParams { - var () return &GetFabricVSphereStoragePolicyParams{ - timeout: timeout, } } // NewGetFabricVSphereStoragePolicyParamsWithContext creates a new GetFabricVSphereStoragePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFabricVSphereStoragePolicyParamsWithContext(ctx context.Context) *GetFabricVSphereStoragePolicyParams { - var () return &GetFabricVSphereStoragePolicyParams{ - Context: ctx, } } // NewGetFabricVSphereStoragePolicyParamsWithHTTPClient creates a new GetFabricVSphereStoragePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFabricVSphereStoragePolicyParamsWithHTTPClient(client *http.Client) *GetFabricVSphereStoragePolicyParams { - var () return &GetFabricVSphereStoragePolicyParams{ HTTPClient: client, } } -/*GetFabricVSphereStoragePolicyParams contains all the parameters to send to the API endpoint -for the get fabric v sphere storage policy operation typically these are written to a http.Request +/* GetFabricVSphereStoragePolicyParams contains all the parameters to send to the API endpoint + for the get fabric v sphere storage policy operation. + + Typically these are written to a http.Request. */ type GetFabricVSphereStoragePolicyParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* DollarSelect. + Select a subset of properties to include in the response. + */ + DollarSelect *string + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the Fabric vSphere Storage Policy. + /* ID. + + The ID of the Fabric vSphere Storage Policy. */ ID string @@ -76,6 +82,21 @@ type GetFabricVSphereStoragePolicyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get fabric v sphere storage policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereStoragePolicyParams) WithDefaults() *GetFabricVSphereStoragePolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get fabric v sphere storage policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFabricVSphereStoragePolicyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get fabric v sphere storage policy params func (o *GetFabricVSphereStoragePolicyParams) WithTimeout(timeout time.Duration) *GetFabricVSphereStoragePolicyParams { o.SetTimeout(timeout) @@ -109,6 +130,17 @@ func (o *GetFabricVSphereStoragePolicyParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithDollarSelect adds the dollarSelect to the get fabric v sphere storage policy params +func (o *GetFabricVSphereStoragePolicyParams) WithDollarSelect(dollarSelect *string) *GetFabricVSphereStoragePolicyParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the get fabric v sphere storage policy params +func (o *GetFabricVSphereStoragePolicyParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + // WithAPIVersion adds the aPIVersion to the get fabric v sphere storage policy params func (o *GetFabricVSphereStoragePolicyParams) WithAPIVersion(aPIVersion *string) *GetFabricVSphereStoragePolicyParams { o.SetAPIVersion(aPIVersion) @@ -139,20 +171,38 @@ func (o *GetFabricVSphereStoragePolicyParams) WriteToRequest(r runtime.ClientReq } var res []error + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_responses.go b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_responses.go index 21998674..cf505da5 100644 --- a/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_responses.go +++ b/pkg/client/fabric_vsphere_storage_policies/get_fabric_vsphere_storage_policy_responses.go @@ -41,7 +41,6 @@ func (o *GetFabricVSphereStoragePolicyReader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFabricVSphereStoragePolicyOK() *GetFabricVSphereStoragePolicyOK { return &GetFabricVSphereStoragePolicyOK{} } -/*GetFabricVSphereStoragePolicyOK handles this case with default header values. +/* GetFabricVSphereStoragePolicyOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFabricVSphereStoragePolicyOK struct { func (o *GetFabricVSphereStoragePolicyOK) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies/{id}][%d] getFabricVSphereStoragePolicyOK %+v", 200, o.Payload) } - func (o *GetFabricVSphereStoragePolicyOK) GetPayload() *models.FabricVsphereStoragePolicy { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFabricVSphereStoragePolicyForbidden() *GetFabricVSphereStoragePolicyF return &GetFabricVSphereStoragePolicyForbidden{} } -/*GetFabricVSphereStoragePolicyForbidden handles this case with default header values. +/* GetFabricVSphereStoragePolicyForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFabricVSphereStoragePolicyForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFabricVSphereStoragePolicyForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies/{id}][%d] getFabricVSphereStoragePolicyForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies/{id}][%d] getFabricVSphereStoragePolicyForbidden %+v", 403, o.Payload) +} +func (o *GetFabricVSphereStoragePolicyForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFabricVSphereStoragePolicyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFabricVSphereStoragePolicyNotFound() *GetFabricVSphereStoragePolicyNo return &GetFabricVSphereStoragePolicyNotFound{} } -/*GetFabricVSphereStoragePolicyNotFound handles this case with default header values. +/* GetFabricVSphereStoragePolicyNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFabricVSphereStoragePolicyNotFound struct { func (o *GetFabricVSphereStoragePolicyNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/fabric-vsphere-storage-policies/{id}][%d] getFabricVSphereStoragePolicyNotFound %+v", 404, o.Payload) } - func (o *GetFabricVSphereStoragePolicyNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/flavor_profile/create_flavor_profile_parameters.go b/pkg/client/flavor_profile/create_flavor_profile_parameters.go index a7dd7941..ffb82732 100644 --- a/pkg/client/flavor_profile/create_flavor_profile_parameters.go +++ b/pkg/client/flavor_profile/create_flavor_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateFlavorProfileParams creates a new CreateFlavorProfileParams object -// with the default values initialized. +// NewCreateFlavorProfileParams creates a new CreateFlavorProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateFlavorProfileParams() *CreateFlavorProfileParams { - var () return &CreateFlavorProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateFlavorProfileParamsWithTimeout creates a new CreateFlavorProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateFlavorProfileParamsWithTimeout(timeout time.Duration) *CreateFlavorProfileParams { - var () return &CreateFlavorProfileParams{ - timeout: timeout, } } // NewCreateFlavorProfileParamsWithContext creates a new CreateFlavorProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateFlavorProfileParamsWithContext(ctx context.Context) *CreateFlavorProfileParams { - var () return &CreateFlavorProfileParams{ - Context: ctx, } } // NewCreateFlavorProfileParamsWithHTTPClient creates a new CreateFlavorProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateFlavorProfileParamsWithHTTPClient(client *http.Client) *CreateFlavorProfileParams { - var () return &CreateFlavorProfileParams{ HTTPClient: client, } } -/*CreateFlavorProfileParams contains all the parameters to send to the API endpoint -for the create flavor profile operation typically these are written to a http.Request +/* CreateFlavorProfileParams contains all the parameters to send to the API endpoint + for the create flavor profile operation. + + Typically these are written to a http.Request. */ type CreateFlavorProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - FlavorProfile instance + /* Body. + + FlavorProfile instance */ Body *models.FlavorProfileSpecification @@ -78,6 +78,21 @@ type CreateFlavorProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateFlavorProfileParams) WithDefaults() *CreateFlavorProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateFlavorProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create flavor profile params func (o *CreateFlavorProfileParams) WithTimeout(timeout time.Duration) *CreateFlavorProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateFlavorProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/flavor_profile/create_flavor_profile_responses.go b/pkg/client/flavor_profile/create_flavor_profile_responses.go index f8e90abb..f895d4b6 100644 --- a/pkg/client/flavor_profile/create_flavor_profile_responses.go +++ b/pkg/client/flavor_profile/create_flavor_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateFlavorProfileReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateFlavorProfileCreated() *CreateFlavorProfileCreated { return &CreateFlavorProfileCreated{} } -/*CreateFlavorProfileCreated handles this case with default header values. +/* CreateFlavorProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateFlavorProfileCreated struct { func (o *CreateFlavorProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/flavor-profiles][%d] createFlavorProfileCreated %+v", 201, o.Payload) } - func (o *CreateFlavorProfileCreated) GetPayload() *models.FlavorProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateFlavorProfileBadRequest() *CreateFlavorProfileBadRequest { return &CreateFlavorProfileBadRequest{} } -/*CreateFlavorProfileBadRequest handles this case with default header values. +/* CreateFlavorProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateFlavorProfileBadRequest struct { func (o *CreateFlavorProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/flavor-profiles][%d] createFlavorProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateFlavorProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateFlavorProfileForbidden() *CreateFlavorProfileForbidden { return &CreateFlavorProfileForbidden{} } -/*CreateFlavorProfileForbidden handles this case with default header values. +/* CreateFlavorProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateFlavorProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateFlavorProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/flavor-profiles][%d] createFlavorProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/flavor-profiles][%d] createFlavorProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateFlavorProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateFlavorProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/flavor_profile/delete_flavor_profile_parameters.go b/pkg/client/flavor_profile/delete_flavor_profile_parameters.go index 49f75144..ba7163d8 100644 --- a/pkg/client/flavor_profile/delete_flavor_profile_parameters.go +++ b/pkg/client/flavor_profile/delete_flavor_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteFlavorProfileParams creates a new DeleteFlavorProfileParams object -// with the default values initialized. +// NewDeleteFlavorProfileParams creates a new DeleteFlavorProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteFlavorProfileParams() *DeleteFlavorProfileParams { - var () return &DeleteFlavorProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteFlavorProfileParamsWithTimeout creates a new DeleteFlavorProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteFlavorProfileParamsWithTimeout(timeout time.Duration) *DeleteFlavorProfileParams { - var () return &DeleteFlavorProfileParams{ - timeout: timeout, } } // NewDeleteFlavorProfileParamsWithContext creates a new DeleteFlavorProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteFlavorProfileParamsWithContext(ctx context.Context) *DeleteFlavorProfileParams { - var () return &DeleteFlavorProfileParams{ - Context: ctx, } } // NewDeleteFlavorProfileParamsWithHTTPClient creates a new DeleteFlavorProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteFlavorProfileParamsWithHTTPClient(client *http.Client) *DeleteFlavorProfileParams { - var () return &DeleteFlavorProfileParams{ HTTPClient: client, } } -/*DeleteFlavorProfileParams contains all the parameters to send to the API endpoint -for the delete flavor profile operation typically these are written to a http.Request +/* DeleteFlavorProfileParams contains all the parameters to send to the API endpoint + for the delete flavor profile operation. + + Typically these are written to a http.Request. */ type DeleteFlavorProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the flavor. + /* ID. + + The ID of the flavor. */ ID string @@ -76,6 +76,21 @@ type DeleteFlavorProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteFlavorProfileParams) WithDefaults() *DeleteFlavorProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteFlavorProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete flavor profile params func (o *DeleteFlavorProfileParams) WithTimeout(timeout time.Duration) *DeleteFlavorProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteFlavorProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/flavor_profile/delete_flavor_profile_responses.go b/pkg/client/flavor_profile/delete_flavor_profile_responses.go index 512ff02a..f32de968 100644 --- a/pkg/client/flavor_profile/delete_flavor_profile_responses.go +++ b/pkg/client/flavor_profile/delete_flavor_profile_responses.go @@ -7,9 +7,12 @@ package flavor_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteFlavorProfileReader is a Reader for the DeleteFlavorProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteFlavorProfileReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteFlavorProfileNoContent() *DeleteFlavorProfileNoContent { return &DeleteFlavorProfileNoContent{} } -/*DeleteFlavorProfileNoContent handles this case with default header values. +/* DeleteFlavorProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteFlavorProfileForbidden() *DeleteFlavorProfileForbidden { return &DeleteFlavorProfileForbidden{} } -/*DeleteFlavorProfileForbidden handles this case with default header values. +/* DeleteFlavorProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteFlavorProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteFlavorProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/flavor-profiles/{id}][%d] deleteFlavorProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/flavor-profiles/{id}][%d] deleteFlavorProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteFlavorProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteFlavorProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/flavor_profile/flavor_profile_client.go b/pkg/client/flavor_profile/flavor_profile_client.go index b7a061c4..670046c2 100644 --- a/pkg/client/flavor_profile/flavor_profile_client.go +++ b/pkg/client/flavor_profile/flavor_profile_client.go @@ -25,17 +25,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateFlavorProfile(params *CreateFlavorProfileParams) (*CreateFlavorProfileCreated, error) + CreateFlavorProfile(params *CreateFlavorProfileParams, opts ...ClientOption) (*CreateFlavorProfileCreated, error) - DeleteFlavorProfile(params *DeleteFlavorProfileParams) (*DeleteFlavorProfileNoContent, error) + DeleteFlavorProfile(params *DeleteFlavorProfileParams, opts ...ClientOption) (*DeleteFlavorProfileNoContent, error) - GetFlavorProfile(params *GetFlavorProfileParams) (*GetFlavorProfileOK, error) + GetFlavorProfile(params *GetFlavorProfileParams, opts ...ClientOption) (*GetFlavorProfileOK, error) - GetFlavorProfiles(params *GetFlavorProfilesParams) (*GetFlavorProfilesOK, error) + GetFlavorProfiles(params *GetFlavorProfilesParams, opts ...ClientOption) (*GetFlavorProfilesOK, error) - UpdateFlavorProfile(params *UpdateFlavorProfileParams) (*UpdateFlavorProfileOK, error) + UpdateFlavorProfile(params *UpdateFlavorProfileParams, opts ...ClientOption) (*UpdateFlavorProfileOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { Create flavor profile */ -func (a *Client) CreateFlavorProfile(params *CreateFlavorProfileParams) (*CreateFlavorProfileCreated, error) { +func (a *Client) CreateFlavorProfile(params *CreateFlavorProfileParams, opts ...ClientOption) (*CreateFlavorProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateFlavorProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createFlavorProfile", Method: "POST", PathPattern: "/iaas/api/flavor-profiles", @@ -62,7 +64,12 @@ func (a *Client) CreateFlavorProfile(params *CreateFlavorProfileParams) (*Create Reader: &CreateFlavorProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) CreateFlavorProfile(params *CreateFlavorProfileParams) (*Create Delete flavor profile with a given id */ -func (a *Client) DeleteFlavorProfile(params *DeleteFlavorProfileParams) (*DeleteFlavorProfileNoContent, error) { +func (a *Client) DeleteFlavorProfile(params *DeleteFlavorProfileParams, opts ...ClientOption) (*DeleteFlavorProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteFlavorProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteFlavorProfile", Method: "DELETE", PathPattern: "/iaas/api/flavor-profiles/{id}", @@ -98,7 +104,12 @@ func (a *Client) DeleteFlavorProfile(params *DeleteFlavorProfileParams) (*Delete Reader: &DeleteFlavorProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -117,13 +128,12 @@ func (a *Client) DeleteFlavorProfile(params *DeleteFlavorProfileParams) (*Delete Get flavor profile with a given id */ -func (a *Client) GetFlavorProfile(params *GetFlavorProfileParams) (*GetFlavorProfileOK, error) { +func (a *Client) GetFlavorProfile(params *GetFlavorProfileParams, opts ...ClientOption) (*GetFlavorProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFlavorProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFlavorProfile", Method: "GET", PathPattern: "/iaas/api/flavor-profiles/{id}", @@ -134,7 +144,12 @@ func (a *Client) GetFlavorProfile(params *GetFlavorProfileParams) (*GetFlavorPro Reader: &GetFlavorProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -153,13 +168,12 @@ func (a *Client) GetFlavorProfile(params *GetFlavorProfileParams) (*GetFlavorPro Get all flavor profile */ -func (a *Client) GetFlavorProfiles(params *GetFlavorProfilesParams) (*GetFlavorProfilesOK, error) { +func (a *Client) GetFlavorProfiles(params *GetFlavorProfilesParams, opts ...ClientOption) (*GetFlavorProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFlavorProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFlavorProfiles", Method: "GET", PathPattern: "/iaas/api/flavor-profiles", @@ -170,7 +184,12 @@ func (a *Client) GetFlavorProfiles(params *GetFlavorProfilesParams) (*GetFlavorP Reader: &GetFlavorProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -189,13 +208,12 @@ func (a *Client) GetFlavorProfiles(params *GetFlavorProfilesParams) (*GetFlavorP Update flavor profile */ -func (a *Client) UpdateFlavorProfile(params *UpdateFlavorProfileParams) (*UpdateFlavorProfileOK, error) { +func (a *Client) UpdateFlavorProfile(params *UpdateFlavorProfileParams, opts ...ClientOption) (*UpdateFlavorProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateFlavorProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateFlavorProfile", Method: "PATCH", PathPattern: "/iaas/api/flavor-profiles/{id}", @@ -206,7 +224,12 @@ func (a *Client) UpdateFlavorProfile(params *UpdateFlavorProfileParams) (*Update Reader: &UpdateFlavorProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/flavor_profile/get_flavor_profile_parameters.go b/pkg/client/flavor_profile/get_flavor_profile_parameters.go index f9783072..140bbf43 100644 --- a/pkg/client/flavor_profile/get_flavor_profile_parameters.go +++ b/pkg/client/flavor_profile/get_flavor_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFlavorProfileParams creates a new GetFlavorProfileParams object -// with the default values initialized. +// NewGetFlavorProfileParams creates a new GetFlavorProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFlavorProfileParams() *GetFlavorProfileParams { - var () return &GetFlavorProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetFlavorProfileParamsWithTimeout creates a new GetFlavorProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFlavorProfileParamsWithTimeout(timeout time.Duration) *GetFlavorProfileParams { - var () return &GetFlavorProfileParams{ - timeout: timeout, } } // NewGetFlavorProfileParamsWithContext creates a new GetFlavorProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFlavorProfileParamsWithContext(ctx context.Context) *GetFlavorProfileParams { - var () return &GetFlavorProfileParams{ - Context: ctx, } } // NewGetFlavorProfileParamsWithHTTPClient creates a new GetFlavorProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFlavorProfileParamsWithHTTPClient(client *http.Client) *GetFlavorProfileParams { - var () return &GetFlavorProfileParams{ HTTPClient: client, } } -/*GetFlavorProfileParams contains all the parameters to send to the API endpoint -for the get flavor profile operation typically these are written to a http.Request +/* GetFlavorProfileParams contains all the parameters to send to the API endpoint + for the get flavor profile operation. + + Typically these are written to a http.Request. */ type GetFlavorProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the flavor. + /* ID. + + The ID of the flavor. */ ID string @@ -76,6 +76,21 @@ type GetFlavorProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorProfileParams) WithDefaults() *GetFlavorProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get flavor profile params func (o *GetFlavorProfileParams) WithTimeout(timeout time.Duration) *GetFlavorProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetFlavorProfileParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/flavor_profile/get_flavor_profile_responses.go b/pkg/client/flavor_profile/get_flavor_profile_responses.go index b74e59cc..2a052823 100644 --- a/pkg/client/flavor_profile/get_flavor_profile_responses.go +++ b/pkg/client/flavor_profile/get_flavor_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetFlavorProfileReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetFlavorProfileOK() *GetFlavorProfileOK { return &GetFlavorProfileOK{} } -/*GetFlavorProfileOK handles this case with default header values. +/* GetFlavorProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetFlavorProfileOK struct { func (o *GetFlavorProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/flavor-profiles/{id}][%d] getFlavorProfileOK %+v", 200, o.Payload) } - func (o *GetFlavorProfileOK) GetPayload() *models.FlavorProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetFlavorProfileForbidden() *GetFlavorProfileForbidden { return &GetFlavorProfileForbidden{} } -/*GetFlavorProfileForbidden handles this case with default header values. +/* GetFlavorProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFlavorProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFlavorProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/flavor-profiles/{id}][%d] getFlavorProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/flavor-profiles/{id}][%d] getFlavorProfileForbidden %+v", 403, o.Payload) +} +func (o *GetFlavorProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFlavorProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetFlavorProfileNotFound() *GetFlavorProfileNotFound { return &GetFlavorProfileNotFound{} } -/*GetFlavorProfileNotFound handles this case with default header values. +/* GetFlavorProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetFlavorProfileNotFound struct { func (o *GetFlavorProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/flavor-profiles/{id}][%d] getFlavorProfileNotFound %+v", 404, o.Payload) } - func (o *GetFlavorProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/flavor_profile/get_flavor_profiles_parameters.go b/pkg/client/flavor_profile/get_flavor_profiles_parameters.go index c6429d5e..82061d35 100644 --- a/pkg/client/flavor_profile/get_flavor_profiles_parameters.go +++ b/pkg/client/flavor_profile/get_flavor_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFlavorProfilesParams creates a new GetFlavorProfilesParams object -// with the default values initialized. +// NewGetFlavorProfilesParams creates a new GetFlavorProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFlavorProfilesParams() *GetFlavorProfilesParams { - var () return &GetFlavorProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetFlavorProfilesParamsWithTimeout creates a new GetFlavorProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFlavorProfilesParamsWithTimeout(timeout time.Duration) *GetFlavorProfilesParams { - var () return &GetFlavorProfilesParams{ - timeout: timeout, } } // NewGetFlavorProfilesParamsWithContext creates a new GetFlavorProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFlavorProfilesParamsWithContext(ctx context.Context) *GetFlavorProfilesParams { - var () return &GetFlavorProfilesParams{ - Context: ctx, } } // NewGetFlavorProfilesParamsWithHTTPClient creates a new GetFlavorProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFlavorProfilesParamsWithHTTPClient(client *http.Client) *GetFlavorProfilesParams { - var () return &GetFlavorProfilesParams{ HTTPClient: client, } } -/*GetFlavorProfilesParams contains all the parameters to send to the API endpoint -for the get flavor profiles operation typically these are written to a http.Request +/* GetFlavorProfilesParams contains all the parameters to send to the API endpoint + for the get flavor profiles operation. + + Typically these are written to a http.Request. */ type GetFlavorProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetFlavorProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get flavor profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorProfilesParams) WithDefaults() *GetFlavorProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get flavor profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get flavor profiles params func (o *GetFlavorProfilesParams) WithTimeout(timeout time.Duration) *GetFlavorProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetFlavorProfilesParams) WriteToRequest(r runtime.ClientRequest, reg st // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/flavor_profile/get_flavor_profiles_responses.go b/pkg/client/flavor_profile/get_flavor_profiles_responses.go index 03e22768..eaa41356 100644 --- a/pkg/client/flavor_profile/get_flavor_profiles_responses.go +++ b/pkg/client/flavor_profile/get_flavor_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetFlavorProfilesReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFlavorProfilesOK() *GetFlavorProfilesOK { return &GetFlavorProfilesOK{} } -/*GetFlavorProfilesOK handles this case with default header values. +/* GetFlavorProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFlavorProfilesOK struct { func (o *GetFlavorProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/flavor-profiles][%d] getFlavorProfilesOK %+v", 200, o.Payload) } - func (o *GetFlavorProfilesOK) GetPayload() *models.FlavorProfileResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFlavorProfilesForbidden() *GetFlavorProfilesForbidden { return &GetFlavorProfilesForbidden{} } -/*GetFlavorProfilesForbidden handles this case with default header values. +/* GetFlavorProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFlavorProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFlavorProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/flavor-profiles][%d] getFlavorProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/flavor-profiles][%d] getFlavorProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetFlavorProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFlavorProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/flavor_profile/update_flavor_profile_parameters.go b/pkg/client/flavor_profile/update_flavor_profile_parameters.go index 48fecc4a..29d2c293 100644 --- a/pkg/client/flavor_profile/update_flavor_profile_parameters.go +++ b/pkg/client/flavor_profile/update_flavor_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateFlavorProfileParams creates a new UpdateFlavorProfileParams object -// with the default values initialized. +// NewUpdateFlavorProfileParams creates a new UpdateFlavorProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateFlavorProfileParams() *UpdateFlavorProfileParams { - var () return &UpdateFlavorProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateFlavorProfileParamsWithTimeout creates a new UpdateFlavorProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateFlavorProfileParamsWithTimeout(timeout time.Duration) *UpdateFlavorProfileParams { - var () return &UpdateFlavorProfileParams{ - timeout: timeout, } } // NewUpdateFlavorProfileParamsWithContext creates a new UpdateFlavorProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateFlavorProfileParamsWithContext(ctx context.Context) *UpdateFlavorProfileParams { - var () return &UpdateFlavorProfileParams{ - Context: ctx, } } // NewUpdateFlavorProfileParamsWithHTTPClient creates a new UpdateFlavorProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateFlavorProfileParamsWithHTTPClient(client *http.Client) *UpdateFlavorProfileParams { - var () return &UpdateFlavorProfileParams{ HTTPClient: client, } } -/*UpdateFlavorProfileParams contains all the parameters to send to the API endpoint -for the update flavor profile operation typically these are written to a http.Request +/* UpdateFlavorProfileParams contains all the parameters to send to the API endpoint + for the update flavor profile operation. + + Typically these are written to a http.Request. */ type UpdateFlavorProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - FlavorProfile instance + /* Body. + + FlavorProfile instance */ Body *models.UpdateFlavorProfileSpecification - /*ID - The ID of the flavor. + /* ID. + + The ID of the flavor. */ ID string @@ -83,6 +84,21 @@ type UpdateFlavorProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFlavorProfileParams) WithDefaults() *UpdateFlavorProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update flavor profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFlavorProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update flavor profile params func (o *UpdateFlavorProfileParams) WithTimeout(timeout time.Duration) *UpdateFlavorProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateFlavorProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/flavor_profile/update_flavor_profile_responses.go b/pkg/client/flavor_profile/update_flavor_profile_responses.go index dcab5049..1ebb7cfe 100644 --- a/pkg/client/flavor_profile/update_flavor_profile_responses.go +++ b/pkg/client/flavor_profile/update_flavor_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateFlavorProfileReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateFlavorProfileOK() *UpdateFlavorProfileOK { return &UpdateFlavorProfileOK{} } -/*UpdateFlavorProfileOK handles this case with default header values. +/* UpdateFlavorProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateFlavorProfileOK struct { func (o *UpdateFlavorProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/flavor-profiles/{id}][%d] updateFlavorProfileOK %+v", 200, o.Payload) } - func (o *UpdateFlavorProfileOK) GetPayload() *models.FlavorProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateFlavorProfileForbidden() *UpdateFlavorProfileForbidden { return &UpdateFlavorProfileForbidden{} } -/*UpdateFlavorProfileForbidden handles this case with default header values. +/* UpdateFlavorProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateFlavorProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateFlavorProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/flavor-profiles/{id}][%d] updateFlavorProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/flavor-profiles/{id}][%d] updateFlavorProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateFlavorProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateFlavorProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateFlavorProfileNotFound() *UpdateFlavorProfileNotFound { return &UpdateFlavorProfileNotFound{} } -/*UpdateFlavorProfileNotFound handles this case with default header values. +/* UpdateFlavorProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateFlavorProfileNotFound struct { func (o *UpdateFlavorProfileNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/flavor-profiles/{id}][%d] updateFlavorProfileNotFound %+v", 404, o.Payload) } - func (o *UpdateFlavorProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/flavors/flavors_client.go b/pkg/client/flavors/flavors_client.go index 2c98bc4a..d0d05b32 100644 --- a/pkg/client/flavors/flavors_client.go +++ b/pkg/client/flavors/flavors_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetFlavors(params *GetFlavorsParams) (*GetFlavorsOK, error) + GetFlavors(params *GetFlavorsParams, opts ...ClientOption) (*GetFlavorsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Get all flavors defined in FlavorProfile */ -func (a *Client) GetFlavors(params *GetFlavorsParams) (*GetFlavorsOK, error) { +func (a *Client) GetFlavors(params *GetFlavorsParams, opts ...ClientOption) (*GetFlavorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFlavorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getFlavors", Method: "GET", PathPattern: "/iaas/api/flavors", @@ -54,7 +56,12 @@ func (a *Client) GetFlavors(params *GetFlavorsParams) (*GetFlavorsOK, error) { Reader: &GetFlavorsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/flavors/get_flavors_parameters.go b/pkg/client/flavors/get_flavors_parameters.go index e428b744..74fb582a 100644 --- a/pkg/client/flavors/get_flavors_parameters.go +++ b/pkg/client/flavors/get_flavors_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFlavorsParams creates a new GetFlavorsParams object -// with the default values initialized. +// NewGetFlavorsParams creates a new GetFlavorsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetFlavorsParams() *GetFlavorsParams { - var () return &GetFlavorsParams{ - timeout: cr.DefaultTimeout, } } // NewGetFlavorsParamsWithTimeout creates a new GetFlavorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFlavorsParamsWithTimeout(timeout time.Duration) *GetFlavorsParams { - var () return &GetFlavorsParams{ - timeout: timeout, } } // NewGetFlavorsParamsWithContext creates a new GetFlavorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFlavorsParamsWithContext(ctx context.Context) *GetFlavorsParams { - var () return &GetFlavorsParams{ - Context: ctx, } } // NewGetFlavorsParamsWithHTTPClient creates a new GetFlavorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFlavorsParamsWithHTTPClient(client *http.Client) *GetFlavorsParams { - var () return &GetFlavorsParams{ HTTPClient: client, } } -/*GetFlavorsParams contains all the parameters to send to the API endpoint -for the get flavors operation typically these are written to a http.Request +/* GetFlavorsParams contains all the parameters to send to the API endpoint + for the get flavors operation. + + Typically these are written to a http.Request. */ type GetFlavorsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetFlavorsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get flavors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorsParams) WithDefaults() *GetFlavorsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get flavors params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFlavorsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get flavors params func (o *GetFlavorsParams) WithTimeout(timeout time.Duration) *GetFlavorsParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetFlavorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/flavors/get_flavors_responses.go b/pkg/client/flavors/get_flavors_responses.go index bd5ca78a..41118f45 100644 --- a/pkg/client/flavors/get_flavors_responses.go +++ b/pkg/client/flavors/get_flavors_responses.go @@ -35,7 +35,6 @@ func (o *GetFlavorsReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetFlavorsOK() *GetFlavorsOK { return &GetFlavorsOK{} } -/*GetFlavorsOK handles this case with default header values. +/* GetFlavorsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetFlavorsOK struct { func (o *GetFlavorsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/flavors][%d] getFlavorsOK %+v", 200, o.Payload) } - func (o *GetFlavorsOK) GetPayload() *models.FlavorResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetFlavorsForbidden() *GetFlavorsForbidden { return &GetFlavorsForbidden{} } -/*GetFlavorsForbidden handles this case with default header values. +/* GetFlavorsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetFlavorsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetFlavorsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/flavors][%d] getFlavorsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/flavors][%d] getFlavorsForbidden %+v", 403, o.Payload) +} +func (o *GetFlavorsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetFlavorsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/icons/delete_parameters.go b/pkg/client/icons/delete_parameters.go index 7e8cce0c..4ac6dc4e 100644 --- a/pkg/client/icons/delete_parameters.go +++ b/pkg/client/icons/delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteParams creates a new DeleteParams object -// with the default values initialized. +// NewDeleteParams creates a new DeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteParams() *DeleteParams { - var () return &DeleteParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteParamsWithTimeout creates a new DeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { - var () return &DeleteParams{ - timeout: timeout, } } // NewDeleteParamsWithContext creates a new DeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { - var () return &DeleteParams{ - Context: ctx, } } // NewDeleteParamsWithHTTPClient creates a new DeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { - var () return &DeleteParams{ HTTPClient: client, } } -/*DeleteParams contains all the parameters to send to the API endpoint -for the delete operation typically these are written to a http.Request +/* DeleteParams contains all the parameters to send to the API endpoint + for the delete operation. + + Typically these are written to a http.Request. */ type DeleteParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Icon id + /* ID. + + Icon id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) WithDefaults() *DeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete params func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/icons/delete_responses.go b/pkg/client/icons/delete_responses.go index f46c84b5..ac1897c2 100644 --- a/pkg/client/icons/delete_responses.go +++ b/pkg/client/icons/delete_responses.go @@ -32,7 +32,6 @@ func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +42,7 @@ func NewDeleteNoContent() *DeleteNoContent { return &DeleteNoContent{} } -/*DeleteNoContent handles this case with default header values. +/* DeleteNoContent describes a response with status code 204, with default header values. Success - delete the icon */ @@ -64,7 +63,7 @@ func NewDeleteForbidden() *DeleteForbidden { return &DeleteForbidden{} } -/*DeleteForbidden handles this case with default header values. +/* DeleteForbidden describes a response with status code 403, with default header values. Forbidden. */ diff --git a/pkg/client/icons/download_parameters.go b/pkg/client/icons/download_parameters.go index 1fc6d0c5..b3cc6edd 100644 --- a/pkg/client/icons/download_parameters.go +++ b/pkg/client/icons/download_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDownloadParams creates a new DownloadParams object -// with the default values initialized. +// NewDownloadParams creates a new DownloadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDownloadParams() *DownloadParams { - var () return &DownloadParams{ - timeout: cr.DefaultTimeout, } } // NewDownloadParamsWithTimeout creates a new DownloadParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDownloadParamsWithTimeout(timeout time.Duration) *DownloadParams { - var () return &DownloadParams{ - timeout: timeout, } } // NewDownloadParamsWithContext creates a new DownloadParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDownloadParamsWithContext(ctx context.Context) *DownloadParams { - var () return &DownloadParams{ - Context: ctx, } } // NewDownloadParamsWithHTTPClient creates a new DownloadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDownloadParamsWithHTTPClient(client *http.Client) *DownloadParams { - var () return &DownloadParams{ HTTPClient: client, } } -/*DownloadParams contains all the parameters to send to the API endpoint -for the download operation typically these are written to a http.Request +/* DownloadParams contains all the parameters to send to the API endpoint + for the download operation. + + Typically these are written to a http.Request. */ type DownloadParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Icon id + /* ID. + + Icon id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DownloadParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the download params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadParams) WithDefaults() *DownloadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the download params func (o *DownloadParams) WithTimeout(timeout time.Duration) *DownloadParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DownloadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/icons/download_responses.go b/pkg/client/icons/download_responses.go index 90d50d94..1e0c7f45 100644 --- a/pkg/client/icons/download_responses.go +++ b/pkg/client/icons/download_responses.go @@ -41,7 +41,6 @@ func (o *DownloadReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewDownloadOK() *DownloadOK { return &DownloadOK{} } -/*DownloadOK handles this case with default header values. +/* DownloadOK describes a response with status code 200, with default header values. Success - return the catalog icon. */ @@ -63,7 +62,6 @@ type DownloadOK struct { func (o *DownloadOK) Error() string { return fmt.Sprintf("[GET /icon/api/icons/{id}][%d] downloadOK %+v", 200, o.Payload) } - func (o *DownloadOK) GetPayload() strfmt.Base64 { return o.Payload } @@ -83,7 +81,7 @@ func NewDownloadBadRequest() *DownloadBadRequest { return &DownloadBadRequest{} } -/*DownloadBadRequest handles this case with default header values. +/* DownloadBadRequest describes a response with status code 400, with default header values. Invalid request - bad data. */ @@ -94,7 +92,6 @@ type DownloadBadRequest struct { func (o *DownloadBadRequest) Error() string { return fmt.Sprintf("[GET /icon/api/icons/{id}][%d] downloadBadRequest %+v", 400, o.Payload) } - func (o *DownloadBadRequest) GetPayload() *models.Error { return o.Payload } @@ -116,7 +113,7 @@ func NewDownloadNotFound() *DownloadNotFound { return &DownloadNotFound{} } -/*DownloadNotFound handles this case with default header values. +/* DownloadNotFound describes a response with status code 404, with default header values. Icon not found. */ @@ -127,7 +124,6 @@ type DownloadNotFound struct { func (o *DownloadNotFound) Error() string { return fmt.Sprintf("[GET /icon/api/icons/{id}][%d] downloadNotFound %+v", 404, o.Payload) } - func (o *DownloadNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/icons/icons_client.go b/pkg/client/icons/icons_client.go index 0a30b021..6376a8ac 100644 --- a/pkg/client/icons/icons_client.go +++ b/pkg/client/icons/icons_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - Delete(params *DeleteParams) (*DeleteNoContent, error) + Delete(params *DeleteParams, opts ...ClientOption) (*DeleteNoContent, error) - Download(params *DownloadParams) (*DownloadOK, error) + Download(params *DownloadParams, opts ...ClientOption) (*DownloadOK, error) - Upload(params *UploadParams) (*UploadCreated, error) + Upload(params *UploadParams, opts ...ClientOption) (*UploadCreated, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Delete an existing icon by its unique id. */ -func (a *Client) Delete(params *DeleteParams) (*DeleteNoContent, error) { +func (a *Client) Delete(params *DeleteParams, opts ...ClientOption) (*DeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "delete", Method: "DELETE", PathPattern: "/icon/api/icons/{id}", @@ -58,7 +60,12 @@ func (a *Client) Delete(params *DeleteParams) (*DeleteNoContent, error) { Reader: &DeleteReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) Delete(params *DeleteParams) (*DeleteNoContent, error) { Download an existing icon by its unique id. */ -func (a *Client) Download(params *DownloadParams) (*DownloadOK, error) { +func (a *Client) Download(params *DownloadParams, opts ...ClientOption) (*DownloadOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDownloadParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "download", Method: "GET", PathPattern: "/icon/api/icons/{id}", @@ -94,7 +100,12 @@ func (a *Client) Download(params *DownloadParams) (*DownloadOK, error) { Reader: &DownloadReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) Download(params *DownloadParams) (*DownloadOK, error) { Create an icon. */ -func (a *Client) Upload(params *UploadParams) (*UploadCreated, error) { +func (a *Client) Upload(params *UploadParams, opts ...ClientOption) (*UploadCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewUploadParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "upload", Method: "POST", PathPattern: "/icon/api/icons", @@ -130,7 +140,12 @@ func (a *Client) Upload(params *UploadParams) (*UploadCreated, error) { Reader: &UploadReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/icons/upload_parameters.go b/pkg/client/icons/upload_parameters.go index 0a8be2bf..6d6be03e 100644 --- a/pkg/client/icons/upload_parameters.go +++ b/pkg/client/icons/upload_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUploadParams creates a new UploadParams object -// with the default values initialized. +// NewUploadParams creates a new UploadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUploadParams() *UploadParams { - var () return &UploadParams{ - timeout: cr.DefaultTimeout, } } // NewUploadParamsWithTimeout creates a new UploadParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUploadParamsWithTimeout(timeout time.Duration) *UploadParams { - var () return &UploadParams{ - timeout: timeout, } } // NewUploadParamsWithContext creates a new UploadParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUploadParamsWithContext(ctx context.Context) *UploadParams { - var () return &UploadParams{ - Context: ctx, } } // NewUploadParamsWithHTTPClient creates a new UploadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUploadParamsWithHTTPClient(client *http.Client) *UploadParams { - var () return &UploadParams{ HTTPClient: client, } } -/*UploadParams contains all the parameters to send to the API endpoint -for the upload operation typically these are written to a http.Request +/* UploadParams contains all the parameters to send to the API endpoint + for the upload operation. + + Typically these are written to a http.Request. */ type UploadParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*File - Icon file + /* File. + + Icon file */ File runtime.NamedReadCloser @@ -76,6 +76,21 @@ type UploadParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadParams) WithDefaults() *UploadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the upload params func (o *UploadParams) WithTimeout(timeout time.Duration) *UploadParams { o.SetTimeout(timeout) @@ -143,18 +158,18 @@ func (o *UploadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - // form file param file if err := r.SetFileParam("file", o.File); err != nil { return err diff --git a/pkg/client/icons/upload_responses.go b/pkg/client/icons/upload_responses.go index 1e412a70..940e888c 100644 --- a/pkg/client/icons/upload_responses.go +++ b/pkg/client/icons/upload_responses.go @@ -41,7 +41,6 @@ func (o *UploadReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUploadCreated() *UploadCreated { return &UploadCreated{} } -/*UploadCreated handles this case with default header values. +/* UploadCreated describes a response with status code 201, with default header values. Success - create an icon. */ @@ -73,7 +72,7 @@ func NewUploadBadRequest() *UploadBadRequest { return &UploadBadRequest{} } -/*UploadBadRequest handles this case with default header values. +/* UploadBadRequest describes a response with status code 400, with default header values. Invalid request - bad data. */ @@ -84,7 +83,6 @@ type UploadBadRequest struct { func (o *UploadBadRequest) Error() string { return fmt.Sprintf("[POST /icon/api/icons][%d] uploadBadRequest %+v", 400, o.Payload) } - func (o *UploadBadRequest) GetPayload() *models.Error { return o.Payload } @@ -106,7 +104,7 @@ func NewUploadForbidden() *UploadForbidden { return &UploadForbidden{} } -/*UploadForbidden handles this case with default header values. +/* UploadForbidden describes a response with status code 403, with default header values. Forbidden. */ diff --git a/pkg/client/image_profile/create_image_profile_parameters.go b/pkg/client/image_profile/create_image_profile_parameters.go index 71dce6e3..b6a672bd 100644 --- a/pkg/client/image_profile/create_image_profile_parameters.go +++ b/pkg/client/image_profile/create_image_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateImageProfileParams creates a new CreateImageProfileParams object -// with the default values initialized. +// NewCreateImageProfileParams creates a new CreateImageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateImageProfileParams() *CreateImageProfileParams { - var () return &CreateImageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateImageProfileParamsWithTimeout creates a new CreateImageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateImageProfileParamsWithTimeout(timeout time.Duration) *CreateImageProfileParams { - var () return &CreateImageProfileParams{ - timeout: timeout, } } // NewCreateImageProfileParamsWithContext creates a new CreateImageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateImageProfileParamsWithContext(ctx context.Context) *CreateImageProfileParams { - var () return &CreateImageProfileParams{ - Context: ctx, } } // NewCreateImageProfileParamsWithHTTPClient creates a new CreateImageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateImageProfileParamsWithHTTPClient(client *http.Client) *CreateImageProfileParams { - var () return &CreateImageProfileParams{ HTTPClient: client, } } -/*CreateImageProfileParams contains all the parameters to send to the API endpoint -for the create image profile operation typically these are written to a http.Request +/* CreateImageProfileParams contains all the parameters to send to the API endpoint + for the create image profile operation. + + Typically these are written to a http.Request. */ type CreateImageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - ImageProfile instance + /* Body. + + ImageProfile instance */ Body *models.ImageProfileSpecification @@ -78,6 +78,21 @@ type CreateImageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateImageProfileParams) WithDefaults() *CreateImageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateImageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create image profile params func (o *CreateImageProfileParams) WithTimeout(timeout time.Duration) *CreateImageProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateImageProfileParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/image_profile/create_image_profile_responses.go b/pkg/client/image_profile/create_image_profile_responses.go index 2ec6e0cb..8b7eb7bc 100644 --- a/pkg/client/image_profile/create_image_profile_responses.go +++ b/pkg/client/image_profile/create_image_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateImageProfileReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateImageProfileCreated() *CreateImageProfileCreated { return &CreateImageProfileCreated{} } -/*CreateImageProfileCreated handles this case with default header values. +/* CreateImageProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateImageProfileCreated struct { func (o *CreateImageProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/image-profiles][%d] createImageProfileCreated %+v", 201, o.Payload) } - func (o *CreateImageProfileCreated) GetPayload() *models.ImageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateImageProfileBadRequest() *CreateImageProfileBadRequest { return &CreateImageProfileBadRequest{} } -/*CreateImageProfileBadRequest handles this case with default header values. +/* CreateImageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateImageProfileBadRequest struct { func (o *CreateImageProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/image-profiles][%d] createImageProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateImageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateImageProfileForbidden() *CreateImageProfileForbidden { return &CreateImageProfileForbidden{} } -/*CreateImageProfileForbidden handles this case with default header values. +/* CreateImageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateImageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateImageProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/image-profiles][%d] createImageProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/image-profiles][%d] createImageProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateImageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateImageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/image_profile/delete_image_profile_parameters.go b/pkg/client/image_profile/delete_image_profile_parameters.go index d7026730..abbac297 100644 --- a/pkg/client/image_profile/delete_image_profile_parameters.go +++ b/pkg/client/image_profile/delete_image_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteImageProfileParams creates a new DeleteImageProfileParams object -// with the default values initialized. +// NewDeleteImageProfileParams creates a new DeleteImageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteImageProfileParams() *DeleteImageProfileParams { - var () return &DeleteImageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteImageProfileParamsWithTimeout creates a new DeleteImageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteImageProfileParamsWithTimeout(timeout time.Duration) *DeleteImageProfileParams { - var () return &DeleteImageProfileParams{ - timeout: timeout, } } // NewDeleteImageProfileParamsWithContext creates a new DeleteImageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteImageProfileParamsWithContext(ctx context.Context) *DeleteImageProfileParams { - var () return &DeleteImageProfileParams{ - Context: ctx, } } // NewDeleteImageProfileParamsWithHTTPClient creates a new DeleteImageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteImageProfileParamsWithHTTPClient(client *http.Client) *DeleteImageProfileParams { - var () return &DeleteImageProfileParams{ HTTPClient: client, } } -/*DeleteImageProfileParams contains all the parameters to send to the API endpoint -for the delete image profile operation typically these are written to a http.Request +/* DeleteImageProfileParams contains all the parameters to send to the API endpoint + for the delete image profile operation. + + Typically these are written to a http.Request. */ type DeleteImageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the image. + /* ID. + + The ID of the image. */ ID string @@ -76,6 +76,21 @@ type DeleteImageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteImageProfileParams) WithDefaults() *DeleteImageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteImageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete image profile params func (o *DeleteImageProfileParams) WithTimeout(timeout time.Duration) *DeleteImageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteImageProfileParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/image_profile/delete_image_profile_responses.go b/pkg/client/image_profile/delete_image_profile_responses.go index 270eb901..88e2e007 100644 --- a/pkg/client/image_profile/delete_image_profile_responses.go +++ b/pkg/client/image_profile/delete_image_profile_responses.go @@ -7,9 +7,12 @@ package image_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteImageProfileReader is a Reader for the DeleteImageProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteImageProfileReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteImageProfileNoContent() *DeleteImageProfileNoContent { return &DeleteImageProfileNoContent{} } -/*DeleteImageProfileNoContent handles this case with default header values. +/* DeleteImageProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteImageProfileForbidden() *DeleteImageProfileForbidden { return &DeleteImageProfileForbidden{} } -/*DeleteImageProfileForbidden handles this case with default header values. +/* DeleteImageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteImageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteImageProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/image-profiles/{id}][%d] deleteImageProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/image-profiles/{id}][%d] deleteImageProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteImageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteImageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/image_profile/get_image_profile_parameters.go b/pkg/client/image_profile/get_image_profile_parameters.go index 1ae05c55..df37d4d2 100644 --- a/pkg/client/image_profile/get_image_profile_parameters.go +++ b/pkg/client/image_profile/get_image_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetImageProfileParams creates a new GetImageProfileParams object -// with the default values initialized. +// NewGetImageProfileParams creates a new GetImageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetImageProfileParams() *GetImageProfileParams { - var () return &GetImageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetImageProfileParamsWithTimeout creates a new GetImageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetImageProfileParamsWithTimeout(timeout time.Duration) *GetImageProfileParams { - var () return &GetImageProfileParams{ - timeout: timeout, } } // NewGetImageProfileParamsWithContext creates a new GetImageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetImageProfileParamsWithContext(ctx context.Context) *GetImageProfileParams { - var () return &GetImageProfileParams{ - Context: ctx, } } // NewGetImageProfileParamsWithHTTPClient creates a new GetImageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetImageProfileParamsWithHTTPClient(client *http.Client) *GetImageProfileParams { - var () return &GetImageProfileParams{ HTTPClient: client, } } -/*GetImageProfileParams contains all the parameters to send to the API endpoint -for the get image profile operation typically these are written to a http.Request +/* GetImageProfileParams contains all the parameters to send to the API endpoint + for the get image profile operation. + + Typically these are written to a http.Request. */ type GetImageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the image. + /* ID. + + The ID of the image. */ ID string @@ -76,6 +76,21 @@ type GetImageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImageProfileParams) WithDefaults() *GetImageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get image profile params func (o *GetImageProfileParams) WithTimeout(timeout time.Duration) *GetImageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetImageProfileParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/image_profile/get_image_profile_responses.go b/pkg/client/image_profile/get_image_profile_responses.go index cf465048..2daae7ef 100644 --- a/pkg/client/image_profile/get_image_profile_responses.go +++ b/pkg/client/image_profile/get_image_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetImageProfileReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetImageProfileOK() *GetImageProfileOK { return &GetImageProfileOK{} } -/*GetImageProfileOK handles this case with default header values. +/* GetImageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetImageProfileOK struct { func (o *GetImageProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/image-profiles/{id}][%d] getImageProfileOK %+v", 200, o.Payload) } - func (o *GetImageProfileOK) GetPayload() *models.ImageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetImageProfileForbidden() *GetImageProfileForbidden { return &GetImageProfileForbidden{} } -/*GetImageProfileForbidden handles this case with default header values. +/* GetImageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetImageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetImageProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/image-profiles/{id}][%d] getImageProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/image-profiles/{id}][%d] getImageProfileForbidden %+v", 403, o.Payload) +} +func (o *GetImageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetImageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetImageProfileNotFound() *GetImageProfileNotFound { return &GetImageProfileNotFound{} } -/*GetImageProfileNotFound handles this case with default header values. +/* GetImageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetImageProfileNotFound struct { func (o *GetImageProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/image-profiles/{id}][%d] getImageProfileNotFound %+v", 404, o.Payload) } - func (o *GetImageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/image_profile/get_image_profiles_parameters.go b/pkg/client/image_profile/get_image_profiles_parameters.go index c98e34fc..6503663f 100644 --- a/pkg/client/image_profile/get_image_profiles_parameters.go +++ b/pkg/client/image_profile/get_image_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetImageProfilesParams creates a new GetImageProfilesParams object -// with the default values initialized. +// NewGetImageProfilesParams creates a new GetImageProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetImageProfilesParams() *GetImageProfilesParams { - var () return &GetImageProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetImageProfilesParamsWithTimeout creates a new GetImageProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetImageProfilesParamsWithTimeout(timeout time.Duration) *GetImageProfilesParams { - var () return &GetImageProfilesParams{ - timeout: timeout, } } // NewGetImageProfilesParamsWithContext creates a new GetImageProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetImageProfilesParamsWithContext(ctx context.Context) *GetImageProfilesParams { - var () return &GetImageProfilesParams{ - Context: ctx, } } // NewGetImageProfilesParamsWithHTTPClient creates a new GetImageProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetImageProfilesParamsWithHTTPClient(client *http.Client) *GetImageProfilesParams { - var () return &GetImageProfilesParams{ HTTPClient: client, } } -/*GetImageProfilesParams contains all the parameters to send to the API endpoint -for the get image profiles operation typically these are written to a http.Request +/* GetImageProfilesParams contains all the parameters to send to the API endpoint + for the get image profiles operation. + + Typically these are written to a http.Request. */ type GetImageProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetImageProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get image profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImageProfilesParams) WithDefaults() *GetImageProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get image profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImageProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get image profiles params func (o *GetImageProfilesParams) WithTimeout(timeout time.Duration) *GetImageProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetImageProfilesParams) WriteToRequest(r runtime.ClientRequest, reg str // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/image_profile/get_image_profiles_responses.go b/pkg/client/image_profile/get_image_profiles_responses.go index 727ba5e7..c26b03e1 100644 --- a/pkg/client/image_profile/get_image_profiles_responses.go +++ b/pkg/client/image_profile/get_image_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetImageProfilesReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetImageProfilesOK() *GetImageProfilesOK { return &GetImageProfilesOK{} } -/*GetImageProfilesOK handles this case with default header values. +/* GetImageProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetImageProfilesOK struct { func (o *GetImageProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/image-profiles][%d] getImageProfilesOK %+v", 200, o.Payload) } - func (o *GetImageProfilesOK) GetPayload() *models.ImageProfileResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetImageProfilesForbidden() *GetImageProfilesForbidden { return &GetImageProfilesForbidden{} } -/*GetImageProfilesForbidden handles this case with default header values. +/* GetImageProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetImageProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetImageProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/image-profiles][%d] getImageProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/image-profiles][%d] getImageProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetImageProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetImageProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/image_profile/image_profile_client.go b/pkg/client/image_profile/image_profile_client.go index cb7f6581..04c018bc 100644 --- a/pkg/client/image_profile/image_profile_client.go +++ b/pkg/client/image_profile/image_profile_client.go @@ -25,17 +25,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateImageProfile(params *CreateImageProfileParams) (*CreateImageProfileCreated, error) + CreateImageProfile(params *CreateImageProfileParams, opts ...ClientOption) (*CreateImageProfileCreated, error) - DeleteImageProfile(params *DeleteImageProfileParams) (*DeleteImageProfileNoContent, error) + DeleteImageProfile(params *DeleteImageProfileParams, opts ...ClientOption) (*DeleteImageProfileNoContent, error) - GetImageProfile(params *GetImageProfileParams) (*GetImageProfileOK, error) + GetImageProfile(params *GetImageProfileParams, opts ...ClientOption) (*GetImageProfileOK, error) - GetImageProfiles(params *GetImageProfilesParams) (*GetImageProfilesOK, error) + GetImageProfiles(params *GetImageProfilesParams, opts ...ClientOption) (*GetImageProfilesOK, error) - UpdateImageProfile(params *UpdateImageProfileParams) (*UpdateImageProfileOK, error) + UpdateImageProfile(params *UpdateImageProfileParams, opts ...ClientOption) (*UpdateImageProfileOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { Create image profile */ -func (a *Client) CreateImageProfile(params *CreateImageProfileParams) (*CreateImageProfileCreated, error) { +func (a *Client) CreateImageProfile(params *CreateImageProfileParams, opts ...ClientOption) (*CreateImageProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateImageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createImageProfile", Method: "POST", PathPattern: "/iaas/api/image-profiles", @@ -62,7 +64,12 @@ func (a *Client) CreateImageProfile(params *CreateImageProfileParams) (*CreateIm Reader: &CreateImageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) CreateImageProfile(params *CreateImageProfileParams) (*CreateIm Delete image profile with a given id */ -func (a *Client) DeleteImageProfile(params *DeleteImageProfileParams) (*DeleteImageProfileNoContent, error) { +func (a *Client) DeleteImageProfile(params *DeleteImageProfileParams, opts ...ClientOption) (*DeleteImageProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteImageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteImageProfile", Method: "DELETE", PathPattern: "/iaas/api/image-profiles/{id}", @@ -98,7 +104,12 @@ func (a *Client) DeleteImageProfile(params *DeleteImageProfileParams) (*DeleteIm Reader: &DeleteImageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -117,13 +128,12 @@ func (a *Client) DeleteImageProfile(params *DeleteImageProfileParams) (*DeleteIm Get image profile with a given id */ -func (a *Client) GetImageProfile(params *GetImageProfileParams) (*GetImageProfileOK, error) { +func (a *Client) GetImageProfile(params *GetImageProfileParams, opts ...ClientOption) (*GetImageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetImageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getImageProfile", Method: "GET", PathPattern: "/iaas/api/image-profiles/{id}", @@ -134,7 +144,12 @@ func (a *Client) GetImageProfile(params *GetImageProfileParams) (*GetImageProfil Reader: &GetImageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -153,13 +168,12 @@ func (a *Client) GetImageProfile(params *GetImageProfileParams) (*GetImageProfil Get all image profiles */ -func (a *Client) GetImageProfiles(params *GetImageProfilesParams) (*GetImageProfilesOK, error) { +func (a *Client) GetImageProfiles(params *GetImageProfilesParams, opts ...ClientOption) (*GetImageProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetImageProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getImageProfiles", Method: "GET", PathPattern: "/iaas/api/image-profiles", @@ -170,7 +184,12 @@ func (a *Client) GetImageProfiles(params *GetImageProfilesParams) (*GetImageProf Reader: &GetImageProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -189,13 +208,12 @@ func (a *Client) GetImageProfiles(params *GetImageProfilesParams) (*GetImageProf Update image profile */ -func (a *Client) UpdateImageProfile(params *UpdateImageProfileParams) (*UpdateImageProfileOK, error) { +func (a *Client) UpdateImageProfile(params *UpdateImageProfileParams, opts ...ClientOption) (*UpdateImageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateImageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateImageProfile", Method: "PATCH", PathPattern: "/iaas/api/image-profiles/{id}", @@ -206,7 +224,12 @@ func (a *Client) UpdateImageProfile(params *UpdateImageProfileParams) (*UpdateIm Reader: &UpdateImageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/image_profile/update_image_profile_parameters.go b/pkg/client/image_profile/update_image_profile_parameters.go index 089eba18..5968e5f2 100644 --- a/pkg/client/image_profile/update_image_profile_parameters.go +++ b/pkg/client/image_profile/update_image_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateImageProfileParams creates a new UpdateImageProfileParams object -// with the default values initialized. +// NewUpdateImageProfileParams creates a new UpdateImageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateImageProfileParams() *UpdateImageProfileParams { - var () return &UpdateImageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateImageProfileParamsWithTimeout creates a new UpdateImageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateImageProfileParamsWithTimeout(timeout time.Duration) *UpdateImageProfileParams { - var () return &UpdateImageProfileParams{ - timeout: timeout, } } // NewUpdateImageProfileParamsWithContext creates a new UpdateImageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateImageProfileParamsWithContext(ctx context.Context) *UpdateImageProfileParams { - var () return &UpdateImageProfileParams{ - Context: ctx, } } // NewUpdateImageProfileParamsWithHTTPClient creates a new UpdateImageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateImageProfileParamsWithHTTPClient(client *http.Client) *UpdateImageProfileParams { - var () return &UpdateImageProfileParams{ HTTPClient: client, } } -/*UpdateImageProfileParams contains all the parameters to send to the API endpoint -for the update image profile operation typically these are written to a http.Request +/* UpdateImageProfileParams contains all the parameters to send to the API endpoint + for the update image profile operation. + + Typically these are written to a http.Request. */ type UpdateImageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - ImageProfile instance + /* Body. + + ImageProfile instance */ Body *models.UpdateImageProfileSpecification - /*ID - The ID of the image. + /* ID. + + The ID of the image. */ ID string @@ -83,6 +84,21 @@ type UpdateImageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateImageProfileParams) WithDefaults() *UpdateImageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update image profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateImageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update image profile params func (o *UpdateImageProfileParams) WithTimeout(timeout time.Duration) *UpdateImageProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateImageProfileParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/image_profile/update_image_profile_responses.go b/pkg/client/image_profile/update_image_profile_responses.go index 1e8a0e73..53c57954 100644 --- a/pkg/client/image_profile/update_image_profile_responses.go +++ b/pkg/client/image_profile/update_image_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateImageProfileReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateImageProfileOK() *UpdateImageProfileOK { return &UpdateImageProfileOK{} } -/*UpdateImageProfileOK handles this case with default header values. +/* UpdateImageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateImageProfileOK struct { func (o *UpdateImageProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/image-profiles/{id}][%d] updateImageProfileOK %+v", 200, o.Payload) } - func (o *UpdateImageProfileOK) GetPayload() *models.ImageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateImageProfileForbidden() *UpdateImageProfileForbidden { return &UpdateImageProfileForbidden{} } -/*UpdateImageProfileForbidden handles this case with default header values. +/* UpdateImageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateImageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateImageProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/image-profiles/{id}][%d] updateImageProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/image-profiles/{id}][%d] updateImageProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateImageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateImageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateImageProfileNotFound() *UpdateImageProfileNotFound { return &UpdateImageProfileNotFound{} } -/*UpdateImageProfileNotFound handles this case with default header values. +/* UpdateImageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateImageProfileNotFound struct { func (o *UpdateImageProfileNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/image-profiles/{id}][%d] updateImageProfileNotFound %+v", 404, o.Payload) } - func (o *UpdateImageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/images/get_images_parameters.go b/pkg/client/images/get_images_parameters.go index 85874fa6..978b5a38 100644 --- a/pkg/client/images/get_images_parameters.go +++ b/pkg/client/images/get_images_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetImagesParams creates a new GetImagesParams object -// with the default values initialized. +// NewGetImagesParams creates a new GetImagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetImagesParams() *GetImagesParams { - var () return &GetImagesParams{ - timeout: cr.DefaultTimeout, } } // NewGetImagesParamsWithTimeout creates a new GetImagesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetImagesParamsWithTimeout(timeout time.Duration) *GetImagesParams { - var () return &GetImagesParams{ - timeout: timeout, } } // NewGetImagesParamsWithContext creates a new GetImagesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetImagesParamsWithContext(ctx context.Context) *GetImagesParams { - var () return &GetImagesParams{ - Context: ctx, } } // NewGetImagesParamsWithHTTPClient creates a new GetImagesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetImagesParamsWithHTTPClient(client *http.Client) *GetImagesParams { - var () return &GetImagesParams{ HTTPClient: client, } } -/*GetImagesParams contains all the parameters to send to the API endpoint -for the get images operation typically these are written to a http.Request +/* GetImagesParams contains all the parameters to send to the API endpoint + for the get images operation. + + Typically these are written to a http.Request. */ type GetImagesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetImagesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImagesParams) WithDefaults() *GetImagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetImagesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get images params func (o *GetImagesParams) WithTimeout(timeout time.Duration) *GetImagesParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetImagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/images/get_images_responses.go b/pkg/client/images/get_images_responses.go index b993573e..217d90a2 100644 --- a/pkg/client/images/get_images_responses.go +++ b/pkg/client/images/get_images_responses.go @@ -35,7 +35,6 @@ func (o *GetImagesReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetImagesOK() *GetImagesOK { return &GetImagesOK{} } -/*GetImagesOK handles this case with default header values. +/* GetImagesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetImagesOK struct { func (o *GetImagesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/images][%d] getImagesOK %+v", 200, o.Payload) } - func (o *GetImagesOK) GetPayload() *models.ImageResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetImagesForbidden() *GetImagesForbidden { return &GetImagesForbidden{} } -/*GetImagesForbidden handles this case with default header values. +/* GetImagesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetImagesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetImagesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/images][%d] getImagesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/images][%d] getImagesForbidden %+v", 403, o.Payload) +} +func (o *GetImagesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetImagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/images/images_client.go b/pkg/client/images/images_client.go index 8bab5c68..1b7c4634 100644 --- a/pkg/client/images/images_client.go +++ b/pkg/client/images/images_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetImages(params *GetImagesParams) (*GetImagesOK, error) + GetImages(params *GetImagesParams, opts ...ClientOption) (*GetImagesOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Get all images defined in ImageProfile. */ -func (a *Client) GetImages(params *GetImagesParams) (*GetImagesOK, error) { +func (a *Client) GetImages(params *GetImagesParams, opts ...ClientOption) (*GetImagesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetImagesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getImages", Method: "GET", PathPattern: "/iaas/api/images", @@ -54,7 +56,12 @@ func (a *Client) GetImages(params *GetImagesParams) (*GetImagesOK, error) { Reader: &GetImagesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/load_balancer/create_load_balancer_parameters.go b/pkg/client/load_balancer/create_load_balancer_parameters.go index 3c4b5b77..4a61fed6 100644 --- a/pkg/client/load_balancer/create_load_balancer_parameters.go +++ b/pkg/client/load_balancer/create_load_balancer_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateLoadBalancerParams creates a new CreateLoadBalancerParams object -// with the default values initialized. +// NewCreateLoadBalancerParams creates a new CreateLoadBalancerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateLoadBalancerParams() *CreateLoadBalancerParams { - var () return &CreateLoadBalancerParams{ - timeout: cr.DefaultTimeout, } } // NewCreateLoadBalancerParamsWithTimeout creates a new CreateLoadBalancerParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateLoadBalancerParamsWithTimeout(timeout time.Duration) *CreateLoadBalancerParams { - var () return &CreateLoadBalancerParams{ - timeout: timeout, } } // NewCreateLoadBalancerParamsWithContext creates a new CreateLoadBalancerParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateLoadBalancerParamsWithContext(ctx context.Context) *CreateLoadBalancerParams { - var () return &CreateLoadBalancerParams{ - Context: ctx, } } // NewCreateLoadBalancerParamsWithHTTPClient creates a new CreateLoadBalancerParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateLoadBalancerParamsWithHTTPClient(client *http.Client) *CreateLoadBalancerParams { - var () return &CreateLoadBalancerParams{ HTTPClient: client, } } -/*CreateLoadBalancerParams contains all the parameters to send to the API endpoint -for the create load balancer operation typically these are written to a http.Request +/* CreateLoadBalancerParams contains all the parameters to send to the API endpoint + for the create load balancer operation. + + Typically these are written to a http.Request. */ type CreateLoadBalancerParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - LoadBalancer Specification instance + /* Body. + + LoadBalancer Specification instance */ Body *models.LoadBalancerSpecification @@ -78,6 +78,21 @@ type CreateLoadBalancerParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLoadBalancerParams) WithDefaults() *CreateLoadBalancerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLoadBalancerParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create load balancer params func (o *CreateLoadBalancerParams) WithTimeout(timeout time.Duration) *CreateLoadBalancerParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateLoadBalancerParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/load_balancer/create_load_balancer_responses.go b/pkg/client/load_balancer/create_load_balancer_responses.go index 7ab44f50..78ae6f34 100644 --- a/pkg/client/load_balancer/create_load_balancer_responses.go +++ b/pkg/client/load_balancer/create_load_balancer_responses.go @@ -47,7 +47,6 @@ func (o *CreateLoadBalancerReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateLoadBalancerAccepted() *CreateLoadBalancerAccepted { return &CreateLoadBalancerAccepted{} } -/*CreateLoadBalancerAccepted handles this case with default header values. +/* CreateLoadBalancerAccepted describes a response with status code 202, with default header values. successful operation */ @@ -69,7 +68,6 @@ type CreateLoadBalancerAccepted struct { func (o *CreateLoadBalancerAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers][%d] createLoadBalancerAccepted %+v", 202, o.Payload) } - func (o *CreateLoadBalancerAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateLoadBalancerBadRequest() *CreateLoadBalancerBadRequest { return &CreateLoadBalancerBadRequest{} } -/*CreateLoadBalancerBadRequest handles this case with default header values. +/* CreateLoadBalancerBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -102,7 +100,6 @@ type CreateLoadBalancerBadRequest struct { func (o *CreateLoadBalancerBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers][%d] createLoadBalancerBadRequest %+v", 400, o.Payload) } - func (o *CreateLoadBalancerBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,19 +121,30 @@ func NewCreateLoadBalancerForbidden() *CreateLoadBalancerForbidden { return &CreateLoadBalancerForbidden{} } -/*CreateLoadBalancerForbidden handles this case with default header values. +/* CreateLoadBalancerForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateLoadBalancerForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateLoadBalancerForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/load-balancers][%d] createLoadBalancerForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/load-balancers][%d] createLoadBalancerForbidden %+v", 403, o.Payload) +} +func (o *CreateLoadBalancerForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateLoadBalancerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -145,7 +153,7 @@ func NewCreateLoadBalancerNotFound() *CreateLoadBalancerNotFound { return &CreateLoadBalancerNotFound{} } -/*CreateLoadBalancerNotFound handles this case with default header values. +/* CreateLoadBalancerNotFound describes a response with status code 404, with default header values. Input(s) not Found */ @@ -156,7 +164,6 @@ type CreateLoadBalancerNotFound struct { func (o *CreateLoadBalancerNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers][%d] createLoadBalancerNotFound %+v", 404, o.Payload) } - func (o *CreateLoadBalancerNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/load_balancer/delete_load_balancer_operation_parameters.go b/pkg/client/load_balancer/delete_load_balancer_operation_parameters.go index 465bc318..85e60be9 100644 --- a/pkg/client/load_balancer/delete_load_balancer_operation_parameters.go +++ b/pkg/client/load_balancer/delete_load_balancer_operation_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteLoadBalancerOperationParams creates a new DeleteLoadBalancerOperationParams object -// with the default values initialized. +// NewDeleteLoadBalancerOperationParams creates a new DeleteLoadBalancerOperationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteLoadBalancerOperationParams() *DeleteLoadBalancerOperationParams { - var () return &DeleteLoadBalancerOperationParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteLoadBalancerOperationParamsWithTimeout creates a new DeleteLoadBalancerOperationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteLoadBalancerOperationParamsWithTimeout(timeout time.Duration) *DeleteLoadBalancerOperationParams { - var () return &DeleteLoadBalancerOperationParams{ - timeout: timeout, } } // NewDeleteLoadBalancerOperationParamsWithContext creates a new DeleteLoadBalancerOperationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteLoadBalancerOperationParamsWithContext(ctx context.Context) *DeleteLoadBalancerOperationParams { - var () return &DeleteLoadBalancerOperationParams{ - Context: ctx, } } // NewDeleteLoadBalancerOperationParamsWithHTTPClient creates a new DeleteLoadBalancerOperationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteLoadBalancerOperationParamsWithHTTPClient(client *http.Client) *DeleteLoadBalancerOperationParams { - var () return &DeleteLoadBalancerOperationParams{ HTTPClient: client, } } -/*DeleteLoadBalancerOperationParams contains all the parameters to send to the API endpoint -for the delete load balancer operation operation typically these are written to a http.Request +/* DeleteLoadBalancerOperationParams contains all the parameters to send to the API endpoint + for the delete load balancer operation operation. + + Typically these are written to a http.Request. */ type DeleteLoadBalancerOperationParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this load balancer. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this load balancer. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the load balancer. + /* ID. + + The ID of the load balancer. */ ID string @@ -82,6 +83,21 @@ type DeleteLoadBalancerOperationParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete load balancer operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLoadBalancerOperationParams) WithDefaults() *DeleteLoadBalancerOperationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete load balancer operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLoadBalancerOperationParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete load balancer operation params func (o *DeleteLoadBalancerOperationParams) WithTimeout(timeout time.Duration) *DeleteLoadBalancerOperationParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteLoadBalancerOperationParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/load_balancer/delete_load_balancer_operation_responses.go b/pkg/client/load_balancer/delete_load_balancer_operation_responses.go index c4f1f899..620bee51 100644 --- a/pkg/client/load_balancer/delete_load_balancer_operation_responses.go +++ b/pkg/client/load_balancer/delete_load_balancer_operation_responses.go @@ -35,7 +35,6 @@ func (o *DeleteLoadBalancerOperationReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteLoadBalancerOperationAccepted() *DeleteLoadBalancerOperationAccept return &DeleteLoadBalancerOperationAccepted{} } -/*DeleteLoadBalancerOperationAccepted handles this case with default header values. +/* DeleteLoadBalancerOperationAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteLoadBalancerOperationAccepted struct { func (o *DeleteLoadBalancerOperationAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/delete][%d] deleteLoadBalancerOperationAccepted %+v", 202, o.Payload) } - func (o *DeleteLoadBalancerOperationAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteLoadBalancerOperationForbidden() *DeleteLoadBalancerOperationForbi return &DeleteLoadBalancerOperationForbidden{} } -/*DeleteLoadBalancerOperationForbidden handles this case with default header values. +/* DeleteLoadBalancerOperationForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteLoadBalancerOperationForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteLoadBalancerOperationForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/delete][%d] deleteLoadBalancerOperationForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/delete][%d] deleteLoadBalancerOperationForbidden %+v", 403, o.Payload) +} +func (o *DeleteLoadBalancerOperationForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteLoadBalancerOperationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/load_balancer/delete_load_balancer_parameters.go b/pkg/client/load_balancer/delete_load_balancer_parameters.go index 1a4c6bee..013ad2dc 100644 --- a/pkg/client/load_balancer/delete_load_balancer_parameters.go +++ b/pkg/client/load_balancer/delete_load_balancer_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteLoadBalancerParams creates a new DeleteLoadBalancerParams object -// with the default values initialized. +// NewDeleteLoadBalancerParams creates a new DeleteLoadBalancerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteLoadBalancerParams() *DeleteLoadBalancerParams { - var () return &DeleteLoadBalancerParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteLoadBalancerParamsWithTimeout creates a new DeleteLoadBalancerParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteLoadBalancerParamsWithTimeout(timeout time.Duration) *DeleteLoadBalancerParams { - var () return &DeleteLoadBalancerParams{ - timeout: timeout, } } // NewDeleteLoadBalancerParamsWithContext creates a new DeleteLoadBalancerParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteLoadBalancerParamsWithContext(ctx context.Context) *DeleteLoadBalancerParams { - var () return &DeleteLoadBalancerParams{ - Context: ctx, } } // NewDeleteLoadBalancerParamsWithHTTPClient creates a new DeleteLoadBalancerParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteLoadBalancerParamsWithHTTPClient(client *http.Client) *DeleteLoadBalancerParams { - var () return &DeleteLoadBalancerParams{ HTTPClient: client, } } -/*DeleteLoadBalancerParams contains all the parameters to send to the API endpoint -for the delete load balancer operation typically these are written to a http.Request +/* DeleteLoadBalancerParams contains all the parameters to send to the API endpoint + for the delete load balancer operation. + + Typically these are written to a http.Request. */ type DeleteLoadBalancerParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this load balancer. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this load balancer. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the load balancer. + /* ID. + + The ID of the load balancer. */ ID string @@ -82,6 +83,21 @@ type DeleteLoadBalancerParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLoadBalancerParams) WithDefaults() *DeleteLoadBalancerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLoadBalancerParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete load balancer params func (o *DeleteLoadBalancerParams) WithTimeout(timeout time.Duration) *DeleteLoadBalancerParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteLoadBalancerParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/load_balancer/delete_load_balancer_responses.go b/pkg/client/load_balancer/delete_load_balancer_responses.go index b8362322..b691ea9f 100644 --- a/pkg/client/load_balancer/delete_load_balancer_responses.go +++ b/pkg/client/load_balancer/delete_load_balancer_responses.go @@ -35,7 +35,6 @@ func (o *DeleteLoadBalancerReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteLoadBalancerAccepted() *DeleteLoadBalancerAccepted { return &DeleteLoadBalancerAccepted{} } -/*DeleteLoadBalancerAccepted handles this case with default header values. +/* DeleteLoadBalancerAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteLoadBalancerAccepted struct { func (o *DeleteLoadBalancerAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/load-balancers/{id}][%d] deleteLoadBalancerAccepted %+v", 202, o.Payload) } - func (o *DeleteLoadBalancerAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteLoadBalancerForbidden() *DeleteLoadBalancerForbidden { return &DeleteLoadBalancerForbidden{} } -/*DeleteLoadBalancerForbidden handles this case with default header values. +/* DeleteLoadBalancerForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteLoadBalancerForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteLoadBalancerForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/load-balancers/{id}][%d] deleteLoadBalancerForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/load-balancers/{id}][%d] deleteLoadBalancerForbidden %+v", 403, o.Payload) +} +func (o *DeleteLoadBalancerForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteLoadBalancerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/load_balancer/get_load_balancer_network_interface_parameters.go b/pkg/client/load_balancer/get_load_balancer_network_interface_parameters.go index c6dc3750..71da2712 100644 --- a/pkg/client/load_balancer/get_load_balancer_network_interface_parameters.go +++ b/pkg/client/load_balancer/get_load_balancer_network_interface_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoadBalancerNetworkInterfaceParams creates a new GetLoadBalancerNetworkInterfaceParams object -// with the default values initialized. +// NewGetLoadBalancerNetworkInterfaceParams creates a new GetLoadBalancerNetworkInterfaceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLoadBalancerNetworkInterfaceParams() *GetLoadBalancerNetworkInterfaceParams { - var () return &GetLoadBalancerNetworkInterfaceParams{ - timeout: cr.DefaultTimeout, } } // NewGetLoadBalancerNetworkInterfaceParamsWithTimeout creates a new GetLoadBalancerNetworkInterfaceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLoadBalancerNetworkInterfaceParamsWithTimeout(timeout time.Duration) *GetLoadBalancerNetworkInterfaceParams { - var () return &GetLoadBalancerNetworkInterfaceParams{ - timeout: timeout, } } // NewGetLoadBalancerNetworkInterfaceParamsWithContext creates a new GetLoadBalancerNetworkInterfaceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLoadBalancerNetworkInterfaceParamsWithContext(ctx context.Context) *GetLoadBalancerNetworkInterfaceParams { - var () return &GetLoadBalancerNetworkInterfaceParams{ - Context: ctx, } } // NewGetLoadBalancerNetworkInterfaceParamsWithHTTPClient creates a new GetLoadBalancerNetworkInterfaceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLoadBalancerNetworkInterfaceParamsWithHTTPClient(client *http.Client) *GetLoadBalancerNetworkInterfaceParams { - var () return &GetLoadBalancerNetworkInterfaceParams{ HTTPClient: client, } } -/*GetLoadBalancerNetworkInterfaceParams contains all the parameters to send to the API endpoint -for the get load balancer network interface operation typically these are written to a http.Request +/* GetLoadBalancerNetworkInterfaceParams contains all the parameters to send to the API endpoint + for the get load balancer network interface operation. + + Typically these are written to a http.Request. */ type GetLoadBalancerNetworkInterfaceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the load balancer. + /* ID. + + The ID of the load balancer. */ ID string - /*Id1 - The ID of the network interface. + /* Id1. + + The ID of the network interface. */ Id1 string @@ -81,6 +82,21 @@ type GetLoadBalancerNetworkInterfaceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get load balancer network interface params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancerNetworkInterfaceParams) WithDefaults() *GetLoadBalancerNetworkInterfaceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get load balancer network interface params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancerNetworkInterfaceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get load balancer network interface params func (o *GetLoadBalancerNetworkInterfaceParams) WithTimeout(timeout time.Duration) *GetLoadBalancerNetworkInterfaceParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetLoadBalancerNetworkInterfaceParams) WriteToRequest(r runtime.ClientR // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/load_balancer/get_load_balancer_network_interface_responses.go b/pkg/client/load_balancer/get_load_balancer_network_interface_responses.go index 24f7fa33..b6e9b41f 100644 --- a/pkg/client/load_balancer/get_load_balancer_network_interface_responses.go +++ b/pkg/client/load_balancer/get_load_balancer_network_interface_responses.go @@ -41,7 +41,6 @@ func (o *GetLoadBalancerNetworkInterfaceReader) ReadResponse(response runtime.Cl return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetLoadBalancerNetworkInterfaceOK() *GetLoadBalancerNetworkInterfaceOK { return &GetLoadBalancerNetworkInterfaceOK{} } -/*GetLoadBalancerNetworkInterfaceOK handles this case with default header values. +/* GetLoadBalancerNetworkInterfaceOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetLoadBalancerNetworkInterfaceOK struct { func (o *GetLoadBalancerNetworkInterfaceOK) Error() string { return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}/network-interfaces/{id1}][%d] getLoadBalancerNetworkInterfaceOK %+v", 200, o.Payload) } - func (o *GetLoadBalancerNetworkInterfaceOK) GetPayload() *models.NetworkInterface { return o.Payload } @@ -85,19 +83,30 @@ func NewGetLoadBalancerNetworkInterfaceForbidden() *GetLoadBalancerNetworkInterf return &GetLoadBalancerNetworkInterfaceForbidden{} } -/*GetLoadBalancerNetworkInterfaceForbidden handles this case with default header values. +/* GetLoadBalancerNetworkInterfaceForbidden describes a response with status code 403, with default header values. Forbidden */ type GetLoadBalancerNetworkInterfaceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetLoadBalancerNetworkInterfaceForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}/network-interfaces/{id1}][%d] getLoadBalancerNetworkInterfaceForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}/network-interfaces/{id1}][%d] getLoadBalancerNetworkInterfaceForbidden %+v", 403, o.Payload) +} +func (o *GetLoadBalancerNetworkInterfaceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetLoadBalancerNetworkInterfaceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetLoadBalancerNetworkInterfaceNotFound() *GetLoadBalancerNetworkInterfa return &GetLoadBalancerNetworkInterfaceNotFound{} } -/*GetLoadBalancerNetworkInterfaceNotFound handles this case with default header values. +/* GetLoadBalancerNetworkInterfaceNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetLoadBalancerNetworkInterfaceNotFound struct { func (o *GetLoadBalancerNetworkInterfaceNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}/network-interfaces/{id1}][%d] getLoadBalancerNetworkInterfaceNotFound %+v", 404, o.Payload) } - func (o *GetLoadBalancerNetworkInterfaceNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/load_balancer/get_load_balancer_parameters.go b/pkg/client/load_balancer/get_load_balancer_parameters.go index fc439f9f..e9a24bb9 100644 --- a/pkg/client/load_balancer/get_load_balancer_parameters.go +++ b/pkg/client/load_balancer/get_load_balancer_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoadBalancerParams creates a new GetLoadBalancerParams object -// with the default values initialized. +// NewGetLoadBalancerParams creates a new GetLoadBalancerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLoadBalancerParams() *GetLoadBalancerParams { - var () return &GetLoadBalancerParams{ - timeout: cr.DefaultTimeout, } } // NewGetLoadBalancerParamsWithTimeout creates a new GetLoadBalancerParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLoadBalancerParamsWithTimeout(timeout time.Duration) *GetLoadBalancerParams { - var () return &GetLoadBalancerParams{ - timeout: timeout, } } // NewGetLoadBalancerParamsWithContext creates a new GetLoadBalancerParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLoadBalancerParamsWithContext(ctx context.Context) *GetLoadBalancerParams { - var () return &GetLoadBalancerParams{ - Context: ctx, } } // NewGetLoadBalancerParamsWithHTTPClient creates a new GetLoadBalancerParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLoadBalancerParamsWithHTTPClient(client *http.Client) *GetLoadBalancerParams { - var () return &GetLoadBalancerParams{ HTTPClient: client, } } -/*GetLoadBalancerParams contains all the parameters to send to the API endpoint -for the get load balancer operation typically these are written to a http.Request +/* GetLoadBalancerParams contains all the parameters to send to the API endpoint + for the get load balancer operation. + + Typically these are written to a http.Request. */ type GetLoadBalancerParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the load balancer. + /* ID. + + The ID of the load balancer. */ ID string @@ -76,6 +76,21 @@ type GetLoadBalancerParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancerParams) WithDefaults() *GetLoadBalancerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancerParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get load balancer params func (o *GetLoadBalancerParams) WithTimeout(timeout time.Duration) *GetLoadBalancerParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetLoadBalancerParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/load_balancer/get_load_balancer_responses.go b/pkg/client/load_balancer/get_load_balancer_responses.go index 219d3138..faaf621e 100644 --- a/pkg/client/load_balancer/get_load_balancer_responses.go +++ b/pkg/client/load_balancer/get_load_balancer_responses.go @@ -41,7 +41,6 @@ func (o *GetLoadBalancerReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetLoadBalancerOK() *GetLoadBalancerOK { return &GetLoadBalancerOK{} } -/*GetLoadBalancerOK handles this case with default header values. +/* GetLoadBalancerOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetLoadBalancerOK struct { func (o *GetLoadBalancerOK) Error() string { return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}][%d] getLoadBalancerOK %+v", 200, o.Payload) } - func (o *GetLoadBalancerOK) GetPayload() *models.LoadBalancer { return o.Payload } @@ -85,19 +83,30 @@ func NewGetLoadBalancerForbidden() *GetLoadBalancerForbidden { return &GetLoadBalancerForbidden{} } -/*GetLoadBalancerForbidden handles this case with default header values. +/* GetLoadBalancerForbidden describes a response with status code 403, with default header values. Forbidden */ type GetLoadBalancerForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetLoadBalancerForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}][%d] getLoadBalancerForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}][%d] getLoadBalancerForbidden %+v", 403, o.Payload) +} +func (o *GetLoadBalancerForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetLoadBalancerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetLoadBalancerNotFound() *GetLoadBalancerNotFound { return &GetLoadBalancerNotFound{} } -/*GetLoadBalancerNotFound handles this case with default header values. +/* GetLoadBalancerNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetLoadBalancerNotFound struct { func (o *GetLoadBalancerNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/load-balancers/{id}][%d] getLoadBalancerNotFound %+v", 404, o.Payload) } - func (o *GetLoadBalancerNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/load_balancer/get_load_balancers_parameters.go b/pkg/client/load_balancer/get_load_balancers_parameters.go index 4ff550db..826361cb 100644 --- a/pkg/client/load_balancer/get_load_balancers_parameters.go +++ b/pkg/client/load_balancer/get_load_balancers_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoadBalancersParams creates a new GetLoadBalancersParams object -// with the default values initialized. +// NewGetLoadBalancersParams creates a new GetLoadBalancersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLoadBalancersParams() *GetLoadBalancersParams { - var () return &GetLoadBalancersParams{ - timeout: cr.DefaultTimeout, } } // NewGetLoadBalancersParamsWithTimeout creates a new GetLoadBalancersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLoadBalancersParamsWithTimeout(timeout time.Duration) *GetLoadBalancersParams { - var () return &GetLoadBalancersParams{ - timeout: timeout, } } // NewGetLoadBalancersParamsWithContext creates a new GetLoadBalancersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLoadBalancersParamsWithContext(ctx context.Context) *GetLoadBalancersParams { - var () return &GetLoadBalancersParams{ - Context: ctx, } } // NewGetLoadBalancersParamsWithHTTPClient creates a new GetLoadBalancersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLoadBalancersParamsWithHTTPClient(client *http.Client) *GetLoadBalancersParams { - var () return &GetLoadBalancersParams{ HTTPClient: client, } } -/*GetLoadBalancersParams contains all the parameters to send to the API endpoint -for the get load balancers operation typically these are written to a http.Request +/* GetLoadBalancersParams contains all the parameters to send to the API endpoint + for the get load balancers operation. + + Typically these are written to a http.Request. */ type GetLoadBalancersParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetLoadBalancersParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get load balancers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancersParams) WithDefaults() *GetLoadBalancersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get load balancers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoadBalancersParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get load balancers params func (o *GetLoadBalancersParams) WithTimeout(timeout time.Duration) *GetLoadBalancersParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetLoadBalancersParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/load_balancer/get_load_balancers_responses.go b/pkg/client/load_balancer/get_load_balancers_responses.go index 61d71167..7ce9a8dc 100644 --- a/pkg/client/load_balancer/get_load_balancers_responses.go +++ b/pkg/client/load_balancer/get_load_balancers_responses.go @@ -35,7 +35,6 @@ func (o *GetLoadBalancersReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetLoadBalancersOK() *GetLoadBalancersOK { return &GetLoadBalancersOK{} } -/*GetLoadBalancersOK handles this case with default header values. +/* GetLoadBalancersOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetLoadBalancersOK struct { func (o *GetLoadBalancersOK) Error() string { return fmt.Sprintf("[GET /iaas/api/load-balancers][%d] getLoadBalancersOK %+v", 200, o.Payload) } - func (o *GetLoadBalancersOK) GetPayload() *models.LoadBalancerResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetLoadBalancersForbidden() *GetLoadBalancersForbidden { return &GetLoadBalancersForbidden{} } -/*GetLoadBalancersForbidden handles this case with default header values. +/* GetLoadBalancersForbidden describes a response with status code 403, with default header values. Forbidden */ type GetLoadBalancersForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetLoadBalancersForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/load-balancers][%d] getLoadBalancersForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/load-balancers][%d] getLoadBalancersForbidden %+v", 403, o.Payload) +} +func (o *GetLoadBalancersForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetLoadBalancersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/load_balancer/load_balancer_client.go b/pkg/client/load_balancer/load_balancer_client.go index eaa23ee0..d769f51c 100644 --- a/pkg/client/load_balancer/load_balancer_client.go +++ b/pkg/client/load_balancer/load_balancer_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateLoadBalancer(params *CreateLoadBalancerParams) (*CreateLoadBalancerAccepted, error) + CreateLoadBalancer(params *CreateLoadBalancerParams, opts ...ClientOption) (*CreateLoadBalancerAccepted, error) - DeleteLoadBalancer(params *DeleteLoadBalancerParams) (*DeleteLoadBalancerAccepted, error) + DeleteLoadBalancer(params *DeleteLoadBalancerParams, opts ...ClientOption) (*DeleteLoadBalancerAccepted, error) - DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperationParams) (*DeleteLoadBalancerOperationAccepted, error) + DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperationParams, opts ...ClientOption) (*DeleteLoadBalancerOperationAccepted, error) - GetLoadBalancer(params *GetLoadBalancerParams) (*GetLoadBalancerOK, error) + GetLoadBalancer(params *GetLoadBalancerParams, opts ...ClientOption) (*GetLoadBalancerOK, error) - GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkInterfaceParams) (*GetLoadBalancerNetworkInterfaceOK, error) + GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkInterfaceParams, opts ...ClientOption) (*GetLoadBalancerNetworkInterfaceOK, error) - GetLoadBalancers(params *GetLoadBalancersParams) (*GetLoadBalancersOK, error) + GetLoadBalancers(params *GetLoadBalancersParams, opts ...ClientOption) (*GetLoadBalancersOK, error) - ScaleLoadBalancer(params *ScaleLoadBalancerParams) (*ScaleLoadBalancerAccepted, error) + ScaleLoadBalancer(params *ScaleLoadBalancerParams, opts ...ClientOption) (*ScaleLoadBalancerAccepted, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Create load balancer */ -func (a *Client) CreateLoadBalancer(params *CreateLoadBalancerParams) (*CreateLoadBalancerAccepted, error) { +func (a *Client) CreateLoadBalancer(params *CreateLoadBalancerParams, opts ...ClientOption) (*CreateLoadBalancerAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateLoadBalancerParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createLoadBalancer", Method: "POST", PathPattern: "/iaas/api/load-balancers", @@ -66,7 +68,12 @@ func (a *Client) CreateLoadBalancer(params *CreateLoadBalancerParams) (*CreateLo Reader: &CreateLoadBalancerReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) CreateLoadBalancer(params *CreateLoadBalancerParams) (*CreateLo Delete load balancer with a given id */ -func (a *Client) DeleteLoadBalancer(params *DeleteLoadBalancerParams) (*DeleteLoadBalancerAccepted, error) { +func (a *Client) DeleteLoadBalancer(params *DeleteLoadBalancerParams, opts ...ClientOption) (*DeleteLoadBalancerAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteLoadBalancerParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteLoadBalancer", Method: "DELETE", PathPattern: "/iaas/api/load-balancers/{id}", @@ -102,7 +108,12 @@ func (a *Client) DeleteLoadBalancer(params *DeleteLoadBalancerParams) (*DeleteLo Reader: &DeleteLoadBalancerReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) DeleteLoadBalancer(params *DeleteLoadBalancerParams) (*DeleteLo Second day delete operation for load balancer */ -func (a *Client) DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperationParams) (*DeleteLoadBalancerOperationAccepted, error) { +func (a *Client) DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperationParams, opts ...ClientOption) (*DeleteLoadBalancerOperationAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteLoadBalancerOperationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteLoadBalancerOperation", Method: "POST", PathPattern: "/iaas/api/load-balancers/{id}/operations/delete", @@ -138,7 +148,12 @@ func (a *Client) DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperation Reader: &DeleteLoadBalancerOperationReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -157,13 +172,12 @@ func (a *Client) DeleteLoadBalancerOperation(params *DeleteLoadBalancerOperation Get load balancer with a given id */ -func (a *Client) GetLoadBalancer(params *GetLoadBalancerParams) (*GetLoadBalancerOK, error) { +func (a *Client) GetLoadBalancer(params *GetLoadBalancerParams, opts ...ClientOption) (*GetLoadBalancerOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLoadBalancerParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLoadBalancer", Method: "GET", PathPattern: "/iaas/api/load-balancers/{id}", @@ -174,7 +188,12 @@ func (a *Client) GetLoadBalancer(params *GetLoadBalancerParams) (*GetLoadBalance Reader: &GetLoadBalancerReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -193,13 +212,12 @@ func (a *Client) GetLoadBalancer(params *GetLoadBalancerParams) (*GetLoadBalance Get network interface with a given id for specific load balancer */ -func (a *Client) GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkInterfaceParams) (*GetLoadBalancerNetworkInterfaceOK, error) { +func (a *Client) GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkInterfaceParams, opts ...ClientOption) (*GetLoadBalancerNetworkInterfaceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLoadBalancerNetworkInterfaceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLoadBalancerNetworkInterface", Method: "GET", PathPattern: "/iaas/api/load-balancers/{id}/network-interfaces/{id1}", @@ -210,7 +228,12 @@ func (a *Client) GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkI Reader: &GetLoadBalancerNetworkInterfaceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetLoadBalancerNetworkInterface(params *GetLoadBalancerNetworkI Get all load balancers */ -func (a *Client) GetLoadBalancers(params *GetLoadBalancersParams) (*GetLoadBalancersOK, error) { +func (a *Client) GetLoadBalancers(params *GetLoadBalancersParams, opts ...ClientOption) (*GetLoadBalancersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLoadBalancersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLoadBalancers", Method: "GET", PathPattern: "/iaas/api/load-balancers", @@ -246,7 +268,12 @@ func (a *Client) GetLoadBalancers(params *GetLoadBalancersParams) (*GetLoadBalan Reader: &GetLoadBalancersReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -265,13 +292,12 @@ func (a *Client) GetLoadBalancers(params *GetLoadBalancersParams) (*GetLoadBalan Second day scale operation for load balancer */ -func (a *Client) ScaleLoadBalancer(params *ScaleLoadBalancerParams) (*ScaleLoadBalancerAccepted, error) { +func (a *Client) ScaleLoadBalancer(params *ScaleLoadBalancerParams, opts ...ClientOption) (*ScaleLoadBalancerAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewScaleLoadBalancerParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "scaleLoadBalancer", Method: "POST", PathPattern: "/iaas/api/load-balancers/{id}/operations/scale", @@ -282,7 +308,12 @@ func (a *Client) ScaleLoadBalancer(params *ScaleLoadBalancerParams) (*ScaleLoadB Reader: &ScaleLoadBalancerReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/load_balancer/scale_load_balancer_parameters.go b/pkg/client/load_balancer/scale_load_balancer_parameters.go index 013c61e2..b1e9e349 100644 --- a/pkg/client/load_balancer/scale_load_balancer_parameters.go +++ b/pkg/client/load_balancer/scale_load_balancer_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewScaleLoadBalancerParams creates a new ScaleLoadBalancerParams object -// with the default values initialized. +// NewScaleLoadBalancerParams creates a new ScaleLoadBalancerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewScaleLoadBalancerParams() *ScaleLoadBalancerParams { - var () return &ScaleLoadBalancerParams{ - timeout: cr.DefaultTimeout, } } // NewScaleLoadBalancerParamsWithTimeout creates a new ScaleLoadBalancerParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewScaleLoadBalancerParamsWithTimeout(timeout time.Duration) *ScaleLoadBalancerParams { - var () return &ScaleLoadBalancerParams{ - timeout: timeout, } } // NewScaleLoadBalancerParamsWithContext creates a new ScaleLoadBalancerParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewScaleLoadBalancerParamsWithContext(ctx context.Context) *ScaleLoadBalancerParams { - var () return &ScaleLoadBalancerParams{ - Context: ctx, } } // NewScaleLoadBalancerParamsWithHTTPClient creates a new ScaleLoadBalancerParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewScaleLoadBalancerParamsWithHTTPClient(client *http.Client) *ScaleLoadBalancerParams { - var () return &ScaleLoadBalancerParams{ HTTPClient: client, } } -/*ScaleLoadBalancerParams contains all the parameters to send to the API endpoint -for the scale load balancer operation typically these are written to a http.Request +/* ScaleLoadBalancerParams contains all the parameters to send to the API endpoint + for the scale load balancer operation. + + Typically these are written to a http.Request. */ type ScaleLoadBalancerParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - LoadBalancer Specification instance + /* Body. + + LoadBalancer Specification instance */ Body *models.LoadBalancerSpecification - /*ID - The ID of the load balancer. + /* ID. + + The ID of the load balancer. */ ID string @@ -83,6 +84,21 @@ type ScaleLoadBalancerParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the scale load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleLoadBalancerParams) WithDefaults() *ScaleLoadBalancerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the scale load balancer params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleLoadBalancerParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the scale load balancer params func (o *ScaleLoadBalancerParams) WithTimeout(timeout time.Duration) *ScaleLoadBalancerParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *ScaleLoadBalancerParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/load_balancer/scale_load_balancer_responses.go b/pkg/client/load_balancer/scale_load_balancer_responses.go index a2118c69..93a49458 100644 --- a/pkg/client/load_balancer/scale_load_balancer_responses.go +++ b/pkg/client/load_balancer/scale_load_balancer_responses.go @@ -41,7 +41,6 @@ func (o *ScaleLoadBalancerReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewScaleLoadBalancerAccepted() *ScaleLoadBalancerAccepted { return &ScaleLoadBalancerAccepted{} } -/*ScaleLoadBalancerAccepted handles this case with default header values. +/* ScaleLoadBalancerAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ScaleLoadBalancerAccepted struct { func (o *ScaleLoadBalancerAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/scale][%d] scaleLoadBalancerAccepted %+v", 202, o.Payload) } - func (o *ScaleLoadBalancerAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewScaleLoadBalancerForbidden() *ScaleLoadBalancerForbidden { return &ScaleLoadBalancerForbidden{} } -/*ScaleLoadBalancerForbidden handles this case with default header values. +/* ScaleLoadBalancerForbidden describes a response with status code 403, with default header values. Forbidden */ type ScaleLoadBalancerForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ScaleLoadBalancerForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/scale][%d] scaleLoadBalancerForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/scale][%d] scaleLoadBalancerForbidden %+v", 403, o.Payload) +} +func (o *ScaleLoadBalancerForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ScaleLoadBalancerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewScaleLoadBalancerNotFound() *ScaleLoadBalancerNotFound { return &ScaleLoadBalancerNotFound{} } -/*ScaleLoadBalancerNotFound handles this case with default header values. +/* ScaleLoadBalancerNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type ScaleLoadBalancerNotFound struct { func (o *ScaleLoadBalancerNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/load-balancers/{id}/operations/scale][%d] scaleLoadBalancerNotFound %+v", 404, o.Payload) } - func (o *ScaleLoadBalancerNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/location/create_zone_parameters.go b/pkg/client/location/create_zone_parameters.go index e2a4aed0..5c9a5ab2 100644 --- a/pkg/client/location/create_zone_parameters.go +++ b/pkg/client/location/create_zone_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateZoneParams creates a new CreateZoneParams object -// with the default values initialized. +// NewCreateZoneParams creates a new CreateZoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateZoneParams() *CreateZoneParams { - var () return &CreateZoneParams{ - timeout: cr.DefaultTimeout, } } // NewCreateZoneParamsWithTimeout creates a new CreateZoneParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateZoneParamsWithTimeout(timeout time.Duration) *CreateZoneParams { - var () return &CreateZoneParams{ - timeout: timeout, } } // NewCreateZoneParamsWithContext creates a new CreateZoneParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateZoneParamsWithContext(ctx context.Context) *CreateZoneParams { - var () return &CreateZoneParams{ - Context: ctx, } } // NewCreateZoneParamsWithHTTPClient creates a new CreateZoneParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateZoneParamsWithHTTPClient(client *http.Client) *CreateZoneParams { - var () return &CreateZoneParams{ HTTPClient: client, } } -/*CreateZoneParams contains all the parameters to send to the API endpoint -for the create zone operation typically these are written to a http.Request +/* CreateZoneParams contains all the parameters to send to the API endpoint + for the create zone operation. + + Typically these are written to a http.Request. */ type CreateZoneParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Zone specification + /* Body. + + Zone specification */ Body *models.ZoneSpecification @@ -78,6 +78,21 @@ type CreateZoneParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateZoneParams) WithDefaults() *CreateZoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateZoneParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create zone params func (o *CreateZoneParams) WithTimeout(timeout time.Duration) *CreateZoneParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateZoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/location/create_zone_responses.go b/pkg/client/location/create_zone_responses.go index 426e8061..2d813b10 100644 --- a/pkg/client/location/create_zone_responses.go +++ b/pkg/client/location/create_zone_responses.go @@ -41,7 +41,6 @@ func (o *CreateZoneReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateZoneCreated() *CreateZoneCreated { return &CreateZoneCreated{} } -/*CreateZoneCreated handles this case with default header values. +/* CreateZoneCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateZoneCreated struct { func (o *CreateZoneCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/zones][%d] createZoneCreated %+v", 201, o.Payload) } - func (o *CreateZoneCreated) GetPayload() *models.Zone { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateZoneBadRequest() *CreateZoneBadRequest { return &CreateZoneBadRequest{} } -/*CreateZoneBadRequest handles this case with default header values. +/* CreateZoneBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateZoneBadRequest struct { func (o *CreateZoneBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/zones][%d] createZoneBadRequest %+v", 400, o.Payload) } - func (o *CreateZoneBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateZoneForbidden() *CreateZoneForbidden { return &CreateZoneForbidden{} } -/*CreateZoneForbidden handles this case with default header values. +/* CreateZoneForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateZoneForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateZoneForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/zones][%d] createZoneForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/zones][%d] createZoneForbidden %+v", 403, o.Payload) +} +func (o *CreateZoneForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateZoneForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/location/delete_zone_parameters.go b/pkg/client/location/delete_zone_parameters.go index 6daa8c58..d240b4bb 100644 --- a/pkg/client/location/delete_zone_parameters.go +++ b/pkg/client/location/delete_zone_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteZoneParams creates a new DeleteZoneParams object -// with the default values initialized. +// NewDeleteZoneParams creates a new DeleteZoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteZoneParams() *DeleteZoneParams { - var () return &DeleteZoneParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteZoneParamsWithTimeout creates a new DeleteZoneParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteZoneParamsWithTimeout(timeout time.Duration) *DeleteZoneParams { - var () return &DeleteZoneParams{ - timeout: timeout, } } // NewDeleteZoneParamsWithContext creates a new DeleteZoneParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteZoneParamsWithContext(ctx context.Context) *DeleteZoneParams { - var () return &DeleteZoneParams{ - Context: ctx, } } // NewDeleteZoneParamsWithHTTPClient creates a new DeleteZoneParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteZoneParamsWithHTTPClient(client *http.Client) *DeleteZoneParams { - var () return &DeleteZoneParams{ HTTPClient: client, } } -/*DeleteZoneParams contains all the parameters to send to the API endpoint -for the delete zone operation typically these are written to a http.Request +/* DeleteZoneParams contains all the parameters to send to the API endpoint + for the delete zone operation. + + Typically these are written to a http.Request. */ type DeleteZoneParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the zone. + /* ID. + + The ID of the zone. */ ID string @@ -76,6 +76,21 @@ type DeleteZoneParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteZoneParams) WithDefaults() *DeleteZoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteZoneParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete zone params func (o *DeleteZoneParams) WithTimeout(timeout time.Duration) *DeleteZoneParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteZoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/location/delete_zone_responses.go b/pkg/client/location/delete_zone_responses.go index c4d3301c..32423bc2 100644 --- a/pkg/client/location/delete_zone_responses.go +++ b/pkg/client/location/delete_zone_responses.go @@ -7,9 +7,12 @@ package location import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteZoneReader is a Reader for the DeleteZone structure. @@ -32,7 +35,6 @@ func (o *DeleteZoneReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteZoneNoContent() *DeleteZoneNoContent { return &DeleteZoneNoContent{} } -/*DeleteZoneNoContent handles this case with default header values. +/* DeleteZoneNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteZoneForbidden() *DeleteZoneForbidden { return &DeleteZoneForbidden{} } -/*DeleteZoneForbidden handles this case with default header values. +/* DeleteZoneForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteZoneForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteZoneForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/zones/{id}][%d] deleteZoneForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/zones/{id}][%d] deleteZoneForbidden %+v", 403, o.Payload) +} +func (o *DeleteZoneForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteZoneForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/location/get_computes_parameters.go b/pkg/client/location/get_computes_parameters.go index ef1d4e70..cf965143 100644 --- a/pkg/client/location/get_computes_parameters.go +++ b/pkg/client/location/get_computes_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetComputesParams creates a new GetComputesParams object -// with the default values initialized. +// NewGetComputesParams creates a new GetComputesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetComputesParams() *GetComputesParams { - var () return &GetComputesParams{ - timeout: cr.DefaultTimeout, } } // NewGetComputesParamsWithTimeout creates a new GetComputesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetComputesParamsWithTimeout(timeout time.Duration) *GetComputesParams { - var () return &GetComputesParams{ - timeout: timeout, } } // NewGetComputesParamsWithContext creates a new GetComputesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetComputesParamsWithContext(ctx context.Context) *GetComputesParams { - var () return &GetComputesParams{ - Context: ctx, } } // NewGetComputesParamsWithHTTPClient creates a new GetComputesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetComputesParamsWithHTTPClient(client *http.Client) *GetComputesParams { - var () return &GetComputesParams{ HTTPClient: client, } } -/*GetComputesParams contains all the parameters to send to the API endpoint -for the get computes operation typically these are written to a http.Request +/* GetComputesParams contains all the parameters to send to the API endpoint + for the get computes operation. + + Typically these are written to a http.Request. */ type GetComputesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the zone. + /* ID. + + The ID of the zone. */ ID string @@ -76,6 +76,21 @@ type GetComputesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get computes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputesParams) WithDefaults() *GetComputesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get computes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetComputesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get computes params func (o *GetComputesParams) WithTimeout(timeout time.Duration) *GetComputesParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetComputesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/location/get_computes_responses.go b/pkg/client/location/get_computes_responses.go index e5d49ce4..a040e801 100644 --- a/pkg/client/location/get_computes_responses.go +++ b/pkg/client/location/get_computes_responses.go @@ -41,7 +41,6 @@ func (o *GetComputesReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetComputesOK() *GetComputesOK { return &GetComputesOK{} } -/*GetComputesOK handles this case with default header values. +/* GetComputesOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetComputesOK struct { func (o *GetComputesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/zones/{id}/computes][%d] getComputesOK %+v", 200, o.Payload) } - func (o *GetComputesOK) GetPayload() *models.FabricComputeResult { return o.Payload } @@ -85,19 +83,30 @@ func NewGetComputesForbidden() *GetComputesForbidden { return &GetComputesForbidden{} } -/*GetComputesForbidden handles this case with default header values. +/* GetComputesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetComputesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetComputesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/zones/{id}/computes][%d] getComputesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/zones/{id}/computes][%d] getComputesForbidden %+v", 403, o.Payload) +} +func (o *GetComputesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetComputesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetComputesNotFound() *GetComputesNotFound { return &GetComputesNotFound{} } -/*GetComputesNotFound handles this case with default header values. +/* GetComputesNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetComputesNotFound struct { func (o *GetComputesNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/zones/{id}/computes][%d] getComputesNotFound %+v", 404, o.Payload) } - func (o *GetComputesNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/location/get_region_parameters.go b/pkg/client/location/get_region_parameters.go index 15074a47..e145138d 100644 --- a/pkg/client/location/get_region_parameters.go +++ b/pkg/client/location/get_region_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetRegionParams creates a new GetRegionParams object -// with the default values initialized. +// NewGetRegionParams creates a new GetRegionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRegionParams() *GetRegionParams { - var () return &GetRegionParams{ - timeout: cr.DefaultTimeout, } } // NewGetRegionParamsWithTimeout creates a new GetRegionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRegionParamsWithTimeout(timeout time.Duration) *GetRegionParams { - var () return &GetRegionParams{ - timeout: timeout, } } // NewGetRegionParamsWithContext creates a new GetRegionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRegionParamsWithContext(ctx context.Context) *GetRegionParams { - var () return &GetRegionParams{ - Context: ctx, } } // NewGetRegionParamsWithHTTPClient creates a new GetRegionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRegionParamsWithHTTPClient(client *http.Client) *GetRegionParams { - var () return &GetRegionParams{ HTTPClient: client, } } -/*GetRegionParams contains all the parameters to send to the API endpoint -for the get region operation typically these are written to a http.Request +/* GetRegionParams contains all the parameters to send to the API endpoint + for the get region operation. + + Typically these are written to a http.Request. */ type GetRegionParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the region. + /* ID. + + The ID of the region. */ ID string @@ -76,6 +76,21 @@ type GetRegionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get region params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRegionParams) WithDefaults() *GetRegionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get region params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRegionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get region params func (o *GetRegionParams) WithTimeout(timeout time.Duration) *GetRegionParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetRegionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/location/get_region_responses.go b/pkg/client/location/get_region_responses.go index c905c7bb..9c479c91 100644 --- a/pkg/client/location/get_region_responses.go +++ b/pkg/client/location/get_region_responses.go @@ -41,7 +41,6 @@ func (o *GetRegionReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetRegionOK() *GetRegionOK { return &GetRegionOK{} } -/*GetRegionOK handles this case with default header values. +/* GetRegionOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetRegionOK struct { func (o *GetRegionOK) Error() string { return fmt.Sprintf("[GET /iaas/api/regions/{id}][%d] getRegionOK %+v", 200, o.Payload) } - func (o *GetRegionOK) GetPayload() *models.Region { return o.Payload } @@ -85,19 +83,30 @@ func NewGetRegionForbidden() *GetRegionForbidden { return &GetRegionForbidden{} } -/*GetRegionForbidden handles this case with default header values. +/* GetRegionForbidden describes a response with status code 403, with default header values. Forbidden */ type GetRegionForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetRegionForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/regions/{id}][%d] getRegionForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/regions/{id}][%d] getRegionForbidden %+v", 403, o.Payload) +} +func (o *GetRegionForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetRegionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetRegionNotFound() *GetRegionNotFound { return &GetRegionNotFound{} } -/*GetRegionNotFound handles this case with default header values. +/* GetRegionNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetRegionNotFound struct { func (o *GetRegionNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/regions/{id}][%d] getRegionNotFound %+v", 404, o.Payload) } - func (o *GetRegionNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/location/get_regions_parameters.go b/pkg/client/location/get_regions_parameters.go index 83706cf9..10454856 100644 --- a/pkg/client/location/get_regions_parameters.go +++ b/pkg/client/location/get_regions_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetRegionsParams creates a new GetRegionsParams object -// with the default values initialized. +// NewGetRegionsParams creates a new GetRegionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRegionsParams() *GetRegionsParams { - var () return &GetRegionsParams{ - timeout: cr.DefaultTimeout, } } // NewGetRegionsParamsWithTimeout creates a new GetRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRegionsParamsWithTimeout(timeout time.Duration) *GetRegionsParams { - var () return &GetRegionsParams{ - timeout: timeout, } } // NewGetRegionsParamsWithContext creates a new GetRegionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRegionsParamsWithContext(ctx context.Context) *GetRegionsParams { - var () return &GetRegionsParams{ - Context: ctx, } } // NewGetRegionsParamsWithHTTPClient creates a new GetRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRegionsParamsWithHTTPClient(client *http.Client) *GetRegionsParams { - var () return &GetRegionsParams{ HTTPClient: client, } } -/*GetRegionsParams contains all the parameters to send to the API endpoint -for the get regions operation typically these are written to a http.Request +/* GetRegionsParams contains all the parameters to send to the API endpoint + for the get regions operation. + + Typically these are written to a http.Request. */ type GetRegionsParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetRegionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRegionsParams) WithDefaults() *GetRegionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get regions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRegionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get regions params func (o *GetRegionsParams) WithTimeout(timeout time.Duration) *GetRegionsParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetRegionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/location/get_regions_responses.go b/pkg/client/location/get_regions_responses.go index 86a6aedc..ab4ff0bb 100644 --- a/pkg/client/location/get_regions_responses.go +++ b/pkg/client/location/get_regions_responses.go @@ -35,7 +35,6 @@ func (o *GetRegionsReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetRegionsOK() *GetRegionsOK { return &GetRegionsOK{} } -/*GetRegionsOK handles this case with default header values. +/* GetRegionsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetRegionsOK struct { func (o *GetRegionsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/regions][%d] getRegionsOK %+v", 200, o.Payload) } - func (o *GetRegionsOK) GetPayload() *models.RegionResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetRegionsForbidden() *GetRegionsForbidden { return &GetRegionsForbidden{} } -/*GetRegionsForbidden handles this case with default header values. +/* GetRegionsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetRegionsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetRegionsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/regions][%d] getRegionsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/regions][%d] getRegionsForbidden %+v", 403, o.Payload) +} +func (o *GetRegionsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetRegionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/location/get_zone_parameters.go b/pkg/client/location/get_zone_parameters.go index 464649ab..cbf51e8d 100644 --- a/pkg/client/location/get_zone_parameters.go +++ b/pkg/client/location/get_zone_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetZoneParams creates a new GetZoneParams object -// with the default values initialized. +// NewGetZoneParams creates a new GetZoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetZoneParams() *GetZoneParams { - var () return &GetZoneParams{ - timeout: cr.DefaultTimeout, } } // NewGetZoneParamsWithTimeout creates a new GetZoneParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetZoneParamsWithTimeout(timeout time.Duration) *GetZoneParams { - var () return &GetZoneParams{ - timeout: timeout, } } // NewGetZoneParamsWithContext creates a new GetZoneParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetZoneParamsWithContext(ctx context.Context) *GetZoneParams { - var () return &GetZoneParams{ - Context: ctx, } } // NewGetZoneParamsWithHTTPClient creates a new GetZoneParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetZoneParamsWithHTTPClient(client *http.Client) *GetZoneParams { - var () return &GetZoneParams{ HTTPClient: client, } } -/*GetZoneParams contains all the parameters to send to the API endpoint -for the get zone operation typically these are written to a http.Request +/* GetZoneParams contains all the parameters to send to the API endpoint + for the get zone operation. + + Typically these are written to a http.Request. */ type GetZoneParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the zone. + /* ID. + + The ID of the zone. */ ID string @@ -76,6 +76,21 @@ type GetZoneParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZoneParams) WithDefaults() *GetZoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZoneParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get zone params func (o *GetZoneParams) WithTimeout(timeout time.Duration) *GetZoneParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetZoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/location/get_zone_responses.go b/pkg/client/location/get_zone_responses.go index dfaf5a2c..2f6979f2 100644 --- a/pkg/client/location/get_zone_responses.go +++ b/pkg/client/location/get_zone_responses.go @@ -41,7 +41,6 @@ func (o *GetZoneReader) ReadResponse(response runtime.ClientResponse, consumer r return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetZoneOK() *GetZoneOK { return &GetZoneOK{} } -/*GetZoneOK handles this case with default header values. +/* GetZoneOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetZoneOK struct { func (o *GetZoneOK) Error() string { return fmt.Sprintf("[GET /iaas/api/zones/{id}][%d] getZoneOK %+v", 200, o.Payload) } - func (o *GetZoneOK) GetPayload() *models.Zone { return o.Payload } @@ -85,19 +83,30 @@ func NewGetZoneForbidden() *GetZoneForbidden { return &GetZoneForbidden{} } -/*GetZoneForbidden handles this case with default header values. +/* GetZoneForbidden describes a response with status code 403, with default header values. Forbidden */ type GetZoneForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetZoneForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/zones/{id}][%d] getZoneForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/zones/{id}][%d] getZoneForbidden %+v", 403, o.Payload) +} +func (o *GetZoneForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetZoneForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetZoneNotFound() *GetZoneNotFound { return &GetZoneNotFound{} } -/*GetZoneNotFound handles this case with default header values. +/* GetZoneNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetZoneNotFound struct { func (o *GetZoneNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/zones/{id}][%d] getZoneNotFound %+v", 404, o.Payload) } - func (o *GetZoneNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/location/get_zones_parameters.go b/pkg/client/location/get_zones_parameters.go index 808b0854..6fe4c9ad 100644 --- a/pkg/client/location/get_zones_parameters.go +++ b/pkg/client/location/get_zones_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetZonesParams creates a new GetZonesParams object -// with the default values initialized. +// NewGetZonesParams creates a new GetZonesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetZonesParams() *GetZonesParams { - var () return &GetZonesParams{ - timeout: cr.DefaultTimeout, } } // NewGetZonesParamsWithTimeout creates a new GetZonesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetZonesParamsWithTimeout(timeout time.Duration) *GetZonesParams { - var () return &GetZonesParams{ - timeout: timeout, } } // NewGetZonesParamsWithContext creates a new GetZonesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetZonesParamsWithContext(ctx context.Context) *GetZonesParams { - var () return &GetZonesParams{ - Context: ctx, } } // NewGetZonesParamsWithHTTPClient creates a new GetZonesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetZonesParamsWithHTTPClient(client *http.Client) *GetZonesParams { - var () return &GetZonesParams{ HTTPClient: client, } } -/*GetZonesParams contains all the parameters to send to the API endpoint -for the get zones operation typically these are written to a http.Request +/* GetZonesParams contains all the parameters to send to the API endpoint + for the get zones operation. + + Typically these are written to a http.Request. */ type GetZonesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetZonesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZonesParams) WithDefaults() *GetZonesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZonesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get zones params func (o *GetZonesParams) WithTimeout(timeout time.Duration) *GetZonesParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetZonesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/location/get_zones_responses.go b/pkg/client/location/get_zones_responses.go index 3838b82c..22a9a1db 100644 --- a/pkg/client/location/get_zones_responses.go +++ b/pkg/client/location/get_zones_responses.go @@ -35,7 +35,6 @@ func (o *GetZonesReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetZonesOK() *GetZonesOK { return &GetZonesOK{} } -/*GetZonesOK handles this case with default header values. +/* GetZonesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetZonesOK struct { func (o *GetZonesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/zones][%d] getZonesOK %+v", 200, o.Payload) } - func (o *GetZonesOK) GetPayload() *models.ZoneResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetZonesForbidden() *GetZonesForbidden { return &GetZonesForbidden{} } -/*GetZonesForbidden handles this case with default header values. +/* GetZonesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetZonesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetZonesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/zones][%d] getZonesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/zones][%d] getZonesForbidden %+v", 403, o.Payload) +} +func (o *GetZonesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetZonesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/location/location_client.go b/pkg/client/location/location_client.go index e1613481..b234de88 100644 --- a/pkg/client/location/location_client.go +++ b/pkg/client/location/location_client.go @@ -25,23 +25,26 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateZone(params *CreateZoneParams) (*CreateZoneCreated, error) + CreateZone(params *CreateZoneParams, opts ...ClientOption) (*CreateZoneCreated, error) - DeleteZone(params *DeleteZoneParams) (*DeleteZoneNoContent, error) + DeleteZone(params *DeleteZoneParams, opts ...ClientOption) (*DeleteZoneNoContent, error) - GetComputes(params *GetComputesParams) (*GetComputesOK, error) + GetComputes(params *GetComputesParams, opts ...ClientOption) (*GetComputesOK, error) - GetRegion(params *GetRegionParams) (*GetRegionOK, error) + GetRegion(params *GetRegionParams, opts ...ClientOption) (*GetRegionOK, error) - GetRegions(params *GetRegionsParams) (*GetRegionsOK, error) + GetRegions(params *GetRegionsParams, opts ...ClientOption) (*GetRegionsOK, error) - GetZone(params *GetZoneParams) (*GetZoneOK, error) + GetZone(params *GetZoneParams, opts ...ClientOption) (*GetZoneOK, error) - GetZones(params *GetZonesParams) (*GetZonesOK, error) + GetZones(params *GetZonesParams, opts ...ClientOption) (*GetZonesOK, error) - UpdateZone(params *UpdateZoneParams) (*UpdateZoneOK, error) + UpdateZone(params *UpdateZoneParams, opts ...ClientOption) (*UpdateZoneOK, error) SetTransport(transport runtime.ClientTransport) } @@ -51,13 +54,12 @@ type ClientService interface { Create zone */ -func (a *Client) CreateZone(params *CreateZoneParams) (*CreateZoneCreated, error) { +func (a *Client) CreateZone(params *CreateZoneParams, opts ...ClientOption) (*CreateZoneCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateZoneParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createZone", Method: "POST", PathPattern: "/iaas/api/zones", @@ -68,7 +70,12 @@ func (a *Client) CreateZone(params *CreateZoneParams) (*CreateZoneCreated, error Reader: &CreateZoneReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -87,13 +94,12 @@ func (a *Client) CreateZone(params *CreateZoneParams) (*CreateZoneCreated, error Delete a zone */ -func (a *Client) DeleteZone(params *DeleteZoneParams) (*DeleteZoneNoContent, error) { +func (a *Client) DeleteZone(params *DeleteZoneParams, opts ...ClientOption) (*DeleteZoneNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteZoneParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteZone", Method: "DELETE", PathPattern: "/iaas/api/zones/{id}", @@ -104,7 +110,12 @@ func (a *Client) DeleteZone(params *DeleteZoneParams) (*DeleteZoneNoContent, err Reader: &DeleteZoneReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -123,13 +134,12 @@ func (a *Client) DeleteZone(params *DeleteZoneParams) (*DeleteZoneNoContent, err Get zone's computes by given zone ID */ -func (a *Client) GetComputes(params *GetComputesParams) (*GetComputesOK, error) { +func (a *Client) GetComputes(params *GetComputesParams, opts ...ClientOption) (*GetComputesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetComputesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getComputes", Method: "GET", PathPattern: "/iaas/api/zones/{id}/computes", @@ -140,7 +150,12 @@ func (a *Client) GetComputes(params *GetComputesParams) (*GetComputesOK, error) Reader: &GetComputesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -159,13 +174,12 @@ func (a *Client) GetComputes(params *GetComputesParams) (*GetComputesOK, error) Get Region with a given id */ -func (a *Client) GetRegion(params *GetRegionParams) (*GetRegionOK, error) { +func (a *Client) GetRegion(params *GetRegionParams, opts ...ClientOption) (*GetRegionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRegionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRegion", Method: "GET", PathPattern: "/iaas/api/regions/{id}", @@ -176,7 +190,12 @@ func (a *Client) GetRegion(params *GetRegionParams) (*GetRegionOK, error) { Reader: &GetRegionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -195,13 +214,12 @@ func (a *Client) GetRegion(params *GetRegionParams) (*GetRegionOK, error) { Get all regions */ -func (a *Client) GetRegions(params *GetRegionsParams) (*GetRegionsOK, error) { +func (a *Client) GetRegions(params *GetRegionsParams, opts ...ClientOption) (*GetRegionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRegionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRegions", Method: "GET", PathPattern: "/iaas/api/regions", @@ -212,7 +230,12 @@ func (a *Client) GetRegions(params *GetRegionsParams) (*GetRegionsOK, error) { Reader: &GetRegionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -231,13 +254,12 @@ func (a *Client) GetRegions(params *GetRegionsParams) (*GetRegionsOK, error) { Get zone with given id */ -func (a *Client) GetZone(params *GetZoneParams) (*GetZoneOK, error) { +func (a *Client) GetZone(params *GetZoneParams, opts ...ClientOption) (*GetZoneOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetZoneParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getZone", Method: "GET", PathPattern: "/iaas/api/zones/{id}", @@ -248,7 +270,12 @@ func (a *Client) GetZone(params *GetZoneParams) (*GetZoneOK, error) { Reader: &GetZoneReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -267,13 +294,12 @@ func (a *Client) GetZone(params *GetZoneParams) (*GetZoneOK, error) { Get all zones */ -func (a *Client) GetZones(params *GetZonesParams) (*GetZonesOK, error) { +func (a *Client) GetZones(params *GetZonesParams, opts ...ClientOption) (*GetZonesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetZonesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getZones", Method: "GET", PathPattern: "/iaas/api/zones", @@ -284,7 +310,12 @@ func (a *Client) GetZones(params *GetZonesParams) (*GetZonesOK, error) { Reader: &GetZonesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -303,13 +334,12 @@ func (a *Client) GetZones(params *GetZonesParams) (*GetZonesOK, error) { Update zone */ -func (a *Client) UpdateZone(params *UpdateZoneParams) (*UpdateZoneOK, error) { +func (a *Client) UpdateZone(params *UpdateZoneParams, opts ...ClientOption) (*UpdateZoneOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateZoneParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateZone", Method: "PATCH", PathPattern: "/iaas/api/zones/{id}", @@ -320,7 +350,12 @@ func (a *Client) UpdateZone(params *UpdateZoneParams) (*UpdateZoneOK, error) { Reader: &UpdateZoneReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/location/update_zone_parameters.go b/pkg/client/location/update_zone_parameters.go index bd414a84..bdf6a2f9 100644 --- a/pkg/client/location/update_zone_parameters.go +++ b/pkg/client/location/update_zone_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateZoneParams creates a new UpdateZoneParams object -// with the default values initialized. +// NewUpdateZoneParams creates a new UpdateZoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateZoneParams() *UpdateZoneParams { - var () return &UpdateZoneParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateZoneParamsWithTimeout creates a new UpdateZoneParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateZoneParamsWithTimeout(timeout time.Duration) *UpdateZoneParams { - var () return &UpdateZoneParams{ - timeout: timeout, } } // NewUpdateZoneParamsWithContext creates a new UpdateZoneParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateZoneParamsWithContext(ctx context.Context) *UpdateZoneParams { - var () return &UpdateZoneParams{ - Context: ctx, } } // NewUpdateZoneParamsWithHTTPClient creates a new UpdateZoneParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateZoneParamsWithHTTPClient(client *http.Client) *UpdateZoneParams { - var () return &UpdateZoneParams{ HTTPClient: client, } } -/*UpdateZoneParams contains all the parameters to send to the API endpoint -for the update zone operation typically these are written to a http.Request +/* UpdateZoneParams contains all the parameters to send to the API endpoint + for the update zone operation. + + Typically these are written to a http.Request. */ type UpdateZoneParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Zone specification + /* Body. + + Zone specification */ Body *models.ZoneSpecification - /*ID - The ID of the zone. + /* ID. + + The ID of the zone. */ ID string @@ -83,6 +84,21 @@ type UpdateZoneParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateZoneParams) WithDefaults() *UpdateZoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update zone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateZoneParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update zone params func (o *UpdateZoneParams) WithTimeout(timeout time.Duration) *UpdateZoneParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateZoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/location/update_zone_responses.go b/pkg/client/location/update_zone_responses.go index 9601c9e5..3d999916 100644 --- a/pkg/client/location/update_zone_responses.go +++ b/pkg/client/location/update_zone_responses.go @@ -41,7 +41,6 @@ func (o *UpdateZoneReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateZoneOK() *UpdateZoneOK { return &UpdateZoneOK{} } -/*UpdateZoneOK handles this case with default header values. +/* UpdateZoneOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateZoneOK struct { func (o *UpdateZoneOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/zones/{id}][%d] updateZoneOK %+v", 200, o.Payload) } - func (o *UpdateZoneOK) GetPayload() *models.Zone { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateZoneBadRequest() *UpdateZoneBadRequest { return &UpdateZoneBadRequest{} } -/*UpdateZoneBadRequest handles this case with default header values. +/* UpdateZoneBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateZoneBadRequest struct { func (o *UpdateZoneBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/zones/{id}][%d] updateZoneBadRequest %+v", 400, o.Payload) } - func (o *UpdateZoneBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateZoneForbidden() *UpdateZoneForbidden { return &UpdateZoneForbidden{} } -/*UpdateZoneForbidden handles this case with default header values. +/* UpdateZoneForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateZoneForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateZoneForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/zones/{id}][%d] updateZoneForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/zones/{id}][%d] updateZoneForbidden %+v", 403, o.Payload) +} +func (o *UpdateZoneForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateZoneForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/login/login_client.go b/pkg/client/login/login_client.go index 811f8466..38e1f5f7 100644 --- a/pkg/client/login/login_client.go +++ b/pkg/client/login/login_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - RetrieveAuthToken(params *RetrieveAuthTokenParams) (*RetrieveAuthTokenOK, error) + RetrieveAuthToken(params *RetrieveAuthTokenParams, opts ...ClientOption) (*RetrieveAuthTokenOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { When accessing other endpoints the `Bearer` authentication scheme and the received `token` must be provided in the `Authorization` request header field as follows: `Authorization: Bearer {token}` */ -func (a *Client) RetrieveAuthToken(params *RetrieveAuthTokenParams) (*RetrieveAuthTokenOK, error) { +func (a *Client) RetrieveAuthToken(params *RetrieveAuthTokenParams, opts ...ClientOption) (*RetrieveAuthTokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRetrieveAuthTokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "retrieveAuthToken", Method: "POST", PathPattern: "/iaas/api/login", @@ -56,7 +58,12 @@ func (a *Client) RetrieveAuthToken(params *RetrieveAuthTokenParams) (*RetrieveAu Reader: &RetrieveAuthTokenReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/login/retrieve_auth_token_parameters.go b/pkg/client/login/retrieve_auth_token_parameters.go index dc3538ff..4ed7a672 100644 --- a/pkg/client/login/retrieve_auth_token_parameters.go +++ b/pkg/client/login/retrieve_auth_token_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewRetrieveAuthTokenParams creates a new RetrieveAuthTokenParams object -// with the default values initialized. +// NewRetrieveAuthTokenParams creates a new RetrieveAuthTokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRetrieveAuthTokenParams() *RetrieveAuthTokenParams { - var () return &RetrieveAuthTokenParams{ - timeout: cr.DefaultTimeout, } } // NewRetrieveAuthTokenParamsWithTimeout creates a new RetrieveAuthTokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRetrieveAuthTokenParamsWithTimeout(timeout time.Duration) *RetrieveAuthTokenParams { - var () return &RetrieveAuthTokenParams{ - timeout: timeout, } } // NewRetrieveAuthTokenParamsWithContext creates a new RetrieveAuthTokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRetrieveAuthTokenParamsWithContext(ctx context.Context) *RetrieveAuthTokenParams { - var () return &RetrieveAuthTokenParams{ - Context: ctx, } } // NewRetrieveAuthTokenParamsWithHTTPClient creates a new RetrieveAuthTokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRetrieveAuthTokenParamsWithHTTPClient(client *http.Client) *RetrieveAuthTokenParams { - var () return &RetrieveAuthTokenParams{ HTTPClient: client, } } -/*RetrieveAuthTokenParams contains all the parameters to send to the API endpoint -for the retrieve auth token operation typically these are written to a http.Request +/* RetrieveAuthTokenParams contains all the parameters to send to the API endpoint + for the retrieve auth token operation. + + Typically these are written to a http.Request. */ type RetrieveAuthTokenParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - CspLoginSpecification instance + /* Body. + + CspLoginSpecification instance */ Body *models.CspLoginSpecification @@ -78,6 +78,21 @@ type RetrieveAuthTokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the retrieve auth token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RetrieveAuthTokenParams) WithDefaults() *RetrieveAuthTokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the retrieve auth token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RetrieveAuthTokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the retrieve auth token params func (o *RetrieveAuthTokenParams) WithTimeout(timeout time.Duration) *RetrieveAuthTokenParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *RetrieveAuthTokenParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/login/retrieve_auth_token_responses.go b/pkg/client/login/retrieve_auth_token_responses.go index 440abb27..bd07adc0 100644 --- a/pkg/client/login/retrieve_auth_token_responses.go +++ b/pkg/client/login/retrieve_auth_token_responses.go @@ -41,7 +41,6 @@ func (o *RetrieveAuthTokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewRetrieveAuthTokenOK() *RetrieveAuthTokenOK { return &RetrieveAuthTokenOK{} } -/*RetrieveAuthTokenOK handles this case with default header values. +/* RetrieveAuthTokenOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type RetrieveAuthTokenOK struct { func (o *RetrieveAuthTokenOK) Error() string { return fmt.Sprintf("[POST /iaas/api/login][%d] retrieveAuthTokenOK %+v", 200, o.Payload) } - func (o *RetrieveAuthTokenOK) GetPayload() *models.AuthResponse { return o.Payload } @@ -85,7 +83,7 @@ func NewRetrieveAuthTokenBadRequest() *RetrieveAuthTokenBadRequest { return &RetrieveAuthTokenBadRequest{} } -/*RetrieveAuthTokenBadRequest handles this case with default header values. +/* RetrieveAuthTokenBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type RetrieveAuthTokenBadRequest struct { func (o *RetrieveAuthTokenBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/login][%d] retrieveAuthTokenBadRequest %+v", 400, o.Payload) } - func (o *RetrieveAuthTokenBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewRetrieveAuthTokenForbidden() *RetrieveAuthTokenForbidden { return &RetrieveAuthTokenForbidden{} } -/*RetrieveAuthTokenForbidden handles this case with default header values. +/* RetrieveAuthTokenForbidden describes a response with status code 403, with default header values. Forbidden */ type RetrieveAuthTokenForbidden struct { + Payload *models.ServiceErrorResponse } func (o *RetrieveAuthTokenForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/login][%d] retrieveAuthTokenForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/login][%d] retrieveAuthTokenForbidden %+v", 403, o.Payload) +} +func (o *RetrieveAuthTokenForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *RetrieveAuthTokenForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/marketplace/filter_items_using_get_parameters.go b/pkg/client/marketplace/filter_items_using_get_parameters.go index c70c5f38..569f9da2 100644 --- a/pkg/client/marketplace/filter_items_using_get_parameters.go +++ b/pkg/client/marketplace/filter_items_using_get_parameters.go @@ -16,68 +16,72 @@ import ( "github.com/go-openapi/strfmt" ) -// NewFilterItemsUsingGETParams creates a new FilterItemsUsingGETParams object -// with the default values initialized. +// NewFilterItemsUsingGETParams creates a new FilterItemsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewFilterItemsUsingGETParams() *FilterItemsUsingGETParams { - var () return &FilterItemsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewFilterItemsUsingGETParamsWithTimeout creates a new FilterItemsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewFilterItemsUsingGETParamsWithTimeout(timeout time.Duration) *FilterItemsUsingGETParams { - var () return &FilterItemsUsingGETParams{ - timeout: timeout, } } // NewFilterItemsUsingGETParamsWithContext creates a new FilterItemsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewFilterItemsUsingGETParamsWithContext(ctx context.Context) *FilterItemsUsingGETParams { - var () return &FilterItemsUsingGETParams{ - Context: ctx, } } // NewFilterItemsUsingGETParamsWithHTTPClient creates a new FilterItemsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewFilterItemsUsingGETParamsWithHTTPClient(client *http.Client) *FilterItemsUsingGETParams { - var () return &FilterItemsUsingGETParams{ HTTPClient: client, } } -/*FilterItemsUsingGETParams contains all the parameters to send to the API endpoint -for the filter items using g e t operation typically these are written to a http.Request +/* FilterItemsUsingGETParams contains all the parameters to send to the API endpoint + for the filter items using g e t operation. + + Typically these are written to a http.Request. */ type FilterItemsUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*FilterID - Filter type + /* FilterID. + + Filter type */ FilterID string - /*Name - Filters items by name + /* Name. + + Filters items by name */ Name *string - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -86,6 +90,21 @@ type FilterItemsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the filter items using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FilterItemsUsingGETParams) WithDefaults() *FilterItemsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the filter items using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FilterItemsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the filter items using get params func (o *FilterItemsUsingGETParams) WithTimeout(timeout time.Duration) *FilterItemsUsingGETParams { o.SetTimeout(timeout) @@ -175,16 +194,17 @@ func (o *FilterItemsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param filterId @@ -196,16 +216,17 @@ func (o *FilterItemsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // 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 } } - } // path param sourceId diff --git a/pkg/client/marketplace/filter_items_using_get_responses.go b/pkg/client/marketplace/filter_items_using_get_responses.go index e75b9505..75dc2629 100644 --- a/pkg/client/marketplace/filter_items_using_get_responses.go +++ b/pkg/client/marketplace/filter_items_using_get_responses.go @@ -35,7 +35,6 @@ func (o *FilterItemsUsingGETReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewFilterItemsUsingGETOK() *FilterItemsUsingGETOK { return &FilterItemsUsingGETOK{} } -/*FilterItemsUsingGETOK handles this case with default header values. +/* FilterItemsUsingGETOK describes a response with status code 200, with default header values. Filter entries */ @@ -57,7 +56,6 @@ type FilterItemsUsingGETOK struct { func (o *FilterItemsUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/filters/{filterId}][%d] filterItemsUsingGETOK %+v", 200, o.Payload) } - func (o *FilterItemsUsingGETOK) GetPayload() *models.MarketplaceFilterEntries { return o.Payload } @@ -79,7 +77,7 @@ func NewFilterItemsUsingGETNotFound() *FilterItemsUsingGETNotFound { return &FilterItemsUsingGETNotFound{} } -/*FilterItemsUsingGETNotFound handles this case with default header values. +/* FilterItemsUsingGETNotFound describes a response with status code 404, with default header values. Source or Filter not found */ @@ -90,7 +88,6 @@ type FilterItemsUsingGETNotFound struct { func (o *FilterItemsUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/filters/{filterId}][%d] filterItemsUsingGETNotFound %+v", 404, o.Payload) } - func (o *FilterItemsUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace/filters_using_get_parameters.go b/pkg/client/marketplace/filters_using_get_parameters.go index 4355ee2c..5ab10326 100644 --- a/pkg/client/marketplace/filters_using_get_parameters.go +++ b/pkg/client/marketplace/filters_using_get_parameters.go @@ -17,75 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewFiltersUsingGETParams creates a new FiltersUsingGETParams object -// with the default values initialized. +// NewFiltersUsingGETParams creates a new FiltersUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewFiltersUsingGETParams() *FiltersUsingGETParams { - var ( - expandDefault = bool(false) - ) return &FiltersUsingGETParams{ - Expand: &expandDefault, - timeout: cr.DefaultTimeout, } } // NewFiltersUsingGETParamsWithTimeout creates a new FiltersUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewFiltersUsingGETParamsWithTimeout(timeout time.Duration) *FiltersUsingGETParams { - var ( - expandDefault = bool(false) - ) return &FiltersUsingGETParams{ - Expand: &expandDefault, - timeout: timeout, } } // NewFiltersUsingGETParamsWithContext creates a new FiltersUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewFiltersUsingGETParamsWithContext(ctx context.Context) *FiltersUsingGETParams { - var ( - expandDefault = bool(false) - ) return &FiltersUsingGETParams{ - Expand: &expandDefault, - Context: ctx, } } // NewFiltersUsingGETParamsWithHTTPClient creates a new FiltersUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewFiltersUsingGETParamsWithHTTPClient(client *http.Client) *FiltersUsingGETParams { - var ( - expandDefault = bool(false) - ) return &FiltersUsingGETParams{ - Expand: &expandDefault, HTTPClient: client, } } -/*FiltersUsingGETParams contains all the parameters to send to the API endpoint -for the filters using g e t operation typically these are written to a http.Request +/* FiltersUsingGETParams contains all the parameters to send to the API endpoint + for the filters using g e t operation. + + Typically these are written to a http.Request. */ type FiltersUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*Expand - expand + /* Expand. + + expand */ Expand *bool - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -94,6 +85,32 @@ type FiltersUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the filters using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FiltersUsingGETParams) WithDefaults() *FiltersUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the filters using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FiltersUsingGETParams) SetDefaults() { + var ( + expandDefault = bool(false) + ) + + val := FiltersUsingGETParams{ + Expand: &expandDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the filters using get params func (o *FiltersUsingGETParams) WithTimeout(timeout time.Duration) *FiltersUsingGETParams { o.SetTimeout(timeout) @@ -172,32 +189,34 @@ func (o *FiltersUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strf // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Expand != nil { // query param expand var qrExpand bool + if o.Expand != nil { qrExpand = *o.Expand } qExpand := swag.FormatBool(qrExpand) if qExpand != "" { + if err := r.SetQueryParam("expand", qExpand); err != nil { return err } } - } // path param sourceId diff --git a/pkg/client/marketplace/filters_using_get_responses.go b/pkg/client/marketplace/filters_using_get_responses.go index 3f4add52..9ca48c56 100644 --- a/pkg/client/marketplace/filters_using_get_responses.go +++ b/pkg/client/marketplace/filters_using_get_responses.go @@ -35,7 +35,6 @@ func (o *FiltersUsingGETReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewFiltersUsingGETOK() *FiltersUsingGETOK { return &FiltersUsingGETOK{} } -/*FiltersUsingGETOK handles this case with default header values. +/* FiltersUsingGETOK describes a response with status code 200, with default header values. Marketplace filters */ @@ -57,7 +56,6 @@ type FiltersUsingGETOK struct { func (o *FiltersUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/filters][%d] filtersUsingGETOK %+v", 200, o.Payload) } - func (o *FiltersUsingGETOK) GetPayload() *models.MarketplaceFilterSchema { return o.Payload } @@ -79,7 +77,7 @@ func NewFiltersUsingGETNotFound() *FiltersUsingGETNotFound { return &FiltersUsingGETNotFound{} } -/*FiltersUsingGETNotFound handles this case with default header values. +/* FiltersUsingGETNotFound describes a response with status code 404, with default header values. Source not found */ @@ -90,7 +88,6 @@ type FiltersUsingGETNotFound struct { func (o *FiltersUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/filters][%d] filtersUsingGETNotFound %+v", 404, o.Payload) } - func (o *FiltersUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace/get_details_parameters.go b/pkg/client/marketplace/get_details_parameters.go index ddd8ed42..224ad40d 100644 --- a/pkg/client/marketplace/get_details_parameters.go +++ b/pkg/client/marketplace/get_details_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDetailsParams creates a new GetDetailsParams object -// with the default values initialized. +// NewGetDetailsParams creates a new GetDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDetailsParams() *GetDetailsParams { - var () return &GetDetailsParams{ - timeout: cr.DefaultTimeout, } } // NewGetDetailsParamsWithTimeout creates a new GetDetailsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDetailsParamsWithTimeout(timeout time.Duration) *GetDetailsParams { - var () return &GetDetailsParams{ - timeout: timeout, } } // NewGetDetailsParamsWithContext creates a new GetDetailsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDetailsParamsWithContext(ctx context.Context) *GetDetailsParams { - var () return &GetDetailsParams{ - Context: ctx, } } // NewGetDetailsParamsWithHTTPClient creates a new GetDetailsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDetailsParamsWithHTTPClient(client *http.Client) *GetDetailsParams { - var () return &GetDetailsParams{ HTTPClient: client, } } -/*GetDetailsParams contains all the parameters to send to the API endpoint -for the get details operation typically these are written to a http.Request +/* GetDetailsParams contains all the parameters to send to the API endpoint + for the get details operation. + + Typically these are written to a http.Request. */ type GetDetailsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentID - Content Id + /* ContentID. + + Content Id */ ContentID string - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -81,6 +84,21 @@ type GetDetailsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDetailsParams) WithDefaults() *GetDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get details params func (o *GetDetailsParams) WithTimeout(timeout time.Duration) *GetDetailsParams { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *GetDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param contentId diff --git a/pkg/client/marketplace/get_details_responses.go b/pkg/client/marketplace/get_details_responses.go index 44e1f1b7..0e160a17 100644 --- a/pkg/client/marketplace/get_details_responses.go +++ b/pkg/client/marketplace/get_details_responses.go @@ -35,7 +35,6 @@ func (o *GetDetailsReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetDetailsOK() *GetDetailsOK { return &GetDetailsOK{} } -/*GetDetailsOK handles this case with default header values. +/* GetDetailsOK describes a response with status code 200, with default header values. Content Details */ @@ -57,7 +56,6 @@ type GetDetailsOK struct { func (o *GetDetailsOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}][%d] getDetailsOK %+v", 200, o.Payload) } - func (o *GetDetailsOK) GetPayload() *models.MarketplaceContent { return o.Payload } @@ -79,7 +77,7 @@ func NewGetDetailsNotFound() *GetDetailsNotFound { return &GetDetailsNotFound{} } -/*GetDetailsNotFound handles this case with default header values. +/* GetDetailsNotFound describes a response with status code 404, with default header values. Source or Content not found */ @@ -90,7 +88,6 @@ type GetDetailsNotFound struct { func (o *GetDetailsNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}][%d] getDetailsNotFound %+v", 404, o.Payload) } - func (o *GetDetailsNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace/get_link_parameters.go b/pkg/client/marketplace/get_link_parameters.go index d0abf965..1f72df4c 100644 --- a/pkg/client/marketplace/get_link_parameters.go +++ b/pkg/client/marketplace/get_link_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLinkParams creates a new GetLinkParams object -// with the default values initialized. +// NewGetLinkParams creates a new GetLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLinkParams() *GetLinkParams { - var () return &GetLinkParams{ - timeout: cr.DefaultTimeout, } } // NewGetLinkParamsWithTimeout creates a new GetLinkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLinkParamsWithTimeout(timeout time.Duration) *GetLinkParams { - var () return &GetLinkParams{ - timeout: timeout, } } // NewGetLinkParamsWithContext creates a new GetLinkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLinkParamsWithContext(ctx context.Context) *GetLinkParams { - var () return &GetLinkParams{ - Context: ctx, } } // NewGetLinkParamsWithHTTPClient creates a new GetLinkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLinkParamsWithHTTPClient(client *http.Client) *GetLinkParams { - var () return &GetLinkParams{ HTTPClient: client, } } -/*GetLinkParams contains all the parameters to send to the API endpoint -for the get link operation typically these are written to a http.Request +/* GetLinkParams contains all the parameters to send to the API endpoint + for the get link operation. + + Typically these are written to a http.Request. */ type GetLinkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentID - Content Id + /* ContentID. + + Content Id */ ContentID string - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -81,6 +84,21 @@ type GetLinkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkParams) WithDefaults() *GetLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get link params func (o *GetLinkParams) WithTimeout(timeout time.Duration) *GetLinkParams { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *GetLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param contentId diff --git a/pkg/client/marketplace/get_link_responses.go b/pkg/client/marketplace/get_link_responses.go index 98168a46..5bdb2a1c 100644 --- a/pkg/client/marketplace/get_link_responses.go +++ b/pkg/client/marketplace/get_link_responses.go @@ -35,7 +35,6 @@ func (o *GetLinkReader) ReadResponse(response runtime.ClientResponse, consumer r return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetLinkOK() *GetLinkOK { return &GetLinkOK{} } -/*GetLinkOK handles this case with default header values. +/* GetLinkOK describes a response with status code 200, with default header values. Link to Content */ @@ -57,7 +56,6 @@ type GetLinkOK struct { func (o *GetLinkOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}/link][%d] getLinkOK %+v", 200, o.Payload) } - func (o *GetLinkOK) GetPayload() *models.MarketplaceContentLink { return o.Payload } @@ -79,7 +77,7 @@ func NewGetLinkNotFound() *GetLinkNotFound { return &GetLinkNotFound{} } -/*GetLinkNotFound handles this case with default header values. +/* GetLinkNotFound describes a response with status code 404, with default header values. Source or Content not found */ @@ -90,7 +88,6 @@ type GetLinkNotFound struct { func (o *GetLinkNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}/link][%d] getLinkNotFound %+v", 404, o.Payload) } - func (o *GetLinkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace/get_reviews_parameters.go b/pkg/client/marketplace/get_reviews_parameters.go index d39ce390..aa7d5218 100644 --- a/pkg/client/marketplace/get_reviews_parameters.go +++ b/pkg/client/marketplace/get_reviews_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetReviewsParams creates a new GetReviewsParams object -// with the default values initialized. +// NewGetReviewsParams creates a new GetReviewsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetReviewsParams() *GetReviewsParams { - var () return &GetReviewsParams{ - timeout: cr.DefaultTimeout, } } // NewGetReviewsParamsWithTimeout creates a new GetReviewsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetReviewsParamsWithTimeout(timeout time.Duration) *GetReviewsParams { - var () return &GetReviewsParams{ - timeout: timeout, } } // NewGetReviewsParamsWithContext creates a new GetReviewsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetReviewsParamsWithContext(ctx context.Context) *GetReviewsParams { - var () return &GetReviewsParams{ - Context: ctx, } } // NewGetReviewsParamsWithHTTPClient creates a new GetReviewsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetReviewsParamsWithHTTPClient(client *http.Client) *GetReviewsParams { - var () return &GetReviewsParams{ HTTPClient: client, } } -/*GetReviewsParams contains all the parameters to send to the API endpoint -for the get reviews operation typically these are written to a http.Request +/* GetReviewsParams contains all the parameters to send to the API endpoint + for the get reviews operation. + + Typically these are written to a http.Request. */ type GetReviewsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentID - Content Id + /* ContentID. + + Content Id */ ContentID string - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -81,6 +84,21 @@ type GetReviewsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get reviews params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReviewsParams) WithDefaults() *GetReviewsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get reviews params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReviewsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get reviews params func (o *GetReviewsParams) WithTimeout(timeout time.Duration) *GetReviewsParams { o.SetTimeout(timeout) @@ -159,16 +177,17 @@ func (o *GetReviewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param contentId diff --git a/pkg/client/marketplace/get_reviews_responses.go b/pkg/client/marketplace/get_reviews_responses.go index 8ea4d0f7..93557b2c 100644 --- a/pkg/client/marketplace/get_reviews_responses.go +++ b/pkg/client/marketplace/get_reviews_responses.go @@ -35,7 +35,6 @@ func (o *GetReviewsReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetReviewsOK() *GetReviewsOK { return &GetReviewsOK{} } -/*GetReviewsOK handles this case with default header values. +/* GetReviewsOK describes a response with status code 200, with default header values. Content Reviews */ @@ -57,7 +56,6 @@ type GetReviewsOK struct { func (o *GetReviewsOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}/reviews][%d] getReviewsOK %+v", 200, o.Payload) } - func (o *GetReviewsOK) GetPayload() *models.MarketplaceContentReviews { return o.Payload } @@ -79,7 +77,7 @@ func NewGetReviewsNotFound() *GetReviewsNotFound { return &GetReviewsNotFound{} } -/*GetReviewsNotFound handles this case with default header values. +/* GetReviewsNotFound describes a response with status code 404, with default header values. Source or Content not found */ @@ -90,7 +88,6 @@ type GetReviewsNotFound struct { func (o *GetReviewsNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents/{contentId}/reviews][%d] getReviewsNotFound %+v", 404, o.Payload) } - func (o *GetReviewsNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace/marketplace_client.go b/pkg/client/marketplace/marketplace_client.go index f8c53393..6ce890e2 100644 --- a/pkg/client/marketplace/marketplace_client.go +++ b/pkg/client/marketplace/marketplace_client.go @@ -25,19 +25,22 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - FilterItemsUsingGET(params *FilterItemsUsingGETParams) (*FilterItemsUsingGETOK, error) + FilterItemsUsingGET(params *FilterItemsUsingGETParams, opts ...ClientOption) (*FilterItemsUsingGETOK, error) - FiltersUsingGET(params *FiltersUsingGETParams) (*FiltersUsingGETOK, error) + FiltersUsingGET(params *FiltersUsingGETParams, opts ...ClientOption) (*FiltersUsingGETOK, error) - GetDetails(params *GetDetailsParams) (*GetDetailsOK, error) + GetDetails(params *GetDetailsParams, opts ...ClientOption) (*GetDetailsOK, error) - GetLink(params *GetLinkParams) (*GetLinkOK, error) + GetLink(params *GetLinkParams, opts ...ClientOption) (*GetLinkOK, error) - GetReviews(params *GetReviewsParams) (*GetReviewsOK, error) + GetReviews(params *GetReviewsParams, opts ...ClientOption) (*GetReviewsOK, error) - Search(params *SearchParams) (*SearchOK, error) + Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { /* FilterItemsUsingGET lists filter entries for a filter */ -func (a *Client) FilterItemsUsingGET(params *FilterItemsUsingGETParams) (*FilterItemsUsingGETOK, error) { +func (a *Client) FilterItemsUsingGET(params *FilterItemsUsingGETParams, opts ...ClientOption) (*FilterItemsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewFilterItemsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "filterItemsUsingGET", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/filters/{filterId}", @@ -62,7 +64,12 @@ func (a *Client) FilterItemsUsingGET(params *FilterItemsUsingGETParams) (*Filter Reader: &FilterItemsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +86,12 @@ func (a *Client) FilterItemsUsingGET(params *FilterItemsUsingGETParams) (*Filter /* FiltersUsingGET lists filters by endpoint */ -func (a *Client) FiltersUsingGET(params *FiltersUsingGETParams) (*FiltersUsingGETOK, error) { +func (a *Client) FiltersUsingGET(params *FiltersUsingGETParams, opts ...ClientOption) (*FiltersUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewFiltersUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "filtersUsingGET", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/filters", @@ -96,7 +102,12 @@ func (a *Client) FiltersUsingGET(params *FiltersUsingGETParams) (*FiltersUsingGE Reader: &FiltersUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) FiltersUsingGET(params *FiltersUsingGETParams) (*FiltersUsingGE /* GetDetails gets content details */ -func (a *Client) GetDetails(params *GetDetailsParams) (*GetDetailsOK, error) { +func (a *Client) GetDetails(params *GetDetailsParams, opts ...ClientOption) (*GetDetailsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDetailsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDetails", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/contents/{contentId}", @@ -130,7 +140,12 @@ func (a *Client) GetDetails(params *GetDetailsParams) (*GetDetailsOK, error) { Reader: &GetDetailsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -147,13 +162,12 @@ func (a *Client) GetDetails(params *GetDetailsParams) (*GetDetailsOK, error) { /* GetLink gets link to the content */ -func (a *Client) GetLink(params *GetLinkParams) (*GetLinkOK, error) { +func (a *Client) GetLink(params *GetLinkParams, opts ...ClientOption) (*GetLinkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLinkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLink", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/contents/{contentId}/link", @@ -164,7 +178,12 @@ func (a *Client) GetLink(params *GetLinkParams) (*GetLinkOK, error) { Reader: &GetLinkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -181,13 +200,12 @@ func (a *Client) GetLink(params *GetLinkParams) (*GetLinkOK, error) { /* GetReviews gets reviews for the content */ -func (a *Client) GetReviews(params *GetReviewsParams) (*GetReviewsOK, error) { +func (a *Client) GetReviews(params *GetReviewsParams, opts ...ClientOption) (*GetReviewsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetReviewsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getReviews", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/contents/{contentId}/reviews", @@ -198,7 +216,12 @@ func (a *Client) GetReviews(params *GetReviewsParams) (*GetReviewsOK, error) { Reader: &GetReviewsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -215,13 +238,12 @@ func (a *Client) GetReviews(params *GetReviewsParams) (*GetReviewsOK, error) { /* Search searches for content based on the search term */ -func (a *Client) Search(params *SearchParams) (*SearchOK, error) { +func (a *Client) Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) { // TODO: Validate the params before sending if params == nil { params = NewSearchParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "search", Method: "GET", PathPattern: "/content/api/marketplace/sources/{sourceId}/contents", @@ -232,7 +254,12 @@ func (a *Client) Search(params *SearchParams) (*SearchOK, error) { Reader: &SearchReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/marketplace/search_parameters.go b/pkg/client/marketplace/search_parameters.go index c79a6315..0911e354 100644 --- a/pkg/client/marketplace/search_parameters.go +++ b/pkg/client/marketplace/search_parameters.go @@ -16,63 +16,66 @@ import ( "github.com/go-openapi/strfmt" ) -// NewSearchParams creates a new SearchParams object -// with the default values initialized. +// NewSearchParams creates a new SearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSearchParams() *SearchParams { - var () return &SearchParams{ - timeout: cr.DefaultTimeout, } } // NewSearchParamsWithTimeout creates a new SearchParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSearchParamsWithTimeout(timeout time.Duration) *SearchParams { - var () return &SearchParams{ - timeout: timeout, } } // NewSearchParamsWithContext creates a new SearchParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSearchParamsWithContext(ctx context.Context) *SearchParams { - var () return &SearchParams{ - Context: ctx, } } // NewSearchParamsWithHTTPClient creates a new SearchParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSearchParamsWithHTTPClient(client *http.Client) *SearchParams { - var () return &SearchParams{ HTTPClient: client, } } -/*SearchParams contains all the parameters to send to the API endpoint -for the search operation typically these are written to a http.Request +/* SearchParams contains all the parameters to send to the API endpoint + for the search operation. + + Typically these are written to a http.Request. */ type SearchParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*Search - Full-text search term + /* Search. + + Full-text search term */ Search *string - /*SourceID - Content Source Id + /* SourceID. + + Content Source Id + + Format: uuid */ SourceID strfmt.UUID @@ -81,6 +84,21 @@ type SearchParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) WithDefaults() *SearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the search params func (o *SearchParams) WithTimeout(timeout time.Duration) *SearchParams { o.SetTimeout(timeout) @@ -159,32 +177,34 @@ func (o *SearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } // path param sourceId diff --git a/pkg/client/marketplace/search_responses.go b/pkg/client/marketplace/search_responses.go index dd9be821..f75faa04 100644 --- a/pkg/client/marketplace/search_responses.go +++ b/pkg/client/marketplace/search_responses.go @@ -35,7 +35,6 @@ func (o *SearchReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewSearchOK() *SearchOK { return &SearchOK{} } -/*SearchOK handles this case with default header values. +/* SearchOK describes a response with status code 200, with default header values. Search result */ @@ -57,7 +56,6 @@ type SearchOK struct { func (o *SearchOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents][%d] searchOK %+v", 200, o.Payload) } - func (o *SearchOK) GetPayload() *models.MarketplaceContents { return o.Payload } @@ -79,7 +77,7 @@ func NewSearchNotFound() *SearchNotFound { return &SearchNotFound{} } -/*SearchNotFound handles this case with default header values. +/* SearchNotFound describes a response with status code 404, with default header values. Source not found */ @@ -90,7 +88,6 @@ type SearchNotFound struct { func (o *SearchNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/sources/{sourceId}/contents][%d] searchNotFound %+v", 404, o.Payload) } - func (o *SearchNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace_downloads/download_history_using_get_parameters.go b/pkg/client/marketplace_downloads/download_history_using_get_parameters.go index 71876799..b730b74e 100644 --- a/pkg/client/marketplace_downloads/download_history_using_get_parameters.go +++ b/pkg/client/marketplace_downloads/download_history_using_get_parameters.go @@ -17,73 +17,76 @@ import ( "github.com/go-openapi/swag" ) -// NewDownloadHistoryUsingGETParams creates a new DownloadHistoryUsingGETParams object -// with the default values initialized. +// NewDownloadHistoryUsingGETParams creates a new DownloadHistoryUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDownloadHistoryUsingGETParams() *DownloadHistoryUsingGETParams { - var () return &DownloadHistoryUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewDownloadHistoryUsingGETParamsWithTimeout creates a new DownloadHistoryUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDownloadHistoryUsingGETParamsWithTimeout(timeout time.Duration) *DownloadHistoryUsingGETParams { - var () return &DownloadHistoryUsingGETParams{ - timeout: timeout, } } // NewDownloadHistoryUsingGETParamsWithContext creates a new DownloadHistoryUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDownloadHistoryUsingGETParamsWithContext(ctx context.Context) *DownloadHistoryUsingGETParams { - var () return &DownloadHistoryUsingGETParams{ - Context: ctx, } } // NewDownloadHistoryUsingGETParamsWithHTTPClient creates a new DownloadHistoryUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDownloadHistoryUsingGETParamsWithHTTPClient(client *http.Client) *DownloadHistoryUsingGETParams { - var () return &DownloadHistoryUsingGETParams{ HTTPClient: client, } } -/*DownloadHistoryUsingGETParams contains all the parameters to send to the API endpoint -for the download history using g e t operation typically these are written to a http.Request +/* DownloadHistoryUsingGETParams contains all the parameters to send to the API endpoint + for the download history using g e t operation. + + Typically these are written to a http.Request. */ type DownloadHistoryUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentName - Search based on content name + /* ContentName. + + Search based on content name */ ContentName *string - /*ContentType - Search based on content type + /* ContentType. + + Search based on content type */ ContentType *string - /*Status - Search based on download status + /* Status. + + Search based on download status */ Status *string - /*TargetIds - Search based on target Ids + /* TargetIds. + + Search based on target Ids */ TargetIds []string @@ -92,6 +95,21 @@ type DownloadHistoryUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the download history using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadHistoryUsingGETParams) WithDefaults() *DownloadHistoryUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download history using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadHistoryUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the download history using get params func (o *DownloadHistoryUsingGETParams) WithTimeout(timeout time.Duration) *DownloadHistoryUsingGETParams { o.SetTimeout(timeout) @@ -192,72 +210,79 @@ func (o *DownloadHistoryUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ContentName != nil { // query param contentName var qrContentName string + if o.ContentName != nil { qrContentName = *o.ContentName } qContentName := qrContentName if qContentName != "" { + if err := r.SetQueryParam("contentName", qContentName); err != nil { return err } } - } if o.ContentType != nil { // query param contentType var qrContentType string + if o.ContentType != nil { qrContentType = *o.ContentType } qContentType := qrContentType if qContentType != "" { + if err := r.SetQueryParam("contentType", qContentType); 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 } } - } - valuesTargetIds := o.TargetIds + if o.TargetIds != nil { - joinedTargetIds := swag.JoinByFormat(valuesTargetIds, "multi") - // query array param targetIds - if err := r.SetQueryParam("targetIds", joinedTargetIds...); err != nil { - return err + // binding items for targetIds + joinedTargetIds := o.bindParamTargetIds(reg) + + // query array param targetIds + if err := r.SetQueryParam("targetIds", joinedTargetIds...); err != nil { + return err + } } if len(res) > 0 { @@ -265,3 +290,20 @@ func (o *DownloadHistoryUsingGETParams) WriteToRequest(r runtime.ClientRequest, } return nil } + +// bindParamDownloadHistoryUsingGET binds the parameter targetIds +func (o *DownloadHistoryUsingGETParams) bindParamTargetIds(formats strfmt.Registry) []string { + targetIdsIR := o.TargetIds + + var targetIdsIC []string + for _, targetIdsIIR := range targetIdsIR { // explode []string + + targetIdsIIV := targetIdsIIR // string as string + targetIdsIC = append(targetIdsIC, targetIdsIIV) + } + + // items.CollectionFormat: "multi" + targetIdsIS := swag.JoinByFormat(targetIdsIC, "multi") + + return targetIdsIS +} diff --git a/pkg/client/marketplace_downloads/download_history_using_get_responses.go b/pkg/client/marketplace_downloads/download_history_using_get_responses.go index 3136d90f..cdec1472 100644 --- a/pkg/client/marketplace_downloads/download_history_using_get_responses.go +++ b/pkg/client/marketplace_downloads/download_history_using_get_responses.go @@ -29,7 +29,6 @@ func (o *DownloadHistoryUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewDownloadHistoryUsingGETOK() *DownloadHistoryUsingGETOK { return &DownloadHistoryUsingGETOK{} } -/*DownloadHistoryUsingGETOK handles this case with default header values. +/* DownloadHistoryUsingGETOK describes a response with status code 200, with default header values. Download history */ @@ -51,7 +50,6 @@ type DownloadHistoryUsingGETOK struct { func (o *DownloadHistoryUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/download-history][%d] downloadHistoryUsingGETOK %+v", 200, o.Payload) } - func (o *DownloadHistoryUsingGETOK) GetPayload() *models.MarketplaceDownloadHistory { return o.Payload } diff --git a/pkg/client/marketplace_downloads/download_request_using_post_parameters.go b/pkg/client/marketplace_downloads/download_request_using_post_parameters.go index fd095c2f..9556b93b 100644 --- a/pkg/client/marketplace_downloads/download_request_using_post_parameters.go +++ b/pkg/client/marketplace_downloads/download_request_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewDownloadRequestUsingPOSTParams creates a new DownloadRequestUsingPOSTParams object -// with the default values initialized. +// NewDownloadRequestUsingPOSTParams creates a new DownloadRequestUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDownloadRequestUsingPOSTParams() *DownloadRequestUsingPOSTParams { - var () return &DownloadRequestUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewDownloadRequestUsingPOSTParamsWithTimeout creates a new DownloadRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDownloadRequestUsingPOSTParamsWithTimeout(timeout time.Duration) *DownloadRequestUsingPOSTParams { - var () return &DownloadRequestUsingPOSTParams{ - timeout: timeout, } } // NewDownloadRequestUsingPOSTParamsWithContext creates a new DownloadRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDownloadRequestUsingPOSTParamsWithContext(ctx context.Context) *DownloadRequestUsingPOSTParams { - var () return &DownloadRequestUsingPOSTParams{ - Context: ctx, } } // NewDownloadRequestUsingPOSTParamsWithHTTPClient creates a new DownloadRequestUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDownloadRequestUsingPOSTParamsWithHTTPClient(client *http.Client) *DownloadRequestUsingPOSTParams { - var () return &DownloadRequestUsingPOSTParams{ HTTPClient: client, } } -/*DownloadRequestUsingPOSTParams contains all the parameters to send to the API endpoint -for the download request using p o s t operation typically these are written to a http.Request +/* DownloadRequestUsingPOSTParams contains all the parameters to send to the API endpoint + for the download request using p o s t operation. + + Typically these are written to a http.Request. */ type DownloadRequestUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*DownloadRequest - downloadRequest + /* DownloadRequest. + + downloadRequest */ DownloadRequest *models.MarketplaceContentDownloadRequest @@ -78,6 +78,21 @@ type DownloadRequestUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the download request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadRequestUsingPOSTParams) WithDefaults() *DownloadRequestUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download request using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadRequestUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the download request using p o s t params func (o *DownloadRequestUsingPOSTParams) WithTimeout(timeout time.Duration) *DownloadRequestUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *DownloadRequestUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.DownloadRequest != nil { if err := r.SetBodyParam(o.DownloadRequest); err != nil { return err diff --git a/pkg/client/marketplace_downloads/download_request_using_post_responses.go b/pkg/client/marketplace_downloads/download_request_using_post_responses.go index 20c9898f..c7a25858 100644 --- a/pkg/client/marketplace_downloads/download_request_using_post_responses.go +++ b/pkg/client/marketplace_downloads/download_request_using_post_responses.go @@ -41,7 +41,6 @@ func (o *DownloadRequestUsingPOSTReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewDownloadRequestUsingPOSTAccepted() *DownloadRequestUsingPOSTAccepted { return &DownloadRequestUsingPOSTAccepted{} } -/*DownloadRequestUsingPOSTAccepted handles this case with default header values. +/* DownloadRequestUsingPOSTAccepted describes a response with status code 202, with default header values. Submitted download request */ @@ -63,7 +62,6 @@ type DownloadRequestUsingPOSTAccepted struct { func (o *DownloadRequestUsingPOSTAccepted) Error() string { return fmt.Sprintf("[POST /content/api/marketplace/download-requests][%d] downloadRequestUsingPOSTAccepted %+v", 202, o.Payload) } - func (o *DownloadRequestUsingPOSTAccepted) GetPayload() *models.MarketplaceContentDownloadRequest { return o.Payload } @@ -85,7 +83,7 @@ func NewDownloadRequestUsingPOSTBadRequest() *DownloadRequestUsingPOSTBadRequest return &DownloadRequestUsingPOSTBadRequest{} } -/*DownloadRequestUsingPOSTBadRequest handles this case with default header values. +/* DownloadRequestUsingPOSTBadRequest describes a response with status code 400, with default header values. Invalid source type */ @@ -96,7 +94,6 @@ type DownloadRequestUsingPOSTBadRequest struct { func (o *DownloadRequestUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /content/api/marketplace/download-requests][%d] downloadRequestUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *DownloadRequestUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,7 +115,7 @@ func NewDownloadRequestUsingPOSTNotFound() *DownloadRequestUsingPOSTNotFound { return &DownloadRequestUsingPOSTNotFound{} } -/*DownloadRequestUsingPOSTNotFound handles this case with default header values. +/* DownloadRequestUsingPOSTNotFound describes a response with status code 404, with default header values. source not found */ @@ -129,7 +126,6 @@ type DownloadRequestUsingPOSTNotFound struct { func (o *DownloadRequestUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /content/api/marketplace/download-requests][%d] downloadRequestUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *DownloadRequestUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace_downloads/get_request_by_id_using_get_parameters.go b/pkg/client/marketplace_downloads/get_request_by_id_using_get_parameters.go index c736a8ca..6f070ca4 100644 --- a/pkg/client/marketplace_downloads/get_request_by_id_using_get_parameters.go +++ b/pkg/client/marketplace_downloads/get_request_by_id_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetRequestByIDUsingGETParams creates a new GetRequestByIDUsingGETParams object -// with the default values initialized. +// NewGetRequestByIDUsingGETParams creates a new GetRequestByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRequestByIDUsingGETParams() *GetRequestByIDUsingGETParams { - var () return &GetRequestByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetRequestByIDUsingGETParamsWithTimeout creates a new GetRequestByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRequestByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetRequestByIDUsingGETParams { - var () return &GetRequestByIDUsingGETParams{ - timeout: timeout, } } // NewGetRequestByIDUsingGETParamsWithContext creates a new GetRequestByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRequestByIDUsingGETParamsWithContext(ctx context.Context) *GetRequestByIDUsingGETParams { - var () return &GetRequestByIDUsingGETParams{ - Context: ctx, } } // NewGetRequestByIDUsingGETParamsWithHTTPClient creates a new GetRequestByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRequestByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetRequestByIDUsingGETParams { - var () return &GetRequestByIDUsingGETParams{ HTTPClient: client, } } -/*GetRequestByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get request by Id using g e t operation typically these are written to a http.Request +/* GetRequestByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get request by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetRequestByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ID - ID of the download request + /* ID. + + ID of the download request + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetRequestByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get request by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestByIDUsingGETParams) WithDefaults() *GetRequestByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get request by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get request by Id using get params func (o *GetRequestByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetRequestByIDUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetRequestByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/marketplace_downloads/get_request_by_id_using_get_responses.go b/pkg/client/marketplace_downloads/get_request_by_id_using_get_responses.go index ba2e7916..e7dea346 100644 --- a/pkg/client/marketplace_downloads/get_request_by_id_using_get_responses.go +++ b/pkg/client/marketplace_downloads/get_request_by_id_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetRequestByIDUsingGETReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetRequestByIDUsingGETOK() *GetRequestByIDUsingGETOK { return &GetRequestByIDUsingGETOK{} } -/*GetRequestByIDUsingGETOK handles this case with default header values. +/* GetRequestByIDUsingGETOK describes a response with status code 200, with default header values. Download request for id */ @@ -57,7 +56,6 @@ type GetRequestByIDUsingGETOK struct { func (o *GetRequestByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/download-requests/{id}][%d] getRequestByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetRequestByIDUsingGETOK) GetPayload() *models.MarketplaceContentDownloadRequest { return o.Payload } @@ -79,7 +77,7 @@ func NewGetRequestByIDUsingGETNotFound() *GetRequestByIDUsingGETNotFound { return &GetRequestByIDUsingGETNotFound{} } -/*GetRequestByIDUsingGETNotFound handles this case with default header values. +/* GetRequestByIDUsingGETNotFound describes a response with status code 404, with default header values. request not found */ @@ -90,7 +88,6 @@ type GetRequestByIDUsingGETNotFound struct { func (o *GetRequestByIDUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /content/api/marketplace/download-requests/{id}][%d] getRequestByIdUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetRequestByIDUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/marketplace_downloads/marketplace_downloads_client.go b/pkg/client/marketplace_downloads/marketplace_downloads_client.go index b85565e1..99fc7ed8 100644 --- a/pkg/client/marketplace_downloads/marketplace_downloads_client.go +++ b/pkg/client/marketplace_downloads/marketplace_downloads_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams) (*DownloadHistoryUsingGETOK, error) + DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams, opts ...ClientOption) (*DownloadHistoryUsingGETOK, error) - DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams) (*DownloadRequestUsingPOSTAccepted, error) + DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams, opts ...ClientOption) (*DownloadRequestUsingPOSTAccepted, error) - GetRequestByIDUsingGET(params *GetRequestByIDUsingGETParams) (*GetRequestByIDUsingGETOK, error) + GetRequestByIDUsingGET(params *GetRequestByIDUsingGETParams, opts ...ClientOption) (*GetRequestByIDUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Get download history for the content downloaded from Marketplace */ -func (a *Client) DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams) (*DownloadHistoryUsingGETOK, error) { +func (a *Client) DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams, opts ...ClientOption) (*DownloadHistoryUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDownloadHistoryUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "downloadHistoryUsingGET", Method: "GET", PathPattern: "/content/api/marketplace/download-history", @@ -58,7 +60,12 @@ func (a *Client) DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams) Reader: &DownloadHistoryUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) DownloadHistoryUsingGET(params *DownloadHistoryUsingGETParams) Submit a download request for a content */ -func (a *Client) DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams) (*DownloadRequestUsingPOSTAccepted, error) { +func (a *Client) DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams, opts ...ClientOption) (*DownloadRequestUsingPOSTAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDownloadRequestUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "downloadRequestUsingPOST", Method: "POST", PathPattern: "/content/api/marketplace/download-requests", @@ -94,7 +100,12 @@ func (a *Client) DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams Reader: &DownloadRequestUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) DownloadRequestUsingPOST(params *DownloadRequestUsingPOSTParams Get a download request by Id */ -func (a *Client) GetRequestByIDUsingGET(params *GetRequestByIDUsingGETParams) (*GetRequestByIDUsingGETOK, error) { +func (a *Client) GetRequestByIDUsingGET(params *GetRequestByIDUsingGETParams, opts ...ClientOption) (*GetRequestByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRequestByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRequestByIdUsingGET", Method: "GET", PathPattern: "/content/api/marketplace/download-requests/{id}", @@ -130,7 +140,12 @@ func (a *Client) GetRequestByIDUsingGET(params *GetRequestByIDUsingGETParams) (* Reader: &GetRequestByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/network/create_network_parameters.go b/pkg/client/network/create_network_parameters.go index 5f97d384..09dba782 100644 --- a/pkg/client/network/create_network_parameters.go +++ b/pkg/client/network/create_network_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateNetworkParams creates a new CreateNetworkParams object -// with the default values initialized. +// NewCreateNetworkParams creates a new CreateNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateNetworkParams() *CreateNetworkParams { - var () return &CreateNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewCreateNetworkParamsWithTimeout creates a new CreateNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateNetworkParamsWithTimeout(timeout time.Duration) *CreateNetworkParams { - var () return &CreateNetworkParams{ - timeout: timeout, } } // NewCreateNetworkParamsWithContext creates a new CreateNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateNetworkParamsWithContext(ctx context.Context) *CreateNetworkParams { - var () return &CreateNetworkParams{ - Context: ctx, } } // NewCreateNetworkParamsWithHTTPClient creates a new CreateNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateNetworkParamsWithHTTPClient(client *http.Client) *CreateNetworkParams { - var () return &CreateNetworkParams{ HTTPClient: client, } } -/*CreateNetworkParams contains all the parameters to send to the API endpoint -for the create network operation typically these are written to a http.Request +/* CreateNetworkParams contains all the parameters to send to the API endpoint + for the create network operation. + + Typically these are written to a http.Request. */ type CreateNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Network Specification instance + /* Body. + + Network Specification instance */ Body *models.NetworkSpecification @@ -78,6 +78,21 @@ type CreateNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNetworkParams) WithDefaults() *CreateNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create network params func (o *CreateNetworkParams) WithTimeout(timeout time.Duration) *CreateNetworkParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateNetworkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network/create_network_responses.go b/pkg/client/network/create_network_responses.go index 3032210b..89bb753e 100644 --- a/pkg/client/network/create_network_responses.go +++ b/pkg/client/network/create_network_responses.go @@ -41,7 +41,6 @@ func (o *CreateNetworkReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateNetworkAccepted() *CreateNetworkAccepted { return &CreateNetworkAccepted{} } -/*CreateNetworkAccepted handles this case with default header values. +/* CreateNetworkAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateNetworkAccepted struct { func (o *CreateNetworkAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/networks][%d] createNetworkAccepted %+v", 202, o.Payload) } - func (o *CreateNetworkAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateNetworkBadRequest() *CreateNetworkBadRequest { return &CreateNetworkBadRequest{} } -/*CreateNetworkBadRequest handles this case with default header values. +/* CreateNetworkBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateNetworkBadRequest struct { func (o *CreateNetworkBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/networks][%d] createNetworkBadRequest %+v", 400, o.Payload) } - func (o *CreateNetworkBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateNetworkForbidden() *CreateNetworkForbidden { return &CreateNetworkForbidden{} } -/*CreateNetworkForbidden handles this case with default header values. +/* CreateNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateNetworkForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/networks][%d] createNetworkForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/networks][%d] createNetworkForbidden %+v", 403, o.Payload) +} +func (o *CreateNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network/delete_network_parameters.go b/pkg/client/network/delete_network_parameters.go index d596dc7f..e6bd825a 100644 --- a/pkg/client/network/delete_network_parameters.go +++ b/pkg/client/network/delete_network_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteNetworkParams creates a new DeleteNetworkParams object -// with the default values initialized. +// NewDeleteNetworkParams creates a new DeleteNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteNetworkParams() *DeleteNetworkParams { - var () return &DeleteNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteNetworkParamsWithTimeout creates a new DeleteNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteNetworkParamsWithTimeout(timeout time.Duration) *DeleteNetworkParams { - var () return &DeleteNetworkParams{ - timeout: timeout, } } // NewDeleteNetworkParamsWithContext creates a new DeleteNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteNetworkParamsWithContext(ctx context.Context) *DeleteNetworkParams { - var () return &DeleteNetworkParams{ - Context: ctx, } } // NewDeleteNetworkParamsWithHTTPClient creates a new DeleteNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteNetworkParamsWithHTTPClient(client *http.Client) *DeleteNetworkParams { - var () return &DeleteNetworkParams{ HTTPClient: client, } } -/*DeleteNetworkParams contains all the parameters to send to the API endpoint -for the delete network operation typically these are written to a http.Request +/* DeleteNetworkParams contains all the parameters to send to the API endpoint + for the delete network operation. + + Typically these are written to a http.Request. */ type DeleteNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this network. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this network. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the network. + /* ID. + + The ID of the network. */ ID string @@ -82,6 +83,21 @@ type DeleteNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNetworkParams) WithDefaults() *DeleteNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete network params func (o *DeleteNetworkParams) WithTimeout(timeout time.Duration) *DeleteNetworkParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteNetworkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/network/delete_network_responses.go b/pkg/client/network/delete_network_responses.go index 655d704f..20503105 100644 --- a/pkg/client/network/delete_network_responses.go +++ b/pkg/client/network/delete_network_responses.go @@ -35,7 +35,6 @@ func (o *DeleteNetworkReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewDeleteNetworkAccepted() *DeleteNetworkAccepted { return &DeleteNetworkAccepted{} } -/*DeleteNetworkAccepted handles this case with default header values. +/* DeleteNetworkAccepted describes a response with status code 202, with default header values. successful operation */ @@ -57,7 +56,6 @@ type DeleteNetworkAccepted struct { func (o *DeleteNetworkAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/networks/{id}][%d] deleteNetworkAccepted %+v", 202, o.Payload) } - func (o *DeleteNetworkAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -79,18 +77,29 @@ func NewDeleteNetworkForbidden() *DeleteNetworkForbidden { return &DeleteNetworkForbidden{} } -/*DeleteNetworkForbidden handles this case with default header values. +/* DeleteNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteNetworkForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/networks/{id}][%d] deleteNetworkForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/networks/{id}][%d] deleteNetworkForbidden %+v", 403, o.Payload) +} +func (o *DeleteNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network/get_machine_network_interface_parameters.go b/pkg/client/network/get_machine_network_interface_parameters.go index c731ef1c..e70c7513 100644 --- a/pkg/client/network/get_machine_network_interface_parameters.go +++ b/pkg/client/network/get_machine_network_interface_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMachineNetworkInterfaceParams creates a new GetMachineNetworkInterfaceParams object -// with the default values initialized. +// NewGetMachineNetworkInterfaceParams creates a new GetMachineNetworkInterfaceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMachineNetworkInterfaceParams() *GetMachineNetworkInterfaceParams { - var () return &GetMachineNetworkInterfaceParams{ - timeout: cr.DefaultTimeout, } } // NewGetMachineNetworkInterfaceParamsWithTimeout creates a new GetMachineNetworkInterfaceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMachineNetworkInterfaceParamsWithTimeout(timeout time.Duration) *GetMachineNetworkInterfaceParams { - var () return &GetMachineNetworkInterfaceParams{ - timeout: timeout, } } // NewGetMachineNetworkInterfaceParamsWithContext creates a new GetMachineNetworkInterfaceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMachineNetworkInterfaceParamsWithContext(ctx context.Context) *GetMachineNetworkInterfaceParams { - var () return &GetMachineNetworkInterfaceParams{ - Context: ctx, } } // NewGetMachineNetworkInterfaceParamsWithHTTPClient creates a new GetMachineNetworkInterfaceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMachineNetworkInterfaceParamsWithHTTPClient(client *http.Client) *GetMachineNetworkInterfaceParams { - var () return &GetMachineNetworkInterfaceParams{ HTTPClient: client, } } -/*GetMachineNetworkInterfaceParams contains all the parameters to send to the API endpoint -for the get machine network interface operation typically these are written to a http.Request +/* GetMachineNetworkInterfaceParams contains all the parameters to send to the API endpoint + for the get machine network interface operation. + + Typically these are written to a http.Request. */ type GetMachineNetworkInterfaceParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the machine. + /* ID. + + The ID of the machine. */ ID string - /*Id1 - The ID of the network interface. + /* Id1. + + The ID of the network interface. */ Id1 string @@ -81,6 +82,21 @@ type GetMachineNetworkInterfaceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get machine network interface params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineNetworkInterfaceParams) WithDefaults() *GetMachineNetworkInterfaceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get machine network interface params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMachineNetworkInterfaceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get machine network interface params func (o *GetMachineNetworkInterfaceParams) WithTimeout(timeout time.Duration) *GetMachineNetworkInterfaceParams { o.SetTimeout(timeout) @@ -159,16 +175,17 @@ func (o *GetMachineNetworkInterfaceParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network/get_machine_network_interface_responses.go b/pkg/client/network/get_machine_network_interface_responses.go index 2c242128..5e09e41b 100644 --- a/pkg/client/network/get_machine_network_interface_responses.go +++ b/pkg/client/network/get_machine_network_interface_responses.go @@ -41,7 +41,6 @@ func (o *GetMachineNetworkInterfaceReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMachineNetworkInterfaceOK() *GetMachineNetworkInterfaceOK { return &GetMachineNetworkInterfaceOK{} } -/*GetMachineNetworkInterfaceOK handles this case with default header values. +/* GetMachineNetworkInterfaceOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetMachineNetworkInterfaceOK struct { func (o *GetMachineNetworkInterfaceOK) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/network-interfaces/{id1}][%d] getMachineNetworkInterfaceOK %+v", 200, o.Payload) } - func (o *GetMachineNetworkInterfaceOK) GetPayload() *models.NetworkInterface { return o.Payload } @@ -85,19 +83,30 @@ func NewGetMachineNetworkInterfaceForbidden() *GetMachineNetworkInterfaceForbidd return &GetMachineNetworkInterfaceForbidden{} } -/*GetMachineNetworkInterfaceForbidden handles this case with default header values. +/* GetMachineNetworkInterfaceForbidden describes a response with status code 403, with default header values. Forbidden */ type GetMachineNetworkInterfaceForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetMachineNetworkInterfaceForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/machines/{id}/network-interfaces/{id1}][%d] getMachineNetworkInterfaceForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/machines/{id}/network-interfaces/{id1}][%d] getMachineNetworkInterfaceForbidden %+v", 403, o.Payload) +} +func (o *GetMachineNetworkInterfaceForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetMachineNetworkInterfaceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetMachineNetworkInterfaceNotFound() *GetMachineNetworkInterfaceNotFound return &GetMachineNetworkInterfaceNotFound{} } -/*GetMachineNetworkInterfaceNotFound handles this case with default header values. +/* GetMachineNetworkInterfaceNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetMachineNetworkInterfaceNotFound struct { func (o *GetMachineNetworkInterfaceNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/machines/{id}/network-interfaces/{id1}][%d] getMachineNetworkInterfaceNotFound %+v", 404, o.Payload) } - func (o *GetMachineNetworkInterfaceNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network/get_network_domain_parameters.go b/pkg/client/network/get_network_domain_parameters.go index 9f2ee0db..ef077865 100644 --- a/pkg/client/network/get_network_domain_parameters.go +++ b/pkg/client/network/get_network_domain_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworkDomainParams creates a new GetNetworkDomainParams object -// with the default values initialized. +// NewGetNetworkDomainParams creates a new GetNetworkDomainParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworkDomainParams() *GetNetworkDomainParams { - var () return &GetNetworkDomainParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworkDomainParamsWithTimeout creates a new GetNetworkDomainParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworkDomainParamsWithTimeout(timeout time.Duration) *GetNetworkDomainParams { - var () return &GetNetworkDomainParams{ - timeout: timeout, } } // NewGetNetworkDomainParamsWithContext creates a new GetNetworkDomainParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworkDomainParamsWithContext(ctx context.Context) *GetNetworkDomainParams { - var () return &GetNetworkDomainParams{ - Context: ctx, } } // NewGetNetworkDomainParamsWithHTTPClient creates a new GetNetworkDomainParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworkDomainParamsWithHTTPClient(client *http.Client) *GetNetworkDomainParams { - var () return &GetNetworkDomainParams{ HTTPClient: client, } } -/*GetNetworkDomainParams contains all the parameters to send to the API endpoint -for the get network domain operation typically these are written to a http.Request +/* GetNetworkDomainParams contains all the parameters to send to the API endpoint + for the get network domain operation. + + Typically these are written to a http.Request. */ type GetNetworkDomainParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network domain. + /* ID. + + The ID of the network domain. */ ID string @@ -76,6 +76,21 @@ type GetNetworkDomainParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get network domain params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkDomainParams) WithDefaults() *GetNetworkDomainParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get network domain params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkDomainParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get network domain params func (o *GetNetworkDomainParams) WithTimeout(timeout time.Duration) *GetNetworkDomainParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetNetworkDomainParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network/get_network_domain_responses.go b/pkg/client/network/get_network_domain_responses.go index d0f26a26..be064438 100644 --- a/pkg/client/network/get_network_domain_responses.go +++ b/pkg/client/network/get_network_domain_responses.go @@ -41,7 +41,6 @@ func (o *GetNetworkDomainReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetNetworkDomainOK() *GetNetworkDomainOK { return &GetNetworkDomainOK{} } -/*GetNetworkDomainOK handles this case with default header values. +/* GetNetworkDomainOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetNetworkDomainOK struct { func (o *GetNetworkDomainOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-domains/{id}][%d] getNetworkDomainOK %+v", 200, o.Payload) } - func (o *GetNetworkDomainOK) GetPayload() *models.NetworkDomain { return o.Payload } @@ -85,19 +83,30 @@ func NewGetNetworkDomainForbidden() *GetNetworkDomainForbidden { return &GetNetworkDomainForbidden{} } -/*GetNetworkDomainForbidden handles this case with default header values. +/* GetNetworkDomainForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworkDomainForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworkDomainForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-domains/{id}][%d] getNetworkDomainForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-domains/{id}][%d] getNetworkDomainForbidden %+v", 403, o.Payload) +} +func (o *GetNetworkDomainForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworkDomainForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetNetworkDomainNotFound() *GetNetworkDomainNotFound { return &GetNetworkDomainNotFound{} } -/*GetNetworkDomainNotFound handles this case with default header values. +/* GetNetworkDomainNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetNetworkDomainNotFound struct { func (o *GetNetworkDomainNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/network-domains/{id}][%d] getNetworkDomainNotFound %+v", 404, o.Payload) } - func (o *GetNetworkDomainNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network/get_network_domains_parameters.go b/pkg/client/network/get_network_domains_parameters.go index 2084e8ae..2c3d876f 100644 --- a/pkg/client/network/get_network_domains_parameters.go +++ b/pkg/client/network/get_network_domains_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworkDomainsParams creates a new GetNetworkDomainsParams object -// with the default values initialized. +// NewGetNetworkDomainsParams creates a new GetNetworkDomainsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworkDomainsParams() *GetNetworkDomainsParams { - var () return &GetNetworkDomainsParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworkDomainsParamsWithTimeout creates a new GetNetworkDomainsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworkDomainsParamsWithTimeout(timeout time.Duration) *GetNetworkDomainsParams { - var () return &GetNetworkDomainsParams{ - timeout: timeout, } } // NewGetNetworkDomainsParamsWithContext creates a new GetNetworkDomainsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworkDomainsParamsWithContext(ctx context.Context) *GetNetworkDomainsParams { - var () return &GetNetworkDomainsParams{ - Context: ctx, } } // NewGetNetworkDomainsParamsWithHTTPClient creates a new GetNetworkDomainsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworkDomainsParamsWithHTTPClient(client *http.Client) *GetNetworkDomainsParams { - var () return &GetNetworkDomainsParams{ HTTPClient: client, } } -/*GetNetworkDomainsParams contains all the parameters to send to the API endpoint -for the get network domains operation typically these are written to a http.Request +/* GetNetworkDomainsParams contains all the parameters to send to the API endpoint + for the get network domains operation. + + Typically these are written to a http.Request. */ type GetNetworkDomainsParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetNetworkDomainsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get network domains params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkDomainsParams) WithDefaults() *GetNetworkDomainsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get network domains params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkDomainsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get network domains params func (o *GetNetworkDomainsParams) WithTimeout(timeout time.Duration) *GetNetworkDomainsParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetNetworkDomainsParams) WriteToRequest(r runtime.ClientRequest, reg st // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network/get_network_domains_responses.go b/pkg/client/network/get_network_domains_responses.go index ef17955b..b7cd1968 100644 --- a/pkg/client/network/get_network_domains_responses.go +++ b/pkg/client/network/get_network_domains_responses.go @@ -35,7 +35,6 @@ func (o *GetNetworkDomainsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetNetworkDomainsOK() *GetNetworkDomainsOK { return &GetNetworkDomainsOK{} } -/*GetNetworkDomainsOK handles this case with default header values. +/* GetNetworkDomainsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetNetworkDomainsOK struct { func (o *GetNetworkDomainsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-domains][%d] getNetworkDomainsOK %+v", 200, o.Payload) } - func (o *GetNetworkDomainsOK) GetPayload() *models.NetworkDomainResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetNetworkDomainsForbidden() *GetNetworkDomainsForbidden { return &GetNetworkDomainsForbidden{} } -/*GetNetworkDomainsForbidden handles this case with default header values. +/* GetNetworkDomainsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworkDomainsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworkDomainsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-domains][%d] getNetworkDomainsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-domains][%d] getNetworkDomainsForbidden %+v", 403, o.Payload) +} +func (o *GetNetworkDomainsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworkDomainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network/get_network_parameters.go b/pkg/client/network/get_network_parameters.go index 5fad0088..3ed30ee1 100644 --- a/pkg/client/network/get_network_parameters.go +++ b/pkg/client/network/get_network_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworkParams creates a new GetNetworkParams object -// with the default values initialized. +// NewGetNetworkParams creates a new GetNetworkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworkParams() *GetNetworkParams { - var () return &GetNetworkParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworkParamsWithTimeout creates a new GetNetworkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworkParamsWithTimeout(timeout time.Duration) *GetNetworkParams { - var () return &GetNetworkParams{ - timeout: timeout, } } // NewGetNetworkParamsWithContext creates a new GetNetworkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworkParamsWithContext(ctx context.Context) *GetNetworkParams { - var () return &GetNetworkParams{ - Context: ctx, } } // NewGetNetworkParamsWithHTTPClient creates a new GetNetworkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworkParamsWithHTTPClient(client *http.Client) *GetNetworkParams { - var () return &GetNetworkParams{ HTTPClient: client, } } -/*GetNetworkParams contains all the parameters to send to the API endpoint -for the get network operation typically these are written to a http.Request +/* GetNetworkParams contains all the parameters to send to the API endpoint + for the get network operation. + + Typically these are written to a http.Request. */ type GetNetworkParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network. + /* ID. + + The ID of the network. */ ID string @@ -76,6 +76,21 @@ type GetNetworkParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkParams) WithDefaults() *GetNetworkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get network params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get network params func (o *GetNetworkParams) WithTimeout(timeout time.Duration) *GetNetworkParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetNetworkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network/get_network_responses.go b/pkg/client/network/get_network_responses.go index 25f251f2..ded29115 100644 --- a/pkg/client/network/get_network_responses.go +++ b/pkg/client/network/get_network_responses.go @@ -41,7 +41,6 @@ func (o *GetNetworkReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetNetworkOK() *GetNetworkOK { return &GetNetworkOK{} } -/*GetNetworkOK handles this case with default header values. +/* GetNetworkOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetNetworkOK struct { func (o *GetNetworkOK) Error() string { return fmt.Sprintf("[GET /iaas/api/networks/{id}][%d] getNetworkOK %+v", 200, o.Payload) } - func (o *GetNetworkOK) GetPayload() *models.Network { return o.Payload } @@ -85,19 +83,30 @@ func NewGetNetworkForbidden() *GetNetworkForbidden { return &GetNetworkForbidden{} } -/*GetNetworkForbidden handles this case with default header values. +/* GetNetworkForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworkForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworkForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/networks/{id}][%d] getNetworkForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/networks/{id}][%d] getNetworkForbidden %+v", 403, o.Payload) +} +func (o *GetNetworkForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetNetworkNotFound() *GetNetworkNotFound { return &GetNetworkNotFound{} } -/*GetNetworkNotFound handles this case with default header values. +/* GetNetworkNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetNetworkNotFound struct { func (o *GetNetworkNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/networks/{id}][%d] getNetworkNotFound %+v", 404, o.Payload) } - func (o *GetNetworkNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network/get_networks_parameters.go b/pkg/client/network/get_networks_parameters.go index 641d397d..b9d29201 100644 --- a/pkg/client/network/get_networks_parameters.go +++ b/pkg/client/network/get_networks_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworksParams creates a new GetNetworksParams object -// with the default values initialized. +// NewGetNetworksParams creates a new GetNetworksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworksParams() *GetNetworksParams { - var () return &GetNetworksParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworksParamsWithTimeout creates a new GetNetworksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworksParamsWithTimeout(timeout time.Duration) *GetNetworksParams { - var () return &GetNetworksParams{ - timeout: timeout, } } // NewGetNetworksParamsWithContext creates a new GetNetworksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworksParamsWithContext(ctx context.Context) *GetNetworksParams { - var () return &GetNetworksParams{ - Context: ctx, } } // NewGetNetworksParamsWithHTTPClient creates a new GetNetworksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworksParamsWithHTTPClient(client *http.Client) *GetNetworksParams { - var () return &GetNetworksParams{ HTTPClient: client, } } -/*GetNetworksParams contains all the parameters to send to the API endpoint -for the get networks operation typically these are written to a http.Request +/* GetNetworksParams contains all the parameters to send to the API endpoint + for the get networks operation. + + Typically these are written to a http.Request. */ type GetNetworksParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetNetworksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworksParams) WithDefaults() *GetNetworksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get networks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get networks params func (o *GetNetworksParams) WithTimeout(timeout time.Duration) *GetNetworksParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetNetworksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network/get_networks_responses.go b/pkg/client/network/get_networks_responses.go index fb1029b9..39fb390a 100644 --- a/pkg/client/network/get_networks_responses.go +++ b/pkg/client/network/get_networks_responses.go @@ -35,7 +35,6 @@ func (o *GetNetworksReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetNetworksOK() *GetNetworksOK { return &GetNetworksOK{} } -/*GetNetworksOK handles this case with default header values. +/* GetNetworksOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetNetworksOK struct { func (o *GetNetworksOK) Error() string { return fmt.Sprintf("[GET /iaas/api/networks][%d] getNetworksOK %+v", 200, o.Payload) } - func (o *GetNetworksOK) GetPayload() *models.NetworkResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetNetworksForbidden() *GetNetworksForbidden { return &GetNetworksForbidden{} } -/*GetNetworksForbidden handles this case with default header values. +/* GetNetworksForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworksForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworksForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/networks][%d] getNetworksForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/networks][%d] getNetworksForbidden %+v", 403, o.Payload) +} +func (o *GetNetworksForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network/network_client.go b/pkg/client/network/network_client.go index 45b25f35..c14a8249 100644 --- a/pkg/client/network/network_client.go +++ b/pkg/client/network/network_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateNetwork(params *CreateNetworkParams) (*CreateNetworkAccepted, error) + CreateNetwork(params *CreateNetworkParams, opts ...ClientOption) (*CreateNetworkAccepted, error) - DeleteNetwork(params *DeleteNetworkParams) (*DeleteNetworkAccepted, error) + DeleteNetwork(params *DeleteNetworkParams, opts ...ClientOption) (*DeleteNetworkAccepted, error) - GetMachineNetworkInterface(params *GetMachineNetworkInterfaceParams) (*GetMachineNetworkInterfaceOK, error) + GetMachineNetworkInterface(params *GetMachineNetworkInterfaceParams, opts ...ClientOption) (*GetMachineNetworkInterfaceOK, error) - GetNetwork(params *GetNetworkParams) (*GetNetworkOK, error) + GetNetwork(params *GetNetworkParams, opts ...ClientOption) (*GetNetworkOK, error) - GetNetworkDomain(params *GetNetworkDomainParams) (*GetNetworkDomainOK, error) + GetNetworkDomain(params *GetNetworkDomainParams, opts ...ClientOption) (*GetNetworkDomainOK, error) - GetNetworkDomains(params *GetNetworkDomainsParams) (*GetNetworkDomainsOK, error) + GetNetworkDomains(params *GetNetworkDomainsParams, opts ...ClientOption) (*GetNetworkDomainsOK, error) - GetNetworks(params *GetNetworksParams) (*GetNetworksOK, error) + GetNetworks(params *GetNetworksParams, opts ...ClientOption) (*GetNetworksOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Provision a new network based on the passed in constraints. The network should be destroyed after the machine is destroyed to free up resources. */ -func (a *Client) CreateNetwork(params *CreateNetworkParams) (*CreateNetworkAccepted, error) { +func (a *Client) CreateNetwork(params *CreateNetworkParams, opts ...ClientOption) (*CreateNetworkAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createNetwork", Method: "POST", PathPattern: "/iaas/api/networks", @@ -66,7 +68,12 @@ func (a *Client) CreateNetwork(params *CreateNetworkParams) (*CreateNetworkAccep Reader: &CreateNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) CreateNetwork(params *CreateNetworkParams) (*CreateNetworkAccep Delete a network with a given id */ -func (a *Client) DeleteNetwork(params *DeleteNetworkParams) (*DeleteNetworkAccepted, error) { +func (a *Client) DeleteNetwork(params *DeleteNetworkParams, opts ...ClientOption) (*DeleteNetworkAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteNetwork", Method: "DELETE", PathPattern: "/iaas/api/networks/{id}", @@ -102,7 +108,12 @@ func (a *Client) DeleteNetwork(params *DeleteNetworkParams) (*DeleteNetworkAccep Reader: &DeleteNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) DeleteNetwork(params *DeleteNetworkParams) (*DeleteNetworkAccep Get network interface with a given id for specific machine */ -func (a *Client) GetMachineNetworkInterface(params *GetMachineNetworkInterfaceParams) (*GetMachineNetworkInterfaceOK, error) { +func (a *Client) GetMachineNetworkInterface(params *GetMachineNetworkInterfaceParams, opts ...ClientOption) (*GetMachineNetworkInterfaceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMachineNetworkInterfaceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMachineNetworkInterface", Method: "GET", PathPattern: "/iaas/api/machines/{id}/network-interfaces/{id1}", @@ -138,7 +148,12 @@ func (a *Client) GetMachineNetworkInterface(params *GetMachineNetworkInterfacePa Reader: &GetMachineNetworkInterfaceReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -157,13 +172,12 @@ func (a *Client) GetMachineNetworkInterface(params *GetMachineNetworkInterfacePa Get network with a given id */ -func (a *Client) GetNetwork(params *GetNetworkParams) (*GetNetworkOK, error) { +func (a *Client) GetNetwork(params *GetNetworkParams, opts ...ClientOption) (*GetNetworkOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworkParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetwork", Method: "GET", PathPattern: "/iaas/api/networks/{id}", @@ -174,7 +188,12 @@ func (a *Client) GetNetwork(params *GetNetworkParams) (*GetNetworkOK, error) { Reader: &GetNetworkReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -193,13 +212,12 @@ func (a *Client) GetNetwork(params *GetNetworkParams) (*GetNetworkOK, error) { Get network domain with a given id */ -func (a *Client) GetNetworkDomain(params *GetNetworkDomainParams) (*GetNetworkDomainOK, error) { +func (a *Client) GetNetworkDomain(params *GetNetworkDomainParams, opts ...ClientOption) (*GetNetworkDomainOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworkDomainParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetworkDomain", Method: "GET", PathPattern: "/iaas/api/network-domains/{id}", @@ -210,7 +228,12 @@ func (a *Client) GetNetworkDomain(params *GetNetworkDomainParams) (*GetNetworkDo Reader: &GetNetworkDomainReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetNetworkDomain(params *GetNetworkDomainParams) (*GetNetworkDo Get all network domains. */ -func (a *Client) GetNetworkDomains(params *GetNetworkDomainsParams) (*GetNetworkDomainsOK, error) { +func (a *Client) GetNetworkDomains(params *GetNetworkDomainsParams, opts ...ClientOption) (*GetNetworkDomainsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworkDomainsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetworkDomains", Method: "GET", PathPattern: "/iaas/api/network-domains", @@ -246,7 +268,12 @@ func (a *Client) GetNetworkDomains(params *GetNetworkDomainsParams) (*GetNetwork Reader: &GetNetworkDomainsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -265,13 +292,12 @@ func (a *Client) GetNetworkDomains(params *GetNetworkDomainsParams) (*GetNetwork Get all networks */ -func (a *Client) GetNetworks(params *GetNetworksParams) (*GetNetworksOK, error) { +func (a *Client) GetNetworks(params *GetNetworksParams, opts ...ClientOption) (*GetNetworksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetworks", Method: "GET", PathPattern: "/iaas/api/networks", @@ -282,7 +308,12 @@ func (a *Client) GetNetworks(params *GetNetworksParams) (*GetNetworksOK, error) Reader: &GetNetworksReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/network_ip_range/create_internal_network_ip_range_parameters.go b/pkg/client/network_ip_range/create_internal_network_ip_range_parameters.go index 35beeb29..90eb0f0e 100644 --- a/pkg/client/network_ip_range/create_internal_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/create_internal_network_ip_range_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateInternalNetworkIPRangeParams creates a new CreateInternalNetworkIPRangeParams object -// with the default values initialized. +// NewCreateInternalNetworkIPRangeParams creates a new CreateInternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateInternalNetworkIPRangeParams() *CreateInternalNetworkIPRangeParams { - var () return &CreateInternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewCreateInternalNetworkIPRangeParamsWithTimeout creates a new CreateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateInternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *CreateInternalNetworkIPRangeParams { - var () return &CreateInternalNetworkIPRangeParams{ - timeout: timeout, } } // NewCreateInternalNetworkIPRangeParamsWithContext creates a new CreateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateInternalNetworkIPRangeParamsWithContext(ctx context.Context) *CreateInternalNetworkIPRangeParams { - var () return &CreateInternalNetworkIPRangeParams{ - Context: ctx, } } // NewCreateInternalNetworkIPRangeParamsWithHTTPClient creates a new CreateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateInternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *CreateInternalNetworkIPRangeParams { - var () return &CreateInternalNetworkIPRangeParams{ HTTPClient: client, } } -/*CreateInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the create internal network IP range operation typically these are written to a http.Request +/* CreateInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the create internal network IP range operation. + + Typically these are written to a http.Request. */ type CreateInternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Network IP Range Specification instance + /* Body. + + Network IP Range Specification instance */ Body *models.NetworkIPRangeSpecification @@ -78,6 +78,21 @@ type CreateInternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateInternalNetworkIPRangeParams) WithDefaults() *CreateInternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateInternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create internal network IP range params func (o *CreateInternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *CreateInternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateInternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network_ip_range/create_internal_network_ip_range_responses.go b/pkg/client/network_ip_range/create_internal_network_ip_range_responses.go index 8373f363..958a16d8 100644 --- a/pkg/client/network_ip_range/create_internal_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/create_internal_network_ip_range_responses.go @@ -29,12 +29,6 @@ func (o *CreateInternalNetworkIPRangeReader) ReadResponse(response runtime.Clien return nil, err } return result, nil - case 202: - result := NewCreateInternalNetworkIPRangeAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil case 400: result := NewCreateInternalNetworkIPRangeBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -47,7 +41,6 @@ func (o *CreateInternalNetworkIPRangeReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,58 +51,24 @@ func NewCreateInternalNetworkIPRangeCreated() *CreateInternalNetworkIPRangeCreat return &CreateInternalNetworkIPRangeCreated{} } -/*CreateInternalNetworkIPRangeCreated handles this case with default header values. +/* CreateInternalNetworkIPRangeCreated describes a response with status code 201, with default header values. successful operation */ type CreateInternalNetworkIPRangeCreated struct { - Payload *models.RequestTracker + Payload *models.NetworkIPRange } func (o *CreateInternalNetworkIPRangeCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/network-ip-ranges][%d] createInternalNetworkIpRangeCreated %+v", 201, o.Payload) } - -func (o *CreateInternalNetworkIPRangeCreated) GetPayload() *models.RequestTracker { +func (o *CreateInternalNetworkIPRangeCreated) GetPayload() *models.NetworkIPRange { return o.Payload } func (o *CreateInternalNetworkIPRangeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.RequestTracker) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateInternalNetworkIPRangeAccepted creates a CreateInternalNetworkIPRangeAccepted with default headers values -func NewCreateInternalNetworkIPRangeAccepted() *CreateInternalNetworkIPRangeAccepted { - return &CreateInternalNetworkIPRangeAccepted{} -} - -/*CreateInternalNetworkIPRangeAccepted handles this case with default header values. - -successful operation -*/ -type CreateInternalNetworkIPRangeAccepted struct { - Payload *models.RequestTracker -} - -func (o *CreateInternalNetworkIPRangeAccepted) Error() string { - return fmt.Sprintf("[POST /iaas/api/network-ip-ranges][%d] createInternalNetworkIpRangeAccepted %+v", 202, o.Payload) -} - -func (o *CreateInternalNetworkIPRangeAccepted) GetPayload() *models.RequestTracker { - return o.Payload -} - -func (o *CreateInternalNetworkIPRangeAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RequestTracker) + o.Payload = new(models.NetworkIPRange) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -124,7 +83,7 @@ func NewCreateInternalNetworkIPRangeBadRequest() *CreateInternalNetworkIPRangeBa return &CreateInternalNetworkIPRangeBadRequest{} } -/*CreateInternalNetworkIPRangeBadRequest handles this case with default header values. +/* CreateInternalNetworkIPRangeBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -135,7 +94,6 @@ type CreateInternalNetworkIPRangeBadRequest struct { func (o *CreateInternalNetworkIPRangeBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/network-ip-ranges][%d] createInternalNetworkIpRangeBadRequest %+v", 400, o.Payload) } - func (o *CreateInternalNetworkIPRangeBadRequest) GetPayload() *models.Error { return o.Payload } @@ -157,18 +115,29 @@ func NewCreateInternalNetworkIPRangeForbidden() *CreateInternalNetworkIPRangeFor return &CreateInternalNetworkIPRangeForbidden{} } -/*CreateInternalNetworkIPRangeForbidden handles this case with default header values. +/* CreateInternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateInternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateInternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/network-ip-ranges][%d] createInternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/network-ip-ranges][%d] createInternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *CreateInternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateInternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_ip_range/delete_internal_network_ip_range_parameters.go b/pkg/client/network_ip_range/delete_internal_network_ip_range_parameters.go index 8e068782..8bb75b05 100644 --- a/pkg/client/network_ip_range/delete_internal_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/delete_internal_network_ip_range_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteInternalNetworkIPRangeParams creates a new DeleteInternalNetworkIPRangeParams object -// with the default values initialized. +// NewDeleteInternalNetworkIPRangeParams creates a new DeleteInternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteInternalNetworkIPRangeParams() *DeleteInternalNetworkIPRangeParams { - var () return &DeleteInternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteInternalNetworkIPRangeParamsWithTimeout creates a new DeleteInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteInternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *DeleteInternalNetworkIPRangeParams { - var () return &DeleteInternalNetworkIPRangeParams{ - timeout: timeout, } } // NewDeleteInternalNetworkIPRangeParamsWithContext creates a new DeleteInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteInternalNetworkIPRangeParamsWithContext(ctx context.Context) *DeleteInternalNetworkIPRangeParams { - var () return &DeleteInternalNetworkIPRangeParams{ - Context: ctx, } } // NewDeleteInternalNetworkIPRangeParamsWithHTTPClient creates a new DeleteInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteInternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *DeleteInternalNetworkIPRangeParams { - var () return &DeleteInternalNetworkIPRangeParams{ HTTPClient: client, } } -/*DeleteInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the delete internal network IP range operation typically these are written to a http.Request +/* DeleteInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the delete internal network IP range operation. + + Typically these are written to a http.Request. */ type DeleteInternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network IP range. + /* ID. + + The ID of the network IP range. */ ID string @@ -76,6 +76,21 @@ type DeleteInternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteInternalNetworkIPRangeParams) WithDefaults() *DeleteInternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteInternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete internal network IP range params func (o *DeleteInternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *DeleteInternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteInternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_ip_range/delete_internal_network_ip_range_responses.go b/pkg/client/network_ip_range/delete_internal_network_ip_range_responses.go index 4c50fa37..6cbbd8af 100644 --- a/pkg/client/network_ip_range/delete_internal_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/delete_internal_network_ip_range_responses.go @@ -7,9 +7,12 @@ package network_ip_range import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteInternalNetworkIPRangeReader is a Reader for the DeleteInternalNetworkIPRange structure. @@ -32,7 +35,6 @@ func (o *DeleteInternalNetworkIPRangeReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteInternalNetworkIPRangeNoContent() *DeleteInternalNetworkIPRangeNoC return &DeleteInternalNetworkIPRangeNoContent{} } -/*DeleteInternalNetworkIPRangeNoContent handles this case with default header values. +/* DeleteInternalNetworkIPRangeNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteInternalNetworkIPRangeForbidden() *DeleteInternalNetworkIPRangeFor return &DeleteInternalNetworkIPRangeForbidden{} } -/*DeleteInternalNetworkIPRangeForbidden handles this case with default header values. +/* DeleteInternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteInternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteInternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/network-ip-ranges/{id}][%d] deleteInternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/network-ip-ranges/{id}][%d] deleteInternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *DeleteInternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteInternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_ip_range/get_external_ip_block_parameters.go b/pkg/client/network_ip_range/get_external_ip_block_parameters.go index 595de24a..4d1870ec 100644 --- a/pkg/client/network_ip_range/get_external_ip_block_parameters.go +++ b/pkg/client/network_ip_range/get_external_ip_block_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetExternalIPBlockParams creates a new GetExternalIPBlockParams object -// with the default values initialized. +// NewGetExternalIPBlockParams creates a new GetExternalIPBlockParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetExternalIPBlockParams() *GetExternalIPBlockParams { - var () return &GetExternalIPBlockParams{ - timeout: cr.DefaultTimeout, } } // NewGetExternalIPBlockParamsWithTimeout creates a new GetExternalIPBlockParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetExternalIPBlockParamsWithTimeout(timeout time.Duration) *GetExternalIPBlockParams { - var () return &GetExternalIPBlockParams{ - timeout: timeout, } } // NewGetExternalIPBlockParamsWithContext creates a new GetExternalIPBlockParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetExternalIPBlockParamsWithContext(ctx context.Context) *GetExternalIPBlockParams { - var () return &GetExternalIPBlockParams{ - Context: ctx, } } // NewGetExternalIPBlockParamsWithHTTPClient creates a new GetExternalIPBlockParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetExternalIPBlockParamsWithHTTPClient(client *http.Client) *GetExternalIPBlockParams { - var () return &GetExternalIPBlockParams{ HTTPClient: client, } } -/*GetExternalIPBlockParams contains all the parameters to send to the API endpoint -for the get external Ip block operation typically these are written to a http.Request +/* GetExternalIPBlockParams contains all the parameters to send to the API endpoint + for the get external Ip block operation. + + Typically these are written to a http.Request. */ type GetExternalIPBlockParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the external IP block + /* ID. + + The ID of the external IP block */ ID string @@ -76,6 +76,21 @@ type GetExternalIPBlockParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get external Ip block params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalIPBlockParams) WithDefaults() *GetExternalIPBlockParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external Ip block params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalIPBlockParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get external Ip block params func (o *GetExternalIPBlockParams) WithTimeout(timeout time.Duration) *GetExternalIPBlockParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetExternalIPBlockParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_ip_range/get_external_ip_block_responses.go b/pkg/client/network_ip_range/get_external_ip_block_responses.go index 27e1b4de..3001413d 100644 --- a/pkg/client/network_ip_range/get_external_ip_block_responses.go +++ b/pkg/client/network_ip_range/get_external_ip_block_responses.go @@ -41,7 +41,6 @@ func (o *GetExternalIPBlockReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetExternalIPBlockOK() *GetExternalIPBlockOK { return &GetExternalIPBlockOK{} } -/*GetExternalIPBlockOK handles this case with default header values. +/* GetExternalIPBlockOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetExternalIPBlockOK struct { func (o *GetExternalIPBlockOK) Error() string { return fmt.Sprintf("[GET /iaas/api/external-ip-blocks/{id}][%d] getExternalIpBlockOK %+v", 200, o.Payload) } - func (o *GetExternalIPBlockOK) GetPayload() *models.FabricNetwork { return o.Payload } @@ -85,19 +83,30 @@ func NewGetExternalIPBlockForbidden() *GetExternalIPBlockForbidden { return &GetExternalIPBlockForbidden{} } -/*GetExternalIPBlockForbidden handles this case with default header values. +/* GetExternalIPBlockForbidden describes a response with status code 403, with default header values. Forbidden */ type GetExternalIPBlockForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetExternalIPBlockForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/external-ip-blocks/{id}][%d] getExternalIpBlockForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/external-ip-blocks/{id}][%d] getExternalIpBlockForbidden %+v", 403, o.Payload) +} +func (o *GetExternalIPBlockForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetExternalIPBlockForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetExternalIPBlockNotFound() *GetExternalIPBlockNotFound { return &GetExternalIPBlockNotFound{} } -/*GetExternalIPBlockNotFound handles this case with default header values. +/* GetExternalIPBlockNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetExternalIPBlockNotFound struct { func (o *GetExternalIPBlockNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/external-ip-blocks/{id}][%d] getExternalIpBlockNotFound %+v", 404, o.Payload) } - func (o *GetExternalIPBlockNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_ip_range/get_external_ip_blocks_parameters.go b/pkg/client/network_ip_range/get_external_ip_blocks_parameters.go index 8e9a78b8..90c258a0 100644 --- a/pkg/client/network_ip_range/get_external_ip_blocks_parameters.go +++ b/pkg/client/network_ip_range/get_external_ip_blocks_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetExternalIPBlocksParams creates a new GetExternalIPBlocksParams object -// with the default values initialized. +// NewGetExternalIPBlocksParams creates a new GetExternalIPBlocksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetExternalIPBlocksParams() *GetExternalIPBlocksParams { - var () return &GetExternalIPBlocksParams{ - timeout: cr.DefaultTimeout, } } // NewGetExternalIPBlocksParamsWithTimeout creates a new GetExternalIPBlocksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetExternalIPBlocksParamsWithTimeout(timeout time.Duration) *GetExternalIPBlocksParams { - var () return &GetExternalIPBlocksParams{ - timeout: timeout, } } // NewGetExternalIPBlocksParamsWithContext creates a new GetExternalIPBlocksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetExternalIPBlocksParamsWithContext(ctx context.Context) *GetExternalIPBlocksParams { - var () return &GetExternalIPBlocksParams{ - Context: ctx, } } // NewGetExternalIPBlocksParamsWithHTTPClient creates a new GetExternalIPBlocksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetExternalIPBlocksParamsWithHTTPClient(client *http.Client) *GetExternalIPBlocksParams { - var () return &GetExternalIPBlocksParams{ HTTPClient: client, } } -/*GetExternalIPBlocksParams contains all the parameters to send to the API endpoint -for the get external Ip blocks operation typically these are written to a http.Request +/* GetExternalIPBlocksParams contains all the parameters to send to the API endpoint + for the get external Ip blocks operation. + + Typically these are written to a http.Request. */ type GetExternalIPBlocksParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetExternalIPBlocksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get external Ip blocks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalIPBlocksParams) WithDefaults() *GetExternalIPBlocksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external Ip blocks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalIPBlocksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get external Ip blocks params func (o *GetExternalIPBlocksParams) WithTimeout(timeout time.Duration) *GetExternalIPBlocksParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetExternalIPBlocksParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network_ip_range/get_external_ip_blocks_responses.go b/pkg/client/network_ip_range/get_external_ip_blocks_responses.go index 9d6b8dac..67d56a16 100644 --- a/pkg/client/network_ip_range/get_external_ip_blocks_responses.go +++ b/pkg/client/network_ip_range/get_external_ip_blocks_responses.go @@ -35,7 +35,6 @@ func (o *GetExternalIPBlocksReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetExternalIPBlocksOK() *GetExternalIPBlocksOK { return &GetExternalIPBlocksOK{} } -/*GetExternalIPBlocksOK handles this case with default header values. +/* GetExternalIPBlocksOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetExternalIPBlocksOK struct { func (o *GetExternalIPBlocksOK) Error() string { return fmt.Sprintf("[GET /iaas/api/external-ip-blocks][%d] getExternalIpBlocksOK %+v", 200, o.Payload) } - func (o *GetExternalIPBlocksOK) GetPayload() *models.FabricNetworkResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetExternalIPBlocksForbidden() *GetExternalIPBlocksForbidden { return &GetExternalIPBlocksForbidden{} } -/*GetExternalIPBlocksForbidden handles this case with default header values. +/* GetExternalIPBlocksForbidden describes a response with status code 403, with default header values. Forbidden */ type GetExternalIPBlocksForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetExternalIPBlocksForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/external-ip-blocks][%d] getExternalIpBlocksForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/external-ip-blocks][%d] getExternalIpBlocksForbidden %+v", 403, o.Payload) +} +func (o *GetExternalIPBlocksForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetExternalIPBlocksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_ip_range/get_external_network_ip_range_parameters.go b/pkg/client/network_ip_range/get_external_network_ip_range_parameters.go index 9efb061c..474dbc5b 100644 --- a/pkg/client/network_ip_range/get_external_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/get_external_network_ip_range_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetExternalNetworkIPRangeParams creates a new GetExternalNetworkIPRangeParams object -// with the default values initialized. +// NewGetExternalNetworkIPRangeParams creates a new GetExternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetExternalNetworkIPRangeParams() *GetExternalNetworkIPRangeParams { - var () return &GetExternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewGetExternalNetworkIPRangeParamsWithTimeout creates a new GetExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetExternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *GetExternalNetworkIPRangeParams { - var () return &GetExternalNetworkIPRangeParams{ - timeout: timeout, } } // NewGetExternalNetworkIPRangeParamsWithContext creates a new GetExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetExternalNetworkIPRangeParamsWithContext(ctx context.Context) *GetExternalNetworkIPRangeParams { - var () return &GetExternalNetworkIPRangeParams{ - Context: ctx, } } // NewGetExternalNetworkIPRangeParamsWithHTTPClient creates a new GetExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetExternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *GetExternalNetworkIPRangeParams { - var () return &GetExternalNetworkIPRangeParams{ HTTPClient: client, } } -/*GetExternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the get external network IP range operation typically these are written to a http.Request +/* GetExternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the get external network IP range operation. + + Typically these are written to a http.Request. */ type GetExternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the external IPAM network IP range. + /* ID. + + The ID of the external IPAM network IP range. */ ID string @@ -76,6 +76,21 @@ type GetExternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get external network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalNetworkIPRangeParams) WithDefaults() *GetExternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get external network IP range params func (o *GetExternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *GetExternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetExternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_ip_range/get_external_network_ip_range_responses.go b/pkg/client/network_ip_range/get_external_network_ip_range_responses.go index 465316a3..017cf289 100644 --- a/pkg/client/network_ip_range/get_external_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/get_external_network_ip_range_responses.go @@ -41,7 +41,6 @@ func (o *GetExternalNetworkIPRangeReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetExternalNetworkIPRangeOK() *GetExternalNetworkIPRangeOK { return &GetExternalNetworkIPRangeOK{} } -/*GetExternalNetworkIPRangeOK handles this case with default header values. +/* GetExternalNetworkIPRangeOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetExternalNetworkIPRangeOK struct { func (o *GetExternalNetworkIPRangeOK) Error() string { return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges/{id}][%d] getExternalNetworkIpRangeOK %+v", 200, o.Payload) } - func (o *GetExternalNetworkIPRangeOK) GetPayload() *models.ExternalNetworkIPRange { return o.Payload } @@ -85,19 +83,30 @@ func NewGetExternalNetworkIPRangeForbidden() *GetExternalNetworkIPRangeForbidden return &GetExternalNetworkIPRangeForbidden{} } -/*GetExternalNetworkIPRangeForbidden handles this case with default header values. +/* GetExternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type GetExternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetExternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges/{id}][%d] getExternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges/{id}][%d] getExternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *GetExternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetExternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetExternalNetworkIPRangeNotFound() *GetExternalNetworkIPRangeNotFound { return &GetExternalNetworkIPRangeNotFound{} } -/*GetExternalNetworkIPRangeNotFound handles this case with default header values. +/* GetExternalNetworkIPRangeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetExternalNetworkIPRangeNotFound struct { func (o *GetExternalNetworkIPRangeNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges/{id}][%d] getExternalNetworkIpRangeNotFound %+v", 404, o.Payload) } - func (o *GetExternalNetworkIPRangeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_ip_range/get_external_network_ip_ranges_parameters.go b/pkg/client/network_ip_range/get_external_network_ip_ranges_parameters.go index 67d42c02..112176d7 100644 --- a/pkg/client/network_ip_range/get_external_network_ip_ranges_parameters.go +++ b/pkg/client/network_ip_range/get_external_network_ip_ranges_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetExternalNetworkIPRangesParams creates a new GetExternalNetworkIPRangesParams object -// with the default values initialized. +// NewGetExternalNetworkIPRangesParams creates a new GetExternalNetworkIPRangesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetExternalNetworkIPRangesParams() *GetExternalNetworkIPRangesParams { - var () return &GetExternalNetworkIPRangesParams{ - timeout: cr.DefaultTimeout, } } // NewGetExternalNetworkIPRangesParamsWithTimeout creates a new GetExternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetExternalNetworkIPRangesParamsWithTimeout(timeout time.Duration) *GetExternalNetworkIPRangesParams { - var () return &GetExternalNetworkIPRangesParams{ - timeout: timeout, } } // NewGetExternalNetworkIPRangesParamsWithContext creates a new GetExternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetExternalNetworkIPRangesParamsWithContext(ctx context.Context) *GetExternalNetworkIPRangesParams { - var () return &GetExternalNetworkIPRangesParams{ - Context: ctx, } } // NewGetExternalNetworkIPRangesParamsWithHTTPClient creates a new GetExternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetExternalNetworkIPRangesParamsWithHTTPClient(client *http.Client) *GetExternalNetworkIPRangesParams { - var () return &GetExternalNetworkIPRangesParams{ HTTPClient: client, } } -/*GetExternalNetworkIPRangesParams contains all the parameters to send to the API endpoint -for the get external network IP ranges operation typically these are written to a http.Request +/* GetExternalNetworkIPRangesParams contains all the parameters to send to the API endpoint + for the get external network IP ranges operation. + + Typically these are written to a http.Request. */ type GetExternalNetworkIPRangesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetExternalNetworkIPRangesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get external network IP ranges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalNetworkIPRangesParams) WithDefaults() *GetExternalNetworkIPRangesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external network IP ranges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalNetworkIPRangesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get external network IP ranges params func (o *GetExternalNetworkIPRangesParams) WithTimeout(timeout time.Duration) *GetExternalNetworkIPRangesParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetExternalNetworkIPRangesParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network_ip_range/get_external_network_ip_ranges_responses.go b/pkg/client/network_ip_range/get_external_network_ip_ranges_responses.go index 2e99f7da..2f9d7209 100644 --- a/pkg/client/network_ip_range/get_external_network_ip_ranges_responses.go +++ b/pkg/client/network_ip_range/get_external_network_ip_ranges_responses.go @@ -35,7 +35,6 @@ func (o *GetExternalNetworkIPRangesReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetExternalNetworkIPRangesOK() *GetExternalNetworkIPRangesOK { return &GetExternalNetworkIPRangesOK{} } -/*GetExternalNetworkIPRangesOK handles this case with default header values. +/* GetExternalNetworkIPRangesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetExternalNetworkIPRangesOK struct { func (o *GetExternalNetworkIPRangesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges][%d] getExternalNetworkIpRangesOK %+v", 200, o.Payload) } - func (o *GetExternalNetworkIPRangesOK) GetPayload() *models.ExternalNetworkIPRangeResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetExternalNetworkIPRangesForbidden() *GetExternalNetworkIPRangesForbidd return &GetExternalNetworkIPRangesForbidden{} } -/*GetExternalNetworkIPRangesForbidden handles this case with default header values. +/* GetExternalNetworkIPRangesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetExternalNetworkIPRangesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetExternalNetworkIPRangesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges][%d] getExternalNetworkIpRangesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/external-network-ip-ranges][%d] getExternalNetworkIpRangesForbidden %+v", 403, o.Payload) +} +func (o *GetExternalNetworkIPRangesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetExternalNetworkIPRangesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_ip_range/get_internal_network_ip_range_parameters.go b/pkg/client/network_ip_range/get_internal_network_ip_range_parameters.go index c885332f..d0c8030a 100644 --- a/pkg/client/network_ip_range/get_internal_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/get_internal_network_ip_range_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetInternalNetworkIPRangeParams creates a new GetInternalNetworkIPRangeParams object -// with the default values initialized. +// NewGetInternalNetworkIPRangeParams creates a new GetInternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetInternalNetworkIPRangeParams() *GetInternalNetworkIPRangeParams { - var () return &GetInternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewGetInternalNetworkIPRangeParamsWithTimeout creates a new GetInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetInternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *GetInternalNetworkIPRangeParams { - var () return &GetInternalNetworkIPRangeParams{ - timeout: timeout, } } // NewGetInternalNetworkIPRangeParamsWithContext creates a new GetInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetInternalNetworkIPRangeParamsWithContext(ctx context.Context) *GetInternalNetworkIPRangeParams { - var () return &GetInternalNetworkIPRangeParams{ - Context: ctx, } } // NewGetInternalNetworkIPRangeParamsWithHTTPClient creates a new GetInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetInternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *GetInternalNetworkIPRangeParams { - var () return &GetInternalNetworkIPRangeParams{ HTTPClient: client, } } -/*GetInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the get internal network IP range operation typically these are written to a http.Request +/* GetInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the get internal network IP range operation. + + Typically these are written to a http.Request. */ type GetInternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network IP range. + /* ID. + + The ID of the network IP range. */ ID string @@ -76,6 +76,21 @@ type GetInternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInternalNetworkIPRangeParams) WithDefaults() *GetInternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get internal network IP range params func (o *GetInternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *GetInternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetInternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_ip_range/get_internal_network_ip_range_responses.go b/pkg/client/network_ip_range/get_internal_network_ip_range_responses.go index 4b03d0c1..4dfa7332 100644 --- a/pkg/client/network_ip_range/get_internal_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/get_internal_network_ip_range_responses.go @@ -41,7 +41,6 @@ func (o *GetInternalNetworkIPRangeReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetInternalNetworkIPRangeOK() *GetInternalNetworkIPRangeOK { return &GetInternalNetworkIPRangeOK{} } -/*GetInternalNetworkIPRangeOK handles this case with default header values. +/* GetInternalNetworkIPRangeOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetInternalNetworkIPRangeOK struct { func (o *GetInternalNetworkIPRangeOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-ip-ranges/{id}][%d] getInternalNetworkIpRangeOK %+v", 200, o.Payload) } - func (o *GetInternalNetworkIPRangeOK) GetPayload() *models.NetworkIPRange { return o.Payload } @@ -85,19 +83,30 @@ func NewGetInternalNetworkIPRangeForbidden() *GetInternalNetworkIPRangeForbidden return &GetInternalNetworkIPRangeForbidden{} } -/*GetInternalNetworkIPRangeForbidden handles this case with default header values. +/* GetInternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type GetInternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetInternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-ip-ranges/{id}][%d] getInternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-ip-ranges/{id}][%d] getInternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *GetInternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetInternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetInternalNetworkIPRangeNotFound() *GetInternalNetworkIPRangeNotFound { return &GetInternalNetworkIPRangeNotFound{} } -/*GetInternalNetworkIPRangeNotFound handles this case with default header values. +/* GetInternalNetworkIPRangeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetInternalNetworkIPRangeNotFound struct { func (o *GetInternalNetworkIPRangeNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/network-ip-ranges/{id}][%d] getInternalNetworkIpRangeNotFound %+v", 404, o.Payload) } - func (o *GetInternalNetworkIPRangeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_ip_range/get_internal_network_ip_ranges_parameters.go b/pkg/client/network_ip_range/get_internal_network_ip_ranges_parameters.go index 031c8d47..120312db 100644 --- a/pkg/client/network_ip_range/get_internal_network_ip_ranges_parameters.go +++ b/pkg/client/network_ip_range/get_internal_network_ip_ranges_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetInternalNetworkIPRangesParams creates a new GetInternalNetworkIPRangesParams object -// with the default values initialized. +// NewGetInternalNetworkIPRangesParams creates a new GetInternalNetworkIPRangesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetInternalNetworkIPRangesParams() *GetInternalNetworkIPRangesParams { - var () return &GetInternalNetworkIPRangesParams{ - timeout: cr.DefaultTimeout, } } // NewGetInternalNetworkIPRangesParamsWithTimeout creates a new GetInternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetInternalNetworkIPRangesParamsWithTimeout(timeout time.Duration) *GetInternalNetworkIPRangesParams { - var () return &GetInternalNetworkIPRangesParams{ - timeout: timeout, } } // NewGetInternalNetworkIPRangesParamsWithContext creates a new GetInternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetInternalNetworkIPRangesParamsWithContext(ctx context.Context) *GetInternalNetworkIPRangesParams { - var () return &GetInternalNetworkIPRangesParams{ - Context: ctx, } } // NewGetInternalNetworkIPRangesParamsWithHTTPClient creates a new GetInternalNetworkIPRangesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetInternalNetworkIPRangesParamsWithHTTPClient(client *http.Client) *GetInternalNetworkIPRangesParams { - var () return &GetInternalNetworkIPRangesParams{ HTTPClient: client, } } -/*GetInternalNetworkIPRangesParams contains all the parameters to send to the API endpoint -for the get internal network IP ranges operation typically these are written to a http.Request +/* GetInternalNetworkIPRangesParams contains all the parameters to send to the API endpoint + for the get internal network IP ranges operation. + + Typically these are written to a http.Request. */ type GetInternalNetworkIPRangesParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetInternalNetworkIPRangesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get internal network IP ranges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInternalNetworkIPRangesParams) WithDefaults() *GetInternalNetworkIPRangesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get internal network IP ranges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInternalNetworkIPRangesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get internal network IP ranges params func (o *GetInternalNetworkIPRangesParams) WithTimeout(timeout time.Duration) *GetInternalNetworkIPRangesParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetInternalNetworkIPRangesParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network_ip_range/get_internal_network_ip_ranges_responses.go b/pkg/client/network_ip_range/get_internal_network_ip_ranges_responses.go index 6992d3c4..f69b2396 100644 --- a/pkg/client/network_ip_range/get_internal_network_ip_ranges_responses.go +++ b/pkg/client/network_ip_range/get_internal_network_ip_ranges_responses.go @@ -41,7 +41,6 @@ func (o *GetInternalNetworkIPRangesReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetInternalNetworkIPRangesOK() *GetInternalNetworkIPRangesOK { return &GetInternalNetworkIPRangesOK{} } -/*GetInternalNetworkIPRangesOK handles this case with default header values. +/* GetInternalNetworkIPRangesOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetInternalNetworkIPRangesOK struct { func (o *GetInternalNetworkIPRangesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-ip-ranges][%d] getInternalNetworkIpRangesOK %+v", 200, o.Payload) } - func (o *GetInternalNetworkIPRangesOK) GetPayload() *models.NetworkIPRangeResult { return o.Payload } @@ -85,19 +83,30 @@ func NewGetInternalNetworkIPRangesForbidden() *GetInternalNetworkIPRangesForbidd return &GetInternalNetworkIPRangesForbidden{} } -/*GetInternalNetworkIPRangesForbidden handles this case with default header values. +/* GetInternalNetworkIPRangesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetInternalNetworkIPRangesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetInternalNetworkIPRangesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-ip-ranges][%d] getInternalNetworkIpRangesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-ip-ranges][%d] getInternalNetworkIpRangesForbidden %+v", 403, o.Payload) +} +func (o *GetInternalNetworkIPRangesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetInternalNetworkIPRangesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetInternalNetworkIPRangesNotFound() *GetInternalNetworkIPRangesNotFound return &GetInternalNetworkIPRangesNotFound{} } -/*GetInternalNetworkIPRangesNotFound handles this case with default header values. +/* GetInternalNetworkIPRangesNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetInternalNetworkIPRangesNotFound struct { func (o *GetInternalNetworkIPRangesNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/network-ip-ranges][%d] getInternalNetworkIpRangesNotFound %+v", 404, o.Payload) } - func (o *GetInternalNetworkIPRangesNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_ip_range/network_ip_range_client.go b/pkg/client/network_ip_range/network_ip_range_client.go index 0fe78ff3..b36f0c49 100644 --- a/pkg/client/network_ip_range/network_ip_range_client.go +++ b/pkg/client/network_ip_range/network_ip_range_client.go @@ -25,27 +25,30 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRangeParams) (*CreateInternalNetworkIPRangeCreated, *CreateInternalNetworkIPRangeAccepted, error) + CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRangeParams, opts ...ClientOption) (*CreateInternalNetworkIPRangeCreated, error) - DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRangeParams) (*DeleteInternalNetworkIPRangeNoContent, error) + DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRangeParams, opts ...ClientOption) (*DeleteInternalNetworkIPRangeNoContent, error) - GetExternalIPBlock(params *GetExternalIPBlockParams) (*GetExternalIPBlockOK, error) + GetExternalIPBlock(params *GetExternalIPBlockParams, opts ...ClientOption) (*GetExternalIPBlockOK, error) - GetExternalIPBlocks(params *GetExternalIPBlocksParams) (*GetExternalIPBlocksOK, error) + GetExternalIPBlocks(params *GetExternalIPBlocksParams, opts ...ClientOption) (*GetExternalIPBlocksOK, error) - GetExternalNetworkIPRange(params *GetExternalNetworkIPRangeParams) (*GetExternalNetworkIPRangeOK, error) + GetExternalNetworkIPRange(params *GetExternalNetworkIPRangeParams, opts ...ClientOption) (*GetExternalNetworkIPRangeOK, error) - GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesParams) (*GetExternalNetworkIPRangesOK, error) + GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesParams, opts ...ClientOption) (*GetExternalNetworkIPRangesOK, error) - GetInternalNetworkIPRange(params *GetInternalNetworkIPRangeParams) (*GetInternalNetworkIPRangeOK, error) + GetInternalNetworkIPRange(params *GetInternalNetworkIPRangeParams, opts ...ClientOption) (*GetInternalNetworkIPRangeOK, error) - GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesParams) (*GetInternalNetworkIPRangesOK, error) + GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesParams, opts ...ClientOption) (*GetInternalNetworkIPRangesOK, error) - UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRangeParams) (*UpdateExternalNetworkIPRangeOK, error) + UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRangeParams, opts ...ClientOption) (*UpdateExternalNetworkIPRangeOK, error) - UpdateInternalNetworkIPRange(params *UpdateInternalNetworkIPRangeParams) (*UpdateInternalNetworkIPRangeOK, error) + UpdateInternalNetworkIPRange(params *UpdateInternalNetworkIPRangeParams, opts ...ClientOption) (*UpdateInternalNetworkIPRangeOK, error) SetTransport(transport runtime.ClientTransport) } @@ -55,13 +58,12 @@ type ClientService interface { Creates an internal network IP range. */ -func (a *Client) CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRangeParams) (*CreateInternalNetworkIPRangeCreated, *CreateInternalNetworkIPRangeAccepted, error) { +func (a *Client) CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRangeParams, opts ...ClientOption) (*CreateInternalNetworkIPRangeCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateInternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createInternalNetworkIPRange", Method: "POST", PathPattern: "/iaas/api/network-ip-ranges", @@ -72,18 +74,22 @@ func (a *Client) CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRan Reader: &CreateInternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { - return nil, nil, err + return nil, err } - switch value := result.(type) { - case *CreateInternalNetworkIPRangeCreated: - return value, nil, nil - case *CreateInternalNetworkIPRangeAccepted: - return nil, value, nil + success, ok := result.(*CreateInternalNetworkIPRangeCreated) + if ok { + return success, nil } + // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for network_ip_range: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for createInternalNetworkIPRange: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -92,13 +98,12 @@ func (a *Client) CreateInternalNetworkIPRange(params *CreateInternalNetworkIPRan Delete internal network IP range with a given id */ -func (a *Client) DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRangeParams) (*DeleteInternalNetworkIPRangeNoContent, error) { +func (a *Client) DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRangeParams, opts ...ClientOption) (*DeleteInternalNetworkIPRangeNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteInternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteInternalNetworkIPRange", Method: "DELETE", PathPattern: "/iaas/api/network-ip-ranges/{id}", @@ -109,7 +114,12 @@ func (a *Client) DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRan Reader: &DeleteInternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -128,13 +138,12 @@ func (a *Client) DeleteInternalNetworkIPRange(params *DeleteInternalNetworkIPRan An external IP block is network coming from external IPAM provider that can be used to create subnetworks inside it */ -func (a *Client) GetExternalIPBlock(params *GetExternalIPBlockParams) (*GetExternalIPBlockOK, error) { +func (a *Client) GetExternalIPBlock(params *GetExternalIPBlockParams, opts ...ClientOption) (*GetExternalIPBlockOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetExternalIPBlockParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getExternalIpBlock", Method: "GET", PathPattern: "/iaas/api/external-ip-blocks/{id}", @@ -145,7 +154,12 @@ func (a *Client) GetExternalIPBlock(params *GetExternalIPBlockParams) (*GetExter Reader: &GetExternalIPBlockReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -164,13 +178,12 @@ func (a *Client) GetExternalIPBlock(params *GetExternalIPBlockParams) (*GetExter An external IP block is network coming from external IPAM provider that can be used to create subnetworks inside it */ -func (a *Client) GetExternalIPBlocks(params *GetExternalIPBlocksParams) (*GetExternalIPBlocksOK, error) { +func (a *Client) GetExternalIPBlocks(params *GetExternalIPBlocksParams, opts ...ClientOption) (*GetExternalIPBlocksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetExternalIPBlocksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getExternalIpBlocks", Method: "GET", PathPattern: "/iaas/api/external-ip-blocks", @@ -181,7 +194,12 @@ func (a *Client) GetExternalIPBlocks(params *GetExternalIPBlocksParams) (*GetExt Reader: &GetExternalIPBlocksReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -200,13 +218,12 @@ func (a *Client) GetExternalIPBlocks(params *GetExternalIPBlocksParams) (*GetExt Get external IPAM network IP range with a given id */ -func (a *Client) GetExternalNetworkIPRange(params *GetExternalNetworkIPRangeParams) (*GetExternalNetworkIPRangeOK, error) { +func (a *Client) GetExternalNetworkIPRange(params *GetExternalNetworkIPRangeParams, opts ...ClientOption) (*GetExternalNetworkIPRangeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetExternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getExternalNetworkIPRange", Method: "GET", PathPattern: "/iaas/api/external-network-ip-ranges/{id}", @@ -217,7 +234,12 @@ func (a *Client) GetExternalNetworkIPRange(params *GetExternalNetworkIPRangePara Reader: &GetExternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -236,13 +258,12 @@ func (a *Client) GetExternalNetworkIPRange(params *GetExternalNetworkIPRangePara Get all external IPAM network IP ranges */ -func (a *Client) GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesParams) (*GetExternalNetworkIPRangesOK, error) { +func (a *Client) GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesParams, opts ...ClientOption) (*GetExternalNetworkIPRangesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetExternalNetworkIPRangesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getExternalNetworkIPRanges", Method: "GET", PathPattern: "/iaas/api/external-network-ip-ranges", @@ -253,7 +274,12 @@ func (a *Client) GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesPa Reader: &GetExternalNetworkIPRangesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -272,13 +298,12 @@ func (a *Client) GetExternalNetworkIPRanges(params *GetExternalNetworkIPRangesPa Get internal IPAM network IP range with a given id */ -func (a *Client) GetInternalNetworkIPRange(params *GetInternalNetworkIPRangeParams) (*GetInternalNetworkIPRangeOK, error) { +func (a *Client) GetInternalNetworkIPRange(params *GetInternalNetworkIPRangeParams, opts ...ClientOption) (*GetInternalNetworkIPRangeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetInternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getInternalNetworkIPRange", Method: "GET", PathPattern: "/iaas/api/network-ip-ranges/{id}", @@ -289,7 +314,12 @@ func (a *Client) GetInternalNetworkIPRange(params *GetInternalNetworkIPRangePara Reader: &GetInternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -308,13 +338,12 @@ func (a *Client) GetInternalNetworkIPRange(params *GetInternalNetworkIPRangePara Get all internal IPAM network IP ranges */ -func (a *Client) GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesParams) (*GetInternalNetworkIPRangesOK, error) { +func (a *Client) GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesParams, opts ...ClientOption) (*GetInternalNetworkIPRangesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetInternalNetworkIPRangesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getInternalNetworkIPRanges", Method: "GET", PathPattern: "/iaas/api/network-ip-ranges", @@ -325,7 +354,12 @@ func (a *Client) GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesPa Reader: &GetInternalNetworkIPRangesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -344,13 +378,12 @@ func (a *Client) GetInternalNetworkIPRanges(params *GetInternalNetworkIPRangesPa Assign the external IPAM network IP range to a different network and/or change the tags of the external IPAM network IP range. */ -func (a *Client) UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRangeParams) (*UpdateExternalNetworkIPRangeOK, error) { +func (a *Client) UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRangeParams, opts ...ClientOption) (*UpdateExternalNetworkIPRangeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateExternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateExternalNetworkIPRange", Method: "PATCH", PathPattern: "/iaas/api/external-network-ip-ranges/{id}", @@ -361,7 +394,12 @@ func (a *Client) UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRan Reader: &UpdateExternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -380,13 +418,12 @@ func (a *Client) UpdateExternalNetworkIPRange(params *UpdateExternalNetworkIPRan Update internal network IP range. */ -func (a *Client) UpdateInternalNetworkIPRange(params *UpdateInternalNetworkIPRangeParams) (*UpdateInternalNetworkIPRangeOK, error) { +func (a *Client) UpdateInternalNetworkIPRange(params *UpdateInternalNetworkIPRangeParams, opts ...ClientOption) (*UpdateInternalNetworkIPRangeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateInternalNetworkIPRangeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateInternalNetworkIPRange", Method: "PATCH", PathPattern: "/iaas/api/network-ip-ranges/{id}", @@ -397,7 +434,12 @@ func (a *Client) UpdateInternalNetworkIPRange(params *UpdateInternalNetworkIPRan Reader: &UpdateInternalNetworkIPRangeReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/network_ip_range/update_external_network_ip_range_parameters.go b/pkg/client/network_ip_range/update_external_network_ip_range_parameters.go index c8a6b9da..e5ed2870 100644 --- a/pkg/client/network_ip_range/update_external_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/update_external_network_ip_range_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateExternalNetworkIPRangeParams creates a new UpdateExternalNetworkIPRangeParams object -// with the default values initialized. +// NewUpdateExternalNetworkIPRangeParams creates a new UpdateExternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateExternalNetworkIPRangeParams() *UpdateExternalNetworkIPRangeParams { - var () return &UpdateExternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateExternalNetworkIPRangeParamsWithTimeout creates a new UpdateExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateExternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *UpdateExternalNetworkIPRangeParams { - var () return &UpdateExternalNetworkIPRangeParams{ - timeout: timeout, } } // NewUpdateExternalNetworkIPRangeParamsWithContext creates a new UpdateExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateExternalNetworkIPRangeParamsWithContext(ctx context.Context) *UpdateExternalNetworkIPRangeParams { - var () return &UpdateExternalNetworkIPRangeParams{ - Context: ctx, } } // NewUpdateExternalNetworkIPRangeParamsWithHTTPClient creates a new UpdateExternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateExternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *UpdateExternalNetworkIPRangeParams { - var () return &UpdateExternalNetworkIPRangeParams{ HTTPClient: client, } } -/*UpdateExternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the update external network IP range operation typically these are written to a http.Request +/* UpdateExternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the update external network IP range operation. + + Typically these are written to a http.Request. */ type UpdateExternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - External IPAM network IP range specification + /* Body. + + External IPAM network IP range specification */ Body *models.UpdateExternalNetworkIPRangeSpecification - /*ID - The ID of the external IPAM network IP range. + /* ID. + + The ID of the external IPAM network IP range. */ ID string @@ -83,6 +84,21 @@ type UpdateExternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update external network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateExternalNetworkIPRangeParams) WithDefaults() *UpdateExternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update external network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateExternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update external network IP range params func (o *UpdateExternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *UpdateExternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateExternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network_ip_range/update_external_network_ip_range_responses.go b/pkg/client/network_ip_range/update_external_network_ip_range_responses.go index 282fff0c..0823dcb4 100644 --- a/pkg/client/network_ip_range/update_external_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/update_external_network_ip_range_responses.go @@ -47,7 +47,6 @@ func (o *UpdateExternalNetworkIPRangeReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewUpdateExternalNetworkIPRangeOK() *UpdateExternalNetworkIPRangeOK { return &UpdateExternalNetworkIPRangeOK{} } -/*UpdateExternalNetworkIPRangeOK handles this case with default header values. +/* UpdateExternalNetworkIPRangeOK describes a response with status code 200, with default header values. successful operation */ @@ -69,7 +68,6 @@ type UpdateExternalNetworkIPRangeOK struct { func (o *UpdateExternalNetworkIPRangeOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/external-network-ip-ranges/{id}][%d] updateExternalNetworkIpRangeOK %+v", 200, o.Payload) } - func (o *UpdateExternalNetworkIPRangeOK) GetPayload() *models.ExternalNetworkIPRange { return o.Payload } @@ -91,7 +89,7 @@ func NewUpdateExternalNetworkIPRangeBadRequest() *UpdateExternalNetworkIPRangeBa return &UpdateExternalNetworkIPRangeBadRequest{} } -/*UpdateExternalNetworkIPRangeBadRequest handles this case with default header values. +/* UpdateExternalNetworkIPRangeBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -102,7 +100,6 @@ type UpdateExternalNetworkIPRangeBadRequest struct { func (o *UpdateExternalNetworkIPRangeBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/external-network-ip-ranges/{id}][%d] updateExternalNetworkIpRangeBadRequest %+v", 400, o.Payload) } - func (o *UpdateExternalNetworkIPRangeBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,19 +121,30 @@ func NewUpdateExternalNetworkIPRangeForbidden() *UpdateExternalNetworkIPRangeFor return &UpdateExternalNetworkIPRangeForbidden{} } -/*UpdateExternalNetworkIPRangeForbidden handles this case with default header values. +/* UpdateExternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateExternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateExternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/external-network-ip-ranges/{id}][%d] updateExternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/external-network-ip-ranges/{id}][%d] updateExternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *UpdateExternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateExternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -145,7 +153,7 @@ func NewUpdateExternalNetworkIPRangeNotFound() *UpdateExternalNetworkIPRangeNotF return &UpdateExternalNetworkIPRangeNotFound{} } -/*UpdateExternalNetworkIPRangeNotFound handles this case with default header values. +/* UpdateExternalNetworkIPRangeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -156,7 +164,6 @@ type UpdateExternalNetworkIPRangeNotFound struct { func (o *UpdateExternalNetworkIPRangeNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/external-network-ip-ranges/{id}][%d] updateExternalNetworkIpRangeNotFound %+v", 404, o.Payload) } - func (o *UpdateExternalNetworkIPRangeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_ip_range/update_internal_network_ip_range_parameters.go b/pkg/client/network_ip_range/update_internal_network_ip_range_parameters.go index d9f6ddbb..176b5875 100644 --- a/pkg/client/network_ip_range/update_internal_network_ip_range_parameters.go +++ b/pkg/client/network_ip_range/update_internal_network_ip_range_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateInternalNetworkIPRangeParams creates a new UpdateInternalNetworkIPRangeParams object -// with the default values initialized. +// NewUpdateInternalNetworkIPRangeParams creates a new UpdateInternalNetworkIPRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateInternalNetworkIPRangeParams() *UpdateInternalNetworkIPRangeParams { - var () return &UpdateInternalNetworkIPRangeParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateInternalNetworkIPRangeParamsWithTimeout creates a new UpdateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateInternalNetworkIPRangeParamsWithTimeout(timeout time.Duration) *UpdateInternalNetworkIPRangeParams { - var () return &UpdateInternalNetworkIPRangeParams{ - timeout: timeout, } } // NewUpdateInternalNetworkIPRangeParamsWithContext creates a new UpdateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateInternalNetworkIPRangeParamsWithContext(ctx context.Context) *UpdateInternalNetworkIPRangeParams { - var () return &UpdateInternalNetworkIPRangeParams{ - Context: ctx, } } // NewUpdateInternalNetworkIPRangeParamsWithHTTPClient creates a new UpdateInternalNetworkIPRangeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateInternalNetworkIPRangeParamsWithHTTPClient(client *http.Client) *UpdateInternalNetworkIPRangeParams { - var () return &UpdateInternalNetworkIPRangeParams{ HTTPClient: client, } } -/*UpdateInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint -for the update internal network IP range operation typically these are written to a http.Request +/* UpdateInternalNetworkIPRangeParams contains all the parameters to send to the API endpoint + for the update internal network IP range operation. + + Typically these are written to a http.Request. */ type UpdateInternalNetworkIPRangeParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Network IP range Specification + /* Body. + + Network IP range Specification */ Body *models.NetworkIPRangeSpecification - /*ID - The ID of the network IP range. + /* ID. + + The ID of the network IP range. */ ID string @@ -83,6 +84,21 @@ type UpdateInternalNetworkIPRangeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInternalNetworkIPRangeParams) WithDefaults() *UpdateInternalNetworkIPRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update internal network IP range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInternalNetworkIPRangeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update internal network IP range params func (o *UpdateInternalNetworkIPRangeParams) WithTimeout(timeout time.Duration) *UpdateInternalNetworkIPRangeParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateInternalNetworkIPRangeParams) WriteToRequest(r runtime.ClientRequ // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network_ip_range/update_internal_network_ip_range_responses.go b/pkg/client/network_ip_range/update_internal_network_ip_range_responses.go index 64f8e648..efbd8a2c 100644 --- a/pkg/client/network_ip_range/update_internal_network_ip_range_responses.go +++ b/pkg/client/network_ip_range/update_internal_network_ip_range_responses.go @@ -41,7 +41,6 @@ func (o *UpdateInternalNetworkIPRangeReader) ReadResponse(response runtime.Clien return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateInternalNetworkIPRangeOK() *UpdateInternalNetworkIPRangeOK { return &UpdateInternalNetworkIPRangeOK{} } -/*UpdateInternalNetworkIPRangeOK handles this case with default header values. +/* UpdateInternalNetworkIPRangeOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateInternalNetworkIPRangeOK struct { func (o *UpdateInternalNetworkIPRangeOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/network-ip-ranges/{id}][%d] updateInternalNetworkIpRangeOK %+v", 200, o.Payload) } - func (o *UpdateInternalNetworkIPRangeOK) GetPayload() *models.NetworkIPRange { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateInternalNetworkIPRangeForbidden() *UpdateInternalNetworkIPRangeFor return &UpdateInternalNetworkIPRangeForbidden{} } -/*UpdateInternalNetworkIPRangeForbidden handles this case with default header values. +/* UpdateInternalNetworkIPRangeForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateInternalNetworkIPRangeForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateInternalNetworkIPRangeForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/network-ip-ranges/{id}][%d] updateInternalNetworkIpRangeForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/network-ip-ranges/{id}][%d] updateInternalNetworkIpRangeForbidden %+v", 403, o.Payload) +} +func (o *UpdateInternalNetworkIPRangeForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateInternalNetworkIPRangeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateInternalNetworkIPRangeNotFound() *UpdateInternalNetworkIPRangeNotF return &UpdateInternalNetworkIPRangeNotFound{} } -/*UpdateInternalNetworkIPRangeNotFound handles this case with default header values. +/* UpdateInternalNetworkIPRangeNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateInternalNetworkIPRangeNotFound struct { func (o *UpdateInternalNetworkIPRangeNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/network-ip-ranges/{id}][%d] updateInternalNetworkIpRangeNotFound %+v", 404, o.Payload) } - func (o *UpdateInternalNetworkIPRangeNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_profile/create_network_profile_parameters.go b/pkg/client/network_profile/create_network_profile_parameters.go index 08a920aa..59cccfa4 100644 --- a/pkg/client/network_profile/create_network_profile_parameters.go +++ b/pkg/client/network_profile/create_network_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateNetworkProfileParams creates a new CreateNetworkProfileParams object -// with the default values initialized. +// NewCreateNetworkProfileParams creates a new CreateNetworkProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateNetworkProfileParams() *CreateNetworkProfileParams { - var () return &CreateNetworkProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateNetworkProfileParamsWithTimeout creates a new CreateNetworkProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateNetworkProfileParamsWithTimeout(timeout time.Duration) *CreateNetworkProfileParams { - var () return &CreateNetworkProfileParams{ - timeout: timeout, } } // NewCreateNetworkProfileParamsWithContext creates a new CreateNetworkProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateNetworkProfileParamsWithContext(ctx context.Context) *CreateNetworkProfileParams { - var () return &CreateNetworkProfileParams{ - Context: ctx, } } // NewCreateNetworkProfileParamsWithHTTPClient creates a new CreateNetworkProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateNetworkProfileParamsWithHTTPClient(client *http.Client) *CreateNetworkProfileParams { - var () return &CreateNetworkProfileParams{ HTTPClient: client, } } -/*CreateNetworkProfileParams contains all the parameters to send to the API endpoint -for the create network profile operation typically these are written to a http.Request +/* CreateNetworkProfileParams contains all the parameters to send to the API endpoint + for the create network profile operation. + + Typically these are written to a http.Request. */ type CreateNetworkProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - NetworkProfile instance + /* Body. + + NetworkProfile instance */ Body *models.NetworkProfileSpecification @@ -78,6 +78,21 @@ type CreateNetworkProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNetworkProfileParams) WithDefaults() *CreateNetworkProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNetworkProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create network profile params func (o *CreateNetworkProfileParams) WithTimeout(timeout time.Duration) *CreateNetworkProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateNetworkProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network_profile/create_network_profile_responses.go b/pkg/client/network_profile/create_network_profile_responses.go index 3809850d..c0a32575 100644 --- a/pkg/client/network_profile/create_network_profile_responses.go +++ b/pkg/client/network_profile/create_network_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateNetworkProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateNetworkProfileCreated() *CreateNetworkProfileCreated { return &CreateNetworkProfileCreated{} } -/*CreateNetworkProfileCreated handles this case with default header values. +/* CreateNetworkProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateNetworkProfileCreated struct { func (o *CreateNetworkProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/network-profiles][%d] createNetworkProfileCreated %+v", 201, o.Payload) } - func (o *CreateNetworkProfileCreated) GetPayload() *models.NetworkProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateNetworkProfileBadRequest() *CreateNetworkProfileBadRequest { return &CreateNetworkProfileBadRequest{} } -/*CreateNetworkProfileBadRequest handles this case with default header values. +/* CreateNetworkProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateNetworkProfileBadRequest struct { func (o *CreateNetworkProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/network-profiles][%d] createNetworkProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateNetworkProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateNetworkProfileForbidden() *CreateNetworkProfileForbidden { return &CreateNetworkProfileForbidden{} } -/*CreateNetworkProfileForbidden handles this case with default header values. +/* CreateNetworkProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateNetworkProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateNetworkProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/network-profiles][%d] createNetworkProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/network-profiles][%d] createNetworkProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateNetworkProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateNetworkProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_profile/delete_network_profile_parameters.go b/pkg/client/network_profile/delete_network_profile_parameters.go index 0bc07dd2..dcb31262 100644 --- a/pkg/client/network_profile/delete_network_profile_parameters.go +++ b/pkg/client/network_profile/delete_network_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteNetworkProfileParams creates a new DeleteNetworkProfileParams object -// with the default values initialized. +// NewDeleteNetworkProfileParams creates a new DeleteNetworkProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteNetworkProfileParams() *DeleteNetworkProfileParams { - var () return &DeleteNetworkProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteNetworkProfileParamsWithTimeout creates a new DeleteNetworkProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteNetworkProfileParamsWithTimeout(timeout time.Duration) *DeleteNetworkProfileParams { - var () return &DeleteNetworkProfileParams{ - timeout: timeout, } } // NewDeleteNetworkProfileParamsWithContext creates a new DeleteNetworkProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteNetworkProfileParamsWithContext(ctx context.Context) *DeleteNetworkProfileParams { - var () return &DeleteNetworkProfileParams{ - Context: ctx, } } // NewDeleteNetworkProfileParamsWithHTTPClient creates a new DeleteNetworkProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteNetworkProfileParamsWithHTTPClient(client *http.Client) *DeleteNetworkProfileParams { - var () return &DeleteNetworkProfileParams{ HTTPClient: client, } } -/*DeleteNetworkProfileParams contains all the parameters to send to the API endpoint -for the delete network profile operation typically these are written to a http.Request +/* DeleteNetworkProfileParams contains all the parameters to send to the API endpoint + for the delete network profile operation. + + Typically these are written to a http.Request. */ type DeleteNetworkProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network profile. + /* ID. + + The ID of the network profile. */ ID string @@ -76,6 +76,21 @@ type DeleteNetworkProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNetworkProfileParams) WithDefaults() *DeleteNetworkProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNetworkProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete network profile params func (o *DeleteNetworkProfileParams) WithTimeout(timeout time.Duration) *DeleteNetworkProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteNetworkProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_profile/delete_network_profile_responses.go b/pkg/client/network_profile/delete_network_profile_responses.go index 7fe48c95..fcb59259 100644 --- a/pkg/client/network_profile/delete_network_profile_responses.go +++ b/pkg/client/network_profile/delete_network_profile_responses.go @@ -7,9 +7,12 @@ package network_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteNetworkProfileReader is a Reader for the DeleteNetworkProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteNetworkProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteNetworkProfileNoContent() *DeleteNetworkProfileNoContent { return &DeleteNetworkProfileNoContent{} } -/*DeleteNetworkProfileNoContent handles this case with default header values. +/* DeleteNetworkProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteNetworkProfileForbidden() *DeleteNetworkProfileForbidden { return &DeleteNetworkProfileForbidden{} } -/*DeleteNetworkProfileForbidden handles this case with default header values. +/* DeleteNetworkProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteNetworkProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteNetworkProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/network-profiles/{id}][%d] deleteNetworkProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/network-profiles/{id}][%d] deleteNetworkProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteNetworkProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteNetworkProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_profile/get_network_profile_parameters.go b/pkg/client/network_profile/get_network_profile_parameters.go index 472a48ff..e349e8e2 100644 --- a/pkg/client/network_profile/get_network_profile_parameters.go +++ b/pkg/client/network_profile/get_network_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworkProfileParams creates a new GetNetworkProfileParams object -// with the default values initialized. +// NewGetNetworkProfileParams creates a new GetNetworkProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworkProfileParams() *GetNetworkProfileParams { - var () return &GetNetworkProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworkProfileParamsWithTimeout creates a new GetNetworkProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworkProfileParamsWithTimeout(timeout time.Duration) *GetNetworkProfileParams { - var () return &GetNetworkProfileParams{ - timeout: timeout, } } // NewGetNetworkProfileParamsWithContext creates a new GetNetworkProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworkProfileParamsWithContext(ctx context.Context) *GetNetworkProfileParams { - var () return &GetNetworkProfileParams{ - Context: ctx, } } // NewGetNetworkProfileParamsWithHTTPClient creates a new GetNetworkProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworkProfileParamsWithHTTPClient(client *http.Client) *GetNetworkProfileParams { - var () return &GetNetworkProfileParams{ HTTPClient: client, } } -/*GetNetworkProfileParams contains all the parameters to send to the API endpoint -for the get network profile operation typically these are written to a http.Request +/* GetNetworkProfileParams contains all the parameters to send to the API endpoint + for the get network profile operation. + + Typically these are written to a http.Request. */ type GetNetworkProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the network profile. + /* ID. + + The ID of the network profile. */ ID string @@ -76,6 +76,21 @@ type GetNetworkProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkProfileParams) WithDefaults() *GetNetworkProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get network profile params func (o *GetNetworkProfileParams) WithTimeout(timeout time.Duration) *GetNetworkProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetNetworkProfileParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/network_profile/get_network_profile_responses.go b/pkg/client/network_profile/get_network_profile_responses.go index 086db90c..3b9ba836 100644 --- a/pkg/client/network_profile/get_network_profile_responses.go +++ b/pkg/client/network_profile/get_network_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetNetworkProfileReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetNetworkProfileOK() *GetNetworkProfileOK { return &GetNetworkProfileOK{} } -/*GetNetworkProfileOK handles this case with default header values. +/* GetNetworkProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetNetworkProfileOK struct { func (o *GetNetworkProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-profiles/{id}][%d] getNetworkProfileOK %+v", 200, o.Payload) } - func (o *GetNetworkProfileOK) GetPayload() *models.NetworkProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetNetworkProfileForbidden() *GetNetworkProfileForbidden { return &GetNetworkProfileForbidden{} } -/*GetNetworkProfileForbidden handles this case with default header values. +/* GetNetworkProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworkProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworkProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-profiles/{id}][%d] getNetworkProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-profiles/{id}][%d] getNetworkProfileForbidden %+v", 403, o.Payload) +} +func (o *GetNetworkProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworkProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetNetworkProfileNotFound() *GetNetworkProfileNotFound { return &GetNetworkProfileNotFound{} } -/*GetNetworkProfileNotFound handles this case with default header values. +/* GetNetworkProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetNetworkProfileNotFound struct { func (o *GetNetworkProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/network-profiles/{id}][%d] getNetworkProfileNotFound %+v", 404, o.Payload) } - func (o *GetNetworkProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/network_profile/get_network_profiles_parameters.go b/pkg/client/network_profile/get_network_profiles_parameters.go index d9d449e4..f900b7db 100644 --- a/pkg/client/network_profile/get_network_profiles_parameters.go +++ b/pkg/client/network_profile/get_network_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNetworkProfilesParams creates a new GetNetworkProfilesParams object -// with the default values initialized. +// NewGetNetworkProfilesParams creates a new GetNetworkProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetNetworkProfilesParams() *GetNetworkProfilesParams { - var () return &GetNetworkProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetNetworkProfilesParamsWithTimeout creates a new GetNetworkProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNetworkProfilesParamsWithTimeout(timeout time.Duration) *GetNetworkProfilesParams { - var () return &GetNetworkProfilesParams{ - timeout: timeout, } } // NewGetNetworkProfilesParamsWithContext creates a new GetNetworkProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNetworkProfilesParamsWithContext(ctx context.Context) *GetNetworkProfilesParams { - var () return &GetNetworkProfilesParams{ - Context: ctx, } } // NewGetNetworkProfilesParamsWithHTTPClient creates a new GetNetworkProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNetworkProfilesParamsWithHTTPClient(client *http.Client) *GetNetworkProfilesParams { - var () return &GetNetworkProfilesParams{ HTTPClient: client, } } -/*GetNetworkProfilesParams contains all the parameters to send to the API endpoint -for the get network profiles operation typically these are written to a http.Request +/* GetNetworkProfilesParams contains all the parameters to send to the API endpoint + for the get network profiles operation. + + Typically these are written to a http.Request. */ type GetNetworkProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetNetworkProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get network profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkProfilesParams) WithDefaults() *GetNetworkProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get network profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNetworkProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get network profiles params func (o *GetNetworkProfilesParams) WithTimeout(timeout time.Duration) *GetNetworkProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetNetworkProfilesParams) WriteToRequest(r runtime.ClientRequest, reg s // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/network_profile/get_network_profiles_responses.go b/pkg/client/network_profile/get_network_profiles_responses.go index 73c9b1ae..01239258 100644 --- a/pkg/client/network_profile/get_network_profiles_responses.go +++ b/pkg/client/network_profile/get_network_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetNetworkProfilesReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetNetworkProfilesOK() *GetNetworkProfilesOK { return &GetNetworkProfilesOK{} } -/*GetNetworkProfilesOK handles this case with default header values. +/* GetNetworkProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetNetworkProfilesOK struct { func (o *GetNetworkProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/network-profiles][%d] getNetworkProfilesOK %+v", 200, o.Payload) } - func (o *GetNetworkProfilesOK) GetPayload() *models.NetworkProfileResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetNetworkProfilesForbidden() *GetNetworkProfilesForbidden { return &GetNetworkProfilesForbidden{} } -/*GetNetworkProfilesForbidden handles this case with default header values. +/* GetNetworkProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetNetworkProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetNetworkProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/network-profiles][%d] getNetworkProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/network-profiles][%d] getNetworkProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetNetworkProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetNetworkProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/network_profile/network_profile_client.go b/pkg/client/network_profile/network_profile_client.go index e4ef5cb5..0b1b17f9 100644 --- a/pkg/client/network_profile/network_profile_client.go +++ b/pkg/client/network_profile/network_profile_client.go @@ -25,17 +25,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateNetworkProfile(params *CreateNetworkProfileParams) (*CreateNetworkProfileCreated, error) + CreateNetworkProfile(params *CreateNetworkProfileParams, opts ...ClientOption) (*CreateNetworkProfileCreated, error) - DeleteNetworkProfile(params *DeleteNetworkProfileParams) (*DeleteNetworkProfileNoContent, error) + DeleteNetworkProfile(params *DeleteNetworkProfileParams, opts ...ClientOption) (*DeleteNetworkProfileNoContent, error) - GetNetworkProfile(params *GetNetworkProfileParams) (*GetNetworkProfileOK, error) + GetNetworkProfile(params *GetNetworkProfileParams, opts ...ClientOption) (*GetNetworkProfileOK, error) - GetNetworkProfiles(params *GetNetworkProfilesParams) (*GetNetworkProfilesOK, error) + GetNetworkProfiles(params *GetNetworkProfilesParams, opts ...ClientOption) (*GetNetworkProfilesOK, error) - UpdateNetworkProfile(params *UpdateNetworkProfileParams) (*UpdateNetworkProfileOK, error) + UpdateNetworkProfile(params *UpdateNetworkProfileParams, opts ...ClientOption) (*UpdateNetworkProfileOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { Create network profile */ -func (a *Client) CreateNetworkProfile(params *CreateNetworkProfileParams) (*CreateNetworkProfileCreated, error) { +func (a *Client) CreateNetworkProfile(params *CreateNetworkProfileParams, opts ...ClientOption) (*CreateNetworkProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateNetworkProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createNetworkProfile", Method: "POST", PathPattern: "/iaas/api/network-profiles", @@ -62,7 +64,12 @@ func (a *Client) CreateNetworkProfile(params *CreateNetworkProfileParams) (*Crea Reader: &CreateNetworkProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) CreateNetworkProfile(params *CreateNetworkProfileParams) (*Crea Delete network profile with a given id */ -func (a *Client) DeleteNetworkProfile(params *DeleteNetworkProfileParams) (*DeleteNetworkProfileNoContent, error) { +func (a *Client) DeleteNetworkProfile(params *DeleteNetworkProfileParams, opts ...ClientOption) (*DeleteNetworkProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteNetworkProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteNetworkProfile", Method: "DELETE", PathPattern: "/iaas/api/network-profiles/{id}", @@ -98,7 +104,12 @@ func (a *Client) DeleteNetworkProfile(params *DeleteNetworkProfileParams) (*Dele Reader: &DeleteNetworkProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -117,13 +128,12 @@ func (a *Client) DeleteNetworkProfile(params *DeleteNetworkProfileParams) (*Dele Get network profile with a given id */ -func (a *Client) GetNetworkProfile(params *GetNetworkProfileParams) (*GetNetworkProfileOK, error) { +func (a *Client) GetNetworkProfile(params *GetNetworkProfileParams, opts ...ClientOption) (*GetNetworkProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworkProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetworkProfile", Method: "GET", PathPattern: "/iaas/api/network-profiles/{id}", @@ -134,7 +144,12 @@ func (a *Client) GetNetworkProfile(params *GetNetworkProfileParams) (*GetNetwork Reader: &GetNetworkProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -153,13 +168,12 @@ func (a *Client) GetNetworkProfile(params *GetNetworkProfileParams) (*GetNetwork Get all network profiles */ -func (a *Client) GetNetworkProfiles(params *GetNetworkProfilesParams) (*GetNetworkProfilesOK, error) { +func (a *Client) GetNetworkProfiles(params *GetNetworkProfilesParams, opts ...ClientOption) (*GetNetworkProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNetworkProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getNetworkProfiles", Method: "GET", PathPattern: "/iaas/api/network-profiles", @@ -170,7 +184,12 @@ func (a *Client) GetNetworkProfiles(params *GetNetworkProfilesParams) (*GetNetwo Reader: &GetNetworkProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -189,13 +208,12 @@ func (a *Client) GetNetworkProfiles(params *GetNetworkProfilesParams) (*GetNetwo Update network profile */ -func (a *Client) UpdateNetworkProfile(params *UpdateNetworkProfileParams) (*UpdateNetworkProfileOK, error) { +func (a *Client) UpdateNetworkProfile(params *UpdateNetworkProfileParams, opts ...ClientOption) (*UpdateNetworkProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateNetworkProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateNetworkProfile", Method: "PATCH", PathPattern: "/iaas/api/network-profiles/{id}", @@ -206,7 +224,12 @@ func (a *Client) UpdateNetworkProfile(params *UpdateNetworkProfileParams) (*Upda Reader: &UpdateNetworkProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/network_profile/update_network_profile_parameters.go b/pkg/client/network_profile/update_network_profile_parameters.go index 497e8546..cc75b884 100644 --- a/pkg/client/network_profile/update_network_profile_parameters.go +++ b/pkg/client/network_profile/update_network_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateNetworkProfileParams creates a new UpdateNetworkProfileParams object -// with the default values initialized. +// NewUpdateNetworkProfileParams creates a new UpdateNetworkProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateNetworkProfileParams() *UpdateNetworkProfileParams { - var () return &UpdateNetworkProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateNetworkProfileParamsWithTimeout creates a new UpdateNetworkProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateNetworkProfileParamsWithTimeout(timeout time.Duration) *UpdateNetworkProfileParams { - var () return &UpdateNetworkProfileParams{ - timeout: timeout, } } // NewUpdateNetworkProfileParamsWithContext creates a new UpdateNetworkProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateNetworkProfileParamsWithContext(ctx context.Context) *UpdateNetworkProfileParams { - var () return &UpdateNetworkProfileParams{ - Context: ctx, } } // NewUpdateNetworkProfileParamsWithHTTPClient creates a new UpdateNetworkProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateNetworkProfileParamsWithHTTPClient(client *http.Client) *UpdateNetworkProfileParams { - var () return &UpdateNetworkProfileParams{ HTTPClient: client, } } -/*UpdateNetworkProfileParams contains all the parameters to send to the API endpoint -for the update network profile operation typically these are written to a http.Request +/* UpdateNetworkProfileParams contains all the parameters to send to the API endpoint + for the update network profile operation. + + Typically these are written to a http.Request. */ type UpdateNetworkProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - NetworkProfile specification + /* Body. + + NetworkProfile specification */ Body *models.NetworkProfileSpecification - /*ID - The ID of the network profile. + /* ID. + + The ID of the network profile. */ ID string @@ -83,6 +84,21 @@ type UpdateNetworkProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNetworkProfileParams) WithDefaults() *UpdateNetworkProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update network profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNetworkProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update network profile params func (o *UpdateNetworkProfileParams) WithTimeout(timeout time.Duration) *UpdateNetworkProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateNetworkProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/network_profile/update_network_profile_responses.go b/pkg/client/network_profile/update_network_profile_responses.go index bd3f92e8..6824bd7e 100644 --- a/pkg/client/network_profile/update_network_profile_responses.go +++ b/pkg/client/network_profile/update_network_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateNetworkProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateNetworkProfileOK() *UpdateNetworkProfileOK { return &UpdateNetworkProfileOK{} } -/*UpdateNetworkProfileOK handles this case with default header values. +/* UpdateNetworkProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateNetworkProfileOK struct { func (o *UpdateNetworkProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/network-profiles/{id}][%d] updateNetworkProfileOK %+v", 200, o.Payload) } - func (o *UpdateNetworkProfileOK) GetPayload() *models.NetworkProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateNetworkProfileForbidden() *UpdateNetworkProfileForbidden { return &UpdateNetworkProfileForbidden{} } -/*UpdateNetworkProfileForbidden handles this case with default header values. +/* UpdateNetworkProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateNetworkProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateNetworkProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/network-profiles/{id}][%d] updateNetworkProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/network-profiles/{id}][%d] updateNetworkProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateNetworkProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateNetworkProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateNetworkProfileNotFound() *UpdateNetworkProfileNotFound { return &UpdateNetworkProfileNotFound{} } -/*UpdateNetworkProfileNotFound handles this case with default header values. +/* UpdateNetworkProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateNetworkProfileNotFound struct { func (o *UpdateNetworkProfileNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/network-profiles/{id}][%d] updateNetworkProfileNotFound %+v", 404, o.Payload) } - func (o *UpdateNetworkProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/policies/create_policy_using_post1_parameters.go b/pkg/client/policies/create_policy_using_post1_parameters.go index eeccd5ed..65e026b0 100644 --- a/pkg/client/policies/create_policy_using_post1_parameters.go +++ b/pkg/client/policies/create_policy_using_post1_parameters.go @@ -19,63 +19,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreatePolicyUsingPOST1Params creates a new CreatePolicyUsingPOST1Params object -// with the default values initialized. +// NewCreatePolicyUsingPOST1Params creates a new CreatePolicyUsingPOST1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreatePolicyUsingPOST1Params() *CreatePolicyUsingPOST1Params { - var () return &CreatePolicyUsingPOST1Params{ - timeout: cr.DefaultTimeout, } } // NewCreatePolicyUsingPOST1ParamsWithTimeout creates a new CreatePolicyUsingPOST1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePolicyUsingPOST1ParamsWithTimeout(timeout time.Duration) *CreatePolicyUsingPOST1Params { - var () return &CreatePolicyUsingPOST1Params{ - timeout: timeout, } } // NewCreatePolicyUsingPOST1ParamsWithContext creates a new CreatePolicyUsingPOST1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePolicyUsingPOST1ParamsWithContext(ctx context.Context) *CreatePolicyUsingPOST1Params { - var () return &CreatePolicyUsingPOST1Params{ - Context: ctx, } } // NewCreatePolicyUsingPOST1ParamsWithHTTPClient creates a new CreatePolicyUsingPOST1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePolicyUsingPOST1ParamsWithHTTPClient(client *http.Client) *CreatePolicyUsingPOST1Params { - var () return &CreatePolicyUsingPOST1Params{ HTTPClient: client, } } -/*CreatePolicyUsingPOST1Params contains all the parameters to send to the API endpoint -for the create policy using p o s t 1 operation typically these are written to a http.Request +/* CreatePolicyUsingPOST1Params contains all the parameters to send to the API endpoint + for the create policy using p o s t 1 operation. + + Typically these are written to a http.Request. */ type CreatePolicyUsingPOST1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*Policy - The policy to be created or updated + /* Policy. + + The policy to be created or updated */ Policy *models.Policy - /*ValidationOnly - For a dry run that will do policy validation only instead of creating or updating a policy + /* ValidationOnly. + + For a dry run that will do policy validation only instead of creating or updating a policy */ ValidationOnly *bool @@ -84,6 +85,21 @@ type CreatePolicyUsingPOST1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create policy using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePolicyUsingPOST1Params) WithDefaults() *CreatePolicyUsingPOST1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create policy using p o s t 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePolicyUsingPOST1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create policy using p o s t 1 params func (o *CreatePolicyUsingPOST1Params) WithTimeout(timeout time.Duration) *CreatePolicyUsingPOST1Params { o.SetTimeout(timeout) @@ -162,18 +178,18 @@ func (o *CreatePolicyUsingPOST1Params) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Policy != nil { if err := r.SetBodyParam(o.Policy); err != nil { return err @@ -184,16 +200,17 @@ func (o *CreatePolicyUsingPOST1Params) WriteToRequest(r runtime.ClientRequest, r // query param validationOnly var qrValidationOnly bool + if o.ValidationOnly != nil { qrValidationOnly = *o.ValidationOnly } qValidationOnly := swag.FormatBool(qrValidationOnly) if qValidationOnly != "" { + if err := r.SetQueryParam("validationOnly", qValidationOnly); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/policies/create_policy_using_post1_responses.go b/pkg/client/policies/create_policy_using_post1_responses.go index 343d6d5b..d328d720 100644 --- a/pkg/client/policies/create_policy_using_post1_responses.go +++ b/pkg/client/policies/create_policy_using_post1_responses.go @@ -29,7 +29,6 @@ func (o *CreatePolicyUsingPOST1Reader) ReadResponse(response runtime.ClientRespo return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewCreatePolicyUsingPOST1OK() *CreatePolicyUsingPOST1OK { return &CreatePolicyUsingPOST1OK{} } -/*CreatePolicyUsingPOST1OK handles this case with default header values. +/* CreatePolicyUsingPOST1OK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type CreatePolicyUsingPOST1OK struct { func (o *CreatePolicyUsingPOST1OK) Error() string { return fmt.Sprintf("[POST /policy/api/policies][%d] createPolicyUsingPOST1OK %+v", 200, o.Payload) } - func (o *CreatePolicyUsingPOST1OK) GetPayload() *models.Policy { return o.Payload } diff --git a/pkg/client/policies/delete_policy_using_delete1_parameters.go b/pkg/client/policies/delete_policy_using_delete1_parameters.go index 5475de1e..007b64a6 100644 --- a/pkg/client/policies/delete_policy_using_delete1_parameters.go +++ b/pkg/client/policies/delete_policy_using_delete1_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeletePolicyUsingDELETE1Params creates a new DeletePolicyUsingDELETE1Params object -// with the default values initialized. +// NewDeletePolicyUsingDELETE1Params creates a new DeletePolicyUsingDELETE1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeletePolicyUsingDELETE1Params() *DeletePolicyUsingDELETE1Params { - var () return &DeletePolicyUsingDELETE1Params{ - timeout: cr.DefaultTimeout, } } // NewDeletePolicyUsingDELETE1ParamsWithTimeout creates a new DeletePolicyUsingDELETE1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeletePolicyUsingDELETE1ParamsWithTimeout(timeout time.Duration) *DeletePolicyUsingDELETE1Params { - var () return &DeletePolicyUsingDELETE1Params{ - timeout: timeout, } } // NewDeletePolicyUsingDELETE1ParamsWithContext creates a new DeletePolicyUsingDELETE1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeletePolicyUsingDELETE1ParamsWithContext(ctx context.Context) *DeletePolicyUsingDELETE1Params { - var () return &DeletePolicyUsingDELETE1Params{ - Context: ctx, } } // NewDeletePolicyUsingDELETE1ParamsWithHTTPClient creates a new DeletePolicyUsingDELETE1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeletePolicyUsingDELETE1ParamsWithHTTPClient(client *http.Client) *DeletePolicyUsingDELETE1Params { - var () return &DeletePolicyUsingDELETE1Params{ HTTPClient: client, } } -/*DeletePolicyUsingDELETE1Params contains all the parameters to send to the API endpoint -for the delete policy using d e l e t e 1 operation typically these are written to a http.Request +/* DeletePolicyUsingDELETE1Params contains all the parameters to send to the API endpoint + for the delete policy using d e l e t e 1 operation. + + Typically these are written to a http.Request. */ type DeletePolicyUsingDELETE1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Policy ID + /* ID. + + Policy ID + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeletePolicyUsingDELETE1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete policy using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePolicyUsingDELETE1Params) WithDefaults() *DeletePolicyUsingDELETE1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete policy using d e l e t e 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePolicyUsingDELETE1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete policy using d e l e t e 1 params func (o *DeletePolicyUsingDELETE1Params) WithTimeout(timeout time.Duration) *DeletePolicyUsingDELETE1Params { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeletePolicyUsingDELETE1Params) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/policies/delete_policy_using_delete1_responses.go b/pkg/client/policies/delete_policy_using_delete1_responses.go index b29d7d40..5be378a7 100644 --- a/pkg/client/policies/delete_policy_using_delete1_responses.go +++ b/pkg/client/policies/delete_policy_using_delete1_responses.go @@ -26,7 +26,6 @@ func (o *DeletePolicyUsingDELETE1Reader) ReadResponse(response runtime.ClientRes return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -37,7 +36,7 @@ func NewDeletePolicyUsingDELETE1NoContent() *DeletePolicyUsingDELETE1NoContent { return &DeletePolicyUsingDELETE1NoContent{} } -/*DeletePolicyUsingDELETE1NoContent handles this case with default header values. +/* DeletePolicyUsingDELETE1NoContent describes a response with status code 204, with default header values. No Content */ diff --git a/pkg/client/policies/get_policies_using_get1_parameters.go b/pkg/client/policies/get_policies_using_get1_parameters.go index 16840c7a..a177000c 100644 --- a/pkg/client/policies/get_policies_using_get1_parameters.go +++ b/pkg/client/policies/get_policies_using_get1_parameters.go @@ -17,83 +17,92 @@ import ( "github.com/go-openapi/swag" ) -// NewGetPoliciesUsingGET1Params creates a new GetPoliciesUsingGET1Params object -// with the default values initialized. +// NewGetPoliciesUsingGET1Params creates a new GetPoliciesUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPoliciesUsingGET1Params() *GetPoliciesUsingGET1Params { - var () return &GetPoliciesUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetPoliciesUsingGET1ParamsWithTimeout creates a new GetPoliciesUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPoliciesUsingGET1ParamsWithTimeout(timeout time.Duration) *GetPoliciesUsingGET1Params { - var () return &GetPoliciesUsingGET1Params{ - timeout: timeout, } } // NewGetPoliciesUsingGET1ParamsWithContext creates a new GetPoliciesUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPoliciesUsingGET1ParamsWithContext(ctx context.Context) *GetPoliciesUsingGET1Params { - var () return &GetPoliciesUsingGET1Params{ - Context: ctx, } } // NewGetPoliciesUsingGET1ParamsWithHTTPClient creates a new GetPoliciesUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPoliciesUsingGET1ParamsWithHTTPClient(client *http.Client) *GetPoliciesUsingGET1Params { - var () return &GetPoliciesUsingGET1Params{ HTTPClient: client, } } -/*GetPoliciesUsingGET1Params contains all the parameters to send to the API endpoint -for the get policies using get1 operation typically these are written to a http.Request +/* GetPoliciesUsingGET1Params contains all the parameters to send to the API endpoint + for the get policies using get1 operation. + + Typically these are written to a http.Request. */ type GetPoliciesUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ComputeStats - computeStats + /* ComputeStats. + + computeStats */ ComputeStats *bool - /*ExpandDefinition - Retrieves policy definition information for each returned policy. + /* ExpandDefinition. + + Retrieves policy definition information for each returned policy. */ ExpandDefinition *bool - /*Search - Matches will start with this string in their name or have this string somewhere in their description. + /* Search. + + Matches will start with this string in their name or have this string somewhere in their description. */ Search *string @@ -102,6 +111,21 @@ type GetPoliciesUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get policies using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPoliciesUsingGET1Params) WithDefaults() *GetPoliciesUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get policies using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPoliciesUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get policies using get1 params func (o *GetPoliciesUsingGET1Params) WithTimeout(timeout time.Duration) *GetPoliciesUsingGET1Params { o.SetTimeout(timeout) @@ -220,108 +244,117 @@ func (o *GetPoliciesUsingGET1Params) WriteToRequest(r runtime.ClientRequest, reg } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ComputeStats != nil { // query param computeStats var qrComputeStats bool + if o.ComputeStats != nil { qrComputeStats = *o.ComputeStats } qComputeStats := swag.FormatBool(qrComputeStats) if qComputeStats != "" { + if err := r.SetQueryParam("computeStats", qComputeStats); err != nil { return err } } - } if o.ExpandDefinition != nil { // query param expandDefinition var qrExpandDefinition bool + if o.ExpandDefinition != nil { qrExpandDefinition = *o.ExpandDefinition } qExpandDefinition := swag.FormatBool(qrExpandDefinition) if qExpandDefinition != "" { + if err := r.SetQueryParam("expandDefinition", qExpandDefinition); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -329,3 +362,20 @@ func (o *GetPoliciesUsingGET1Params) WriteToRequest(r runtime.ClientRequest, reg } return nil } + +// bindParamGetPoliciesUsingGET1 binds the parameter $orderby +func (o *GetPoliciesUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/policies/get_policies_using_get1_responses.go b/pkg/client/policies/get_policies_using_get1_responses.go index 1e0a9324..25c2fab7 100644 --- a/pkg/client/policies/get_policies_using_get1_responses.go +++ b/pkg/client/policies/get_policies_using_get1_responses.go @@ -29,7 +29,6 @@ func (o *GetPoliciesUsingGET1Reader) ReadResponse(response runtime.ClientRespons return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetPoliciesUsingGET1OK() *GetPoliciesUsingGET1OK { return &GetPoliciesUsingGET1OK{} } -/*GetPoliciesUsingGET1OK handles this case with default header values. +/* GetPoliciesUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetPoliciesUsingGET1OK struct { func (o *GetPoliciesUsingGET1OK) Error() string { return fmt.Sprintf("[GET /policy/api/policies][%d] getPoliciesUsingGET1OK %+v", 200, o.Payload) } - func (o *GetPoliciesUsingGET1OK) GetPayload() *models.PageOfPolicy { return o.Payload } diff --git a/pkg/client/policies/get_policy_using_get1_parameters.go b/pkg/client/policies/get_policy_using_get1_parameters.go index 335c06f9..1515832b 100644 --- a/pkg/client/policies/get_policy_using_get1_parameters.go +++ b/pkg/client/policies/get_policy_using_get1_parameters.go @@ -17,63 +17,66 @@ import ( "github.com/go-openapi/swag" ) -// NewGetPolicyUsingGET1Params creates a new GetPolicyUsingGET1Params object -// with the default values initialized. +// NewGetPolicyUsingGET1Params creates a new GetPolicyUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPolicyUsingGET1Params() *GetPolicyUsingGET1Params { - var () return &GetPolicyUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetPolicyUsingGET1ParamsWithTimeout creates a new GetPolicyUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPolicyUsingGET1ParamsWithTimeout(timeout time.Duration) *GetPolicyUsingGET1Params { - var () return &GetPolicyUsingGET1Params{ - timeout: timeout, } } // NewGetPolicyUsingGET1ParamsWithContext creates a new GetPolicyUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPolicyUsingGET1ParamsWithContext(ctx context.Context) *GetPolicyUsingGET1Params { - var () return &GetPolicyUsingGET1Params{ - Context: ctx, } } // NewGetPolicyUsingGET1ParamsWithHTTPClient creates a new GetPolicyUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPolicyUsingGET1ParamsWithHTTPClient(client *http.Client) *GetPolicyUsingGET1Params { - var () return &GetPolicyUsingGET1Params{ HTTPClient: client, } } -/*GetPolicyUsingGET1Params contains all the parameters to send to the API endpoint -for the get policy using get1 operation typically these are written to a http.Request +/* GetPolicyUsingGET1Params contains all the parameters to send to the API endpoint + for the get policy using get1 operation. + + Typically these are written to a http.Request. */ type GetPolicyUsingGET1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ComputeStats - computeStats + /* ComputeStats. + + computeStats */ ComputeStats *bool - /*ID - Policy ID + /* ID. + + Policy ID + + Format: uuid */ ID strfmt.UUID @@ -82,6 +85,21 @@ type GetPolicyUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get policy using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyUsingGET1Params) WithDefaults() *GetPolicyUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get policy using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get policy using get1 params func (o *GetPolicyUsingGET1Params) WithTimeout(timeout time.Duration) *GetPolicyUsingGET1Params { o.SetTimeout(timeout) @@ -160,32 +178,34 @@ func (o *GetPolicyUsingGET1Params) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ComputeStats != nil { // query param computeStats var qrComputeStats bool + if o.ComputeStats != nil { qrComputeStats = *o.ComputeStats } qComputeStats := swag.FormatBool(qrComputeStats) if qComputeStats != "" { + if err := r.SetQueryParam("computeStats", qComputeStats); err != nil { return err } } - } // path param id diff --git a/pkg/client/policies/get_policy_using_get1_responses.go b/pkg/client/policies/get_policy_using_get1_responses.go index 438b6620..346d39cd 100644 --- a/pkg/client/policies/get_policy_using_get1_responses.go +++ b/pkg/client/policies/get_policy_using_get1_responses.go @@ -29,7 +29,6 @@ func (o *GetPolicyUsingGET1Reader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetPolicyUsingGET1OK() *GetPolicyUsingGET1OK { return &GetPolicyUsingGET1OK{} } -/*GetPolicyUsingGET1OK handles this case with default header values. +/* GetPolicyUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetPolicyUsingGET1OK struct { func (o *GetPolicyUsingGET1OK) Error() string { return fmt.Sprintf("[GET /policy/api/policies/{id}][%d] getPolicyUsingGET1OK %+v", 200, o.Payload) } - func (o *GetPolicyUsingGET1OK) GetPayload() *models.Policy { return o.Payload } diff --git a/pkg/client/policies/policies_client.go b/pkg/client/policies/policies_client.go index 07641f83..b66d7f47 100644 --- a/pkg/client/policies/policies_client.go +++ b/pkg/client/policies/policies_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params) (*CreatePolicyUsingPOST1OK, error) + CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params, opts ...ClientOption) (*CreatePolicyUsingPOST1OK, error) - DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params) (*DeletePolicyUsingDELETE1NoContent, error) + DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params, opts ...ClientOption) (*DeletePolicyUsingDELETE1NoContent, error) - GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params) (*GetPoliciesUsingGET1OK, error) + GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params, opts ...ClientOption) (*GetPoliciesUsingGET1OK, error) - GetPolicyUsingGET1(params *GetPolicyUsingGET1Params) (*GetPolicyUsingGET1OK, error) + GetPolicyUsingGET1(params *GetPolicyUsingGET1Params, opts ...ClientOption) (*GetPolicyUsingGET1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { Create a new policy or update an existing policy based on request body and validate its fields according to business rules. */ -func (a *Client) CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params) (*CreatePolicyUsingPOST1OK, error) { +func (a *Client) CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params, opts ...ClientOption) (*CreatePolicyUsingPOST1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreatePolicyUsingPOST1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createPolicyUsingPOST_1", Method: "POST", PathPattern: "/policy/api/policies", @@ -60,7 +62,12 @@ func (a *Client) CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params) (* Reader: &CreatePolicyUsingPOST1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -79,13 +86,12 @@ func (a *Client) CreatePolicyUsingPOST1(params *CreatePolicyUsingPOST1Params) (* Delete a specified policy corresponding to its unique id. */ -func (a *Client) DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params) (*DeletePolicyUsingDELETE1NoContent, error) { +func (a *Client) DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params, opts ...ClientOption) (*DeletePolicyUsingDELETE1NoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeletePolicyUsingDELETE1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deletePolicyUsingDELETE_1", Method: "DELETE", PathPattern: "/policy/api/policies/{id}", @@ -96,7 +102,12 @@ func (a *Client) DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params Reader: &DeletePolicyUsingDELETE1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +126,12 @@ func (a *Client) DeletePolicyUsingDELETE1(params *DeletePolicyUsingDELETE1Params Find all the policies associated with current org. */ -func (a *Client) GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params) (*GetPoliciesUsingGET1OK, error) { +func (a *Client) GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params, opts ...ClientOption) (*GetPoliciesUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPoliciesUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPoliciesUsingGET_1", Method: "GET", PathPattern: "/policy/api/policies", @@ -132,7 +142,12 @@ func (a *Client) GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params) (*GetP Reader: &GetPoliciesUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -151,13 +166,12 @@ func (a *Client) GetPoliciesUsingGET1(params *GetPoliciesUsingGET1Params) (*GetP Find a specific policy based on the input policy id. */ -func (a *Client) GetPolicyUsingGET1(params *GetPolicyUsingGET1Params) (*GetPolicyUsingGET1OK, error) { +func (a *Client) GetPolicyUsingGET1(params *GetPolicyUsingGET1Params, opts ...ClientOption) (*GetPolicyUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPolicyUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPolicyUsingGET_1", Method: "GET", PathPattern: "/policy/api/policies/{id}", @@ -168,7 +182,12 @@ func (a *Client) GetPolicyUsingGET1(params *GetPolicyUsingGET1Params) (*GetPolic Reader: &GetPolicyUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/policy_decisions/get_decision_by_id_using_get_parameters.go b/pkg/client/policy_decisions/get_decision_by_id_using_get_parameters.go index e77e56e9..2e1bfed0 100644 --- a/pkg/client/policy_decisions/get_decision_by_id_using_get_parameters.go +++ b/pkg/client/policy_decisions/get_decision_by_id_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDecisionByIDUsingGETParams creates a new GetDecisionByIDUsingGETParams object -// with the default values initialized. +// NewGetDecisionByIDUsingGETParams creates a new GetDecisionByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDecisionByIDUsingGETParams() *GetDecisionByIDUsingGETParams { - var () return &GetDecisionByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDecisionByIDUsingGETParamsWithTimeout creates a new GetDecisionByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDecisionByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetDecisionByIDUsingGETParams { - var () return &GetDecisionByIDUsingGETParams{ - timeout: timeout, } } // NewGetDecisionByIDUsingGETParamsWithContext creates a new GetDecisionByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDecisionByIDUsingGETParamsWithContext(ctx context.Context) *GetDecisionByIDUsingGETParams { - var () return &GetDecisionByIDUsingGETParams{ - Context: ctx, } } // NewGetDecisionByIDUsingGETParamsWithHTTPClient creates a new GetDecisionByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDecisionByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetDecisionByIDUsingGETParams { - var () return &GetDecisionByIDUsingGETParams{ HTTPClient: client, } } -/*GetDecisionByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get decision by Id using g e t operation typically these are written to a http.Request +/* GetDecisionByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get decision by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetDecisionByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Policy decision Id + /* ID. + + Policy decision Id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetDecisionByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get decision by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDecisionByIDUsingGETParams) WithDefaults() *GetDecisionByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get decision by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDecisionByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get decision by Id using get params func (o *GetDecisionByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetDecisionByIDUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetDecisionByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/policy_decisions/get_decision_by_id_using_get_responses.go b/pkg/client/policy_decisions/get_decision_by_id_using_get_responses.go index 75a90c34..d94c7fed 100644 --- a/pkg/client/policy_decisions/get_decision_by_id_using_get_responses.go +++ b/pkg/client/policy_decisions/get_decision_by_id_using_get_responses.go @@ -29,7 +29,6 @@ func (o *GetDecisionByIDUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetDecisionByIDUsingGETOK() *GetDecisionByIDUsingGETOK { return &GetDecisionByIDUsingGETOK{} } -/*GetDecisionByIDUsingGETOK handles this case with default header values. +/* GetDecisionByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetDecisionByIDUsingGETOK struct { func (o *GetDecisionByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /policy/api/policyDecisions/{id}][%d] getDecisionByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetDecisionByIDUsingGETOK) GetPayload() *models.PolicyDecisionOfObjectNode { return o.Payload } diff --git a/pkg/client/policy_decisions/get_decisions_using_get_parameters.go b/pkg/client/policy_decisions/get_decisions_using_get_parameters.go index 54a21ea9..bf8cbb0a 100644 --- a/pkg/client/policy_decisions/get_decisions_using_get_parameters.go +++ b/pkg/client/policy_decisions/get_decisions_using_get_parameters.go @@ -17,88 +17,100 @@ import ( "github.com/go-openapi/swag" ) -// NewGetDecisionsUsingGETParams creates a new GetDecisionsUsingGETParams object -// with the default values initialized. +// NewGetDecisionsUsingGETParams creates a new GetDecisionsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDecisionsUsingGETParams() *GetDecisionsUsingGETParams { - var () return &GetDecisionsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDecisionsUsingGETParamsWithTimeout creates a new GetDecisionsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDecisionsUsingGETParamsWithTimeout(timeout time.Duration) *GetDecisionsUsingGETParams { - var () return &GetDecisionsUsingGETParams{ - timeout: timeout, } } // NewGetDecisionsUsingGETParamsWithContext creates a new GetDecisionsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDecisionsUsingGETParamsWithContext(ctx context.Context) *GetDecisionsUsingGETParams { - var () return &GetDecisionsUsingGETParams{ - Context: ctx, } } // NewGetDecisionsUsingGETParamsWithHTTPClient creates a new GetDecisionsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDecisionsUsingGETParamsWithHTTPClient(client *http.Client) *GetDecisionsUsingGETParams { - var () return &GetDecisionsUsingGETParams{ HTTPClient: client, } } -/*GetDecisionsUsingGETParams contains all the parameters to send to the API endpoint -for the get decisions using g e t operation typically these are written to a http.Request +/* GetDecisionsUsingGETParams contains all the parameters to send to the API endpoint + for the get decisions using g e t operation. + + Typically these are written to a http.Request. */ type GetDecisionsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*DryRunID - dryRunId + /* DryRunID. + + dryRunId + + Format: uuid */ DryRunID *strfmt.UUID - /*PolicyTypeID - Matches will only include policies of this type + /* PolicyTypeID. + + Matches will only include policies of this type */ PolicyTypeID *string - /*ProjectID - Matches will only include decisions with this project ID + /* ProjectID. + + Matches will only include decisions with this project ID */ ProjectID *string - /*Search - Matches will start with this string in their policy name or target name or have this string somewhere in their description. + /* Search. + + Matches will start with this string in their policy name or target name or have this string somewhere in their description. */ Search *string @@ -107,6 +119,21 @@ type GetDecisionsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get decisions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDecisionsUsingGETParams) WithDefaults() *GetDecisionsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get decisions using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDecisionsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get decisions using get params func (o *GetDecisionsUsingGETParams) WithTimeout(timeout time.Duration) *GetDecisionsUsingGETParams { o.SetTimeout(timeout) @@ -236,124 +263,134 @@ func (o *GetDecisionsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.DryRunID != nil { // query param dryRunId var qrDryRunID strfmt.UUID + if o.DryRunID != nil { qrDryRunID = *o.DryRunID } qDryRunID := qrDryRunID.String() if qDryRunID != "" { + if err := r.SetQueryParam("dryRunId", qDryRunID); err != nil { return err } } - } if o.PolicyTypeID != nil { // query param policyTypeId var qrPolicyTypeID string + if o.PolicyTypeID != nil { qrPolicyTypeID = *o.PolicyTypeID } qPolicyTypeID := qrPolicyTypeID if qPolicyTypeID != "" { + if err := r.SetQueryParam("policyTypeId", qPolicyTypeID); err != nil { return err } } - } if o.ProjectID != nil { // query param projectId var qrProjectID string + if o.ProjectID != nil { qrProjectID = *o.ProjectID } qProjectID := qrProjectID if qProjectID != "" { + if err := r.SetQueryParam("projectId", qProjectID); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -361,3 +398,20 @@ func (o *GetDecisionsUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } return nil } + +// bindParamGetDecisionsUsingGET binds the parameter $orderby +func (o *GetDecisionsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/policy_decisions/get_decisions_using_get_responses.go b/pkg/client/policy_decisions/get_decisions_using_get_responses.go index 4241f9a3..911e0783 100644 --- a/pkg/client/policy_decisions/get_decisions_using_get_responses.go +++ b/pkg/client/policy_decisions/get_decisions_using_get_responses.go @@ -29,7 +29,6 @@ func (o *GetDecisionsUsingGETReader) ReadResponse(response runtime.ClientRespons return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetDecisionsUsingGETOK() *GetDecisionsUsingGETOK { return &GetDecisionsUsingGETOK{} } -/*GetDecisionsUsingGETOK handles this case with default header values. +/* GetDecisionsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetDecisionsUsingGETOK struct { func (o *GetDecisionsUsingGETOK) Error() string { return fmt.Sprintf("[GET /policy/api/policyDecisions][%d] getDecisionsUsingGETOK %+v", 200, o.Payload) } - func (o *GetDecisionsUsingGETOK) GetPayload() *models.PageOfPolicyDecisionOfObjectNode { return o.Payload } diff --git a/pkg/client/policy_decisions/policy_decisions_client.go b/pkg/client/policy_decisions/policy_decisions_client.go index 33a4115c..83565745 100644 --- a/pkg/client/policy_decisions/policy_decisions_client.go +++ b/pkg/client/policy_decisions/policy_decisions_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams) (*GetDecisionByIDUsingGETOK, error) + GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams, opts ...ClientOption) (*GetDecisionByIDUsingGETOK, error) - GetDecisionsUsingGET(params *GetDecisionsUsingGETParams) (*GetDecisionsUsingGETOK, error) + GetDecisionsUsingGET(params *GetDecisionsUsingGETParams, opts ...ClientOption) (*GetDecisionsUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Find a specific policy decision based on the input policy decision id. */ -func (a *Client) GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams) (*GetDecisionByIDUsingGETOK, error) { +func (a *Client) GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams, opts ...ClientOption) (*GetDecisionByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDecisionByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDecisionByIdUsingGET", Method: "GET", PathPattern: "/policy/api/policyDecisions/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams) Reader: &GetDecisionByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetDecisionByIDUsingGET(params *GetDecisionByIDUsingGETParams) Returns a paginated list of policy decisions. If a dryRunId is provided, the return value has a field indicating whether the dry run is complete. */ -func (a *Client) GetDecisionsUsingGET(params *GetDecisionsUsingGETParams) (*GetDecisionsUsingGETOK, error) { +func (a *Client) GetDecisionsUsingGET(params *GetDecisionsUsingGETParams, opts ...ClientOption) (*GetDecisionsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDecisionsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDecisionsUsingGET", Method: "GET", PathPattern: "/policy/api/policyDecisions", @@ -92,7 +98,12 @@ func (a *Client) GetDecisionsUsingGET(params *GetDecisionsUsingGETParams) (*GetD Reader: &GetDecisionsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/policy_types/get_policy_type_by_id_using_get_parameters.go b/pkg/client/policy_types/get_policy_type_by_id_using_get_parameters.go index 93b7f934..5eb81959 100644 --- a/pkg/client/policy_types/get_policy_type_by_id_using_get_parameters.go +++ b/pkg/client/policy_types/get_policy_type_by_id_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPolicyTypeByIDUsingGETParams creates a new GetPolicyTypeByIDUsingGETParams object -// with the default values initialized. +// NewGetPolicyTypeByIDUsingGETParams creates a new GetPolicyTypeByIDUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPolicyTypeByIDUsingGETParams() *GetPolicyTypeByIDUsingGETParams { - var () return &GetPolicyTypeByIDUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetPolicyTypeByIDUsingGETParamsWithTimeout creates a new GetPolicyTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPolicyTypeByIDUsingGETParamsWithTimeout(timeout time.Duration) *GetPolicyTypeByIDUsingGETParams { - var () return &GetPolicyTypeByIDUsingGETParams{ - timeout: timeout, } } // NewGetPolicyTypeByIDUsingGETParamsWithContext creates a new GetPolicyTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPolicyTypeByIDUsingGETParamsWithContext(ctx context.Context) *GetPolicyTypeByIDUsingGETParams { - var () return &GetPolicyTypeByIDUsingGETParams{ - Context: ctx, } } // NewGetPolicyTypeByIDUsingGETParamsWithHTTPClient creates a new GetPolicyTypeByIDUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPolicyTypeByIDUsingGETParamsWithHTTPClient(client *http.Client) *GetPolicyTypeByIDUsingGETParams { - var () return &GetPolicyTypeByIDUsingGETParams{ HTTPClient: client, } } -/*GetPolicyTypeByIDUsingGETParams contains all the parameters to send to the API endpoint -for the get policy type by Id using g e t operation typically these are written to a http.Request +/* GetPolicyTypeByIDUsingGETParams contains all the parameters to send to the API endpoint + for the get policy type by Id using g e t operation. + + Typically these are written to a http.Request. */ type GetPolicyTypeByIDUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - Policy type ID + /* ID. + + Policy type ID */ ID string @@ -76,6 +76,21 @@ type GetPolicyTypeByIDUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get policy type by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyTypeByIDUsingGETParams) WithDefaults() *GetPolicyTypeByIDUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get policy type by Id using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyTypeByIDUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get policy type by Id using get params func (o *GetPolicyTypeByIDUsingGETParams) WithTimeout(timeout time.Duration) *GetPolicyTypeByIDUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetPolicyTypeByIDUsingGETParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/policy_types/get_policy_type_by_id_using_get_responses.go b/pkg/client/policy_types/get_policy_type_by_id_using_get_responses.go index ec8a05bf..1153f89f 100644 --- a/pkg/client/policy_types/get_policy_type_by_id_using_get_responses.go +++ b/pkg/client/policy_types/get_policy_type_by_id_using_get_responses.go @@ -29,7 +29,6 @@ func (o *GetPolicyTypeByIDUsingGETReader) ReadResponse(response runtime.ClientRe return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetPolicyTypeByIDUsingGETOK() *GetPolicyTypeByIDUsingGETOK { return &GetPolicyTypeByIDUsingGETOK{} } -/*GetPolicyTypeByIDUsingGETOK handles this case with default header values. +/* GetPolicyTypeByIDUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetPolicyTypeByIDUsingGETOK struct { func (o *GetPolicyTypeByIDUsingGETOK) Error() string { return fmt.Sprintf("[GET /policy/api/policyTypes/{id}][%d] getPolicyTypeByIdUsingGETOK %+v", 200, o.Payload) } - func (o *GetPolicyTypeByIDUsingGETOK) GetPayload() *models.PolicyType { return o.Payload } diff --git a/pkg/client/policy_types/get_types_using_get1_parameters.go b/pkg/client/policy_types/get_types_using_get1_parameters.go index dbf08e41..3ae1f3c0 100644 --- a/pkg/client/policy_types/get_types_using_get1_parameters.go +++ b/pkg/client/policy_types/get_types_using_get1_parameters.go @@ -17,73 +17,80 @@ import ( "github.com/go-openapi/swag" ) -// NewGetTypesUsingGET1Params creates a new GetTypesUsingGET1Params object -// with the default values initialized. +// NewGetTypesUsingGET1Params creates a new GetTypesUsingGET1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTypesUsingGET1Params() *GetTypesUsingGET1Params { - var () return &GetTypesUsingGET1Params{ - timeout: cr.DefaultTimeout, } } // NewGetTypesUsingGET1ParamsWithTimeout creates a new GetTypesUsingGET1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTypesUsingGET1ParamsWithTimeout(timeout time.Duration) *GetTypesUsingGET1Params { - var () return &GetTypesUsingGET1Params{ - timeout: timeout, } } // NewGetTypesUsingGET1ParamsWithContext creates a new GetTypesUsingGET1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTypesUsingGET1ParamsWithContext(ctx context.Context) *GetTypesUsingGET1Params { - var () return &GetTypesUsingGET1Params{ - Context: ctx, } } // NewGetTypesUsingGET1ParamsWithHTTPClient creates a new GetTypesUsingGET1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTypesUsingGET1ParamsWithHTTPClient(client *http.Client) *GetTypesUsingGET1Params { - var () return &GetTypesUsingGET1Params{ HTTPClient: client, } } -/*GetTypesUsingGET1Params contains all the parameters to send to the API endpoint -for the get types using get1 operation typically these are written to a http.Request +/* GetTypesUsingGET1Params contains all the parameters to send to the API endpoint + for the get types using get1 operation. + + Typically these are written to a http.Request. */ type GetTypesUsingGET1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ExpandSchema - Retrieves the schema for this policy type + /* ExpandSchema. + + Retrieves the schema for this policy type */ ExpandSchema *bool @@ -92,6 +99,21 @@ type GetTypesUsingGET1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get types using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypesUsingGET1Params) WithDefaults() *GetTypesUsingGET1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get types using get1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTypesUsingGET1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get types using get1 params func (o *GetTypesUsingGET1Params) WithTimeout(timeout time.Duration) *GetTypesUsingGET1Params { o.SetTimeout(timeout) @@ -188,76 +210,83 @@ func (o *GetTypesUsingGET1Params) WriteToRequest(r runtime.ClientRequest, reg st } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ExpandSchema != nil { // query param expandSchema var qrExpandSchema bool + if o.ExpandSchema != nil { qrExpandSchema = *o.ExpandSchema } qExpandSchema := swag.FormatBool(qrExpandSchema) if qExpandSchema != "" { + if err := r.SetQueryParam("expandSchema", qExpandSchema); err != nil { return err } } - } if len(res) > 0 { @@ -265,3 +294,20 @@ func (o *GetTypesUsingGET1Params) WriteToRequest(r runtime.ClientRequest, reg st } return nil } + +// bindParamGetTypesUsingGET1 binds the parameter $orderby +func (o *GetTypesUsingGET1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/policy_types/get_types_using_get1_responses.go b/pkg/client/policy_types/get_types_using_get1_responses.go index fc71cb8c..4dbbf1f4 100644 --- a/pkg/client/policy_types/get_types_using_get1_responses.go +++ b/pkg/client/policy_types/get_types_using_get1_responses.go @@ -29,7 +29,6 @@ func (o *GetTypesUsingGET1Reader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewGetTypesUsingGET1OK() *GetTypesUsingGET1OK { return &GetTypesUsingGET1OK{} } -/*GetTypesUsingGET1OK handles this case with default header values. +/* GetTypesUsingGET1OK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type GetTypesUsingGET1OK struct { func (o *GetTypesUsingGET1OK) Error() string { return fmt.Sprintf("[GET /policy/api/policyTypes][%d] getTypesUsingGET1OK %+v", 200, o.Payload) } - func (o *GetTypesUsingGET1OK) GetPayload() *models.PageOfPolicyType { return o.Payload } diff --git a/pkg/client/policy_types/policy_types_client.go b/pkg/client/policy_types/policy_types_client.go index d44d5afe..97916761 100644 --- a/pkg/client/policy_types/policy_types_client.go +++ b/pkg/client/policy_types/policy_types_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETParams) (*GetPolicyTypeByIDUsingGETOK, error) + GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETParams, opts ...ClientOption) (*GetPolicyTypeByIDUsingGETOK, error) - GetTypesUsingGET1(params *GetTypesUsingGET1Params) (*GetTypesUsingGET1OK, error) + GetTypesUsingGET1(params *GetTypesUsingGET1Params, opts ...ClientOption) (*GetTypesUsingGET1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { Find a specific policy type based on the input policy type id. */ -func (a *Client) GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETParams) (*GetPolicyTypeByIDUsingGETOK, error) { +func (a *Client) GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETParams, opts ...ClientOption) (*GetPolicyTypeByIDUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPolicyTypeByIDUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPolicyTypeByIdUsingGET", Method: "GET", PathPattern: "/policy/api/policyTypes/{id}", @@ -56,7 +58,12 @@ func (a *Client) GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETPara Reader: &GetPolicyTypeByIDUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -75,13 +82,12 @@ func (a *Client) GetPolicyTypeByIDUsingGET(params *GetPolicyTypeByIDUsingGETPara Find all the policy types available in the current org. */ -func (a *Client) GetTypesUsingGET1(params *GetTypesUsingGET1Params) (*GetTypesUsingGET1OK, error) { +func (a *Client) GetTypesUsingGET1(params *GetTypesUsingGET1Params, opts ...ClientOption) (*GetTypesUsingGET1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTypesUsingGET1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTypesUsingGET_1", Method: "GET", PathPattern: "/policy/api/policyTypes", @@ -92,7 +98,12 @@ func (a *Client) GetTypesUsingGET1(params *GetTypesUsingGET1Params) (*GetTypesUs Reader: &GetTypesUsingGET1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_parameters.go b/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_parameters.go index ee12b090..7beb0850 100644 --- a/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_parameters.go +++ b/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewChangeMeteringAssignmentStrategyUsingPATCHParams creates a new ChangeMeteringAssignmentStrategyUsingPATCHParams object -// with the default values initialized. +// NewChangeMeteringAssignmentStrategyUsingPATCHParams creates a new ChangeMeteringAssignmentStrategyUsingPATCHParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewChangeMeteringAssignmentStrategyUsingPATCHParams() *ChangeMeteringAssignmentStrategyUsingPATCHParams { - var () return &ChangeMeteringAssignmentStrategyUsingPATCHParams{ - timeout: cr.DefaultTimeout, } } // NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithTimeout creates a new ChangeMeteringAssignmentStrategyUsingPATCHParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithTimeout(timeout time.Duration) *ChangeMeteringAssignmentStrategyUsingPATCHParams { - var () return &ChangeMeteringAssignmentStrategyUsingPATCHParams{ - timeout: timeout, } } // NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithContext creates a new ChangeMeteringAssignmentStrategyUsingPATCHParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithContext(ctx context.Context) *ChangeMeteringAssignmentStrategyUsingPATCHParams { - var () return &ChangeMeteringAssignmentStrategyUsingPATCHParams{ - Context: ctx, } } // NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithHTTPClient creates a new ChangeMeteringAssignmentStrategyUsingPATCHParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeMeteringAssignmentStrategyUsingPATCHParamsWithHTTPClient(client *http.Client) *ChangeMeteringAssignmentStrategyUsingPATCHParams { - var () return &ChangeMeteringAssignmentStrategyUsingPATCHParams{ HTTPClient: client, } } -/*ChangeMeteringAssignmentStrategyUsingPATCHParams contains all the parameters to send to the API endpoint -for the change metering assignment strategy using p a t c h operation typically these are written to a http.Request +/* ChangeMeteringAssignmentStrategyUsingPATCHParams contains all the parameters to send to the API endpoint + for the change metering assignment strategy using p a t c h operation. + + Typically these are written to a http.Request. */ type ChangeMeteringAssignmentStrategyUsingPATCHParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*MeteringAssignmentStrategy - Pricing card assignment strategy with 'EntityType' to override the strategy for the org + /* MeteringAssignmentStrategy. + + Pricing card assignment strategy with 'EntityType' to override the strategy for the org */ MeteringAssignmentStrategy *models.MeteringAssignmentStrategy @@ -78,6 +78,21 @@ type ChangeMeteringAssignmentStrategyUsingPATCHParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change metering assignment strategy using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMeteringAssignmentStrategyUsingPATCHParams) WithDefaults() *ChangeMeteringAssignmentStrategyUsingPATCHParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change metering assignment strategy using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMeteringAssignmentStrategyUsingPATCHParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change metering assignment strategy using p a t c h params func (o *ChangeMeteringAssignmentStrategyUsingPATCHParams) WithTimeout(timeout time.Duration) *ChangeMeteringAssignmentStrategyUsingPATCHParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *ChangeMeteringAssignmentStrategyUsingPATCHParams) WriteToRequest(r runt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.MeteringAssignmentStrategy != nil { if err := r.SetBodyParam(o.MeteringAssignmentStrategy); err != nil { return err diff --git a/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_responses.go b/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_responses.go index fe4abc6e..09986e7e 100644 --- a/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_responses.go +++ b/pkg/client/pricing_card_assignments/change_metering_assignment_strategy_using_patch_responses.go @@ -35,7 +35,6 @@ func (o *ChangeMeteringAssignmentStrategyUsingPATCHReader) ReadResponse(response return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewChangeMeteringAssignmentStrategyUsingPATCHOK() *ChangeMeteringAssignment return &ChangeMeteringAssignmentStrategyUsingPATCHOK{} } -/*ChangeMeteringAssignmentStrategyUsingPATCHOK handles this case with default header values. +/* ChangeMeteringAssignmentStrategyUsingPATCHOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type ChangeMeteringAssignmentStrategyUsingPATCHOK struct { func (o *ChangeMeteringAssignmentStrategyUsingPATCHOK) Error() string { return fmt.Sprintf("[PATCH /price/api/private/pricing-card-assignments/strategy][%d] changeMeteringAssignmentStrategyUsingPATCHOK %+v", 200, o.Payload) } - func (o *ChangeMeteringAssignmentStrategyUsingPATCHOK) GetPayload() *models.MeteringAssignmentStrategy { return o.Payload } @@ -79,7 +77,7 @@ func NewChangeMeteringAssignmentStrategyUsingPATCHUnauthorized() *ChangeMetering return &ChangeMeteringAssignmentStrategyUsingPATCHUnauthorized{} } -/*ChangeMeteringAssignmentStrategyUsingPATCHUnauthorized handles this case with default header values. +/* ChangeMeteringAssignmentStrategyUsingPATCHUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_parameters.go b/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_parameters.go index f2a4fd22..cc7182c1 100644 --- a/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_parameters.go +++ b/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateMeteringAssignmentStrategyUsingPOSTParams creates a new CreateMeteringAssignmentStrategyUsingPOSTParams object -// with the default values initialized. +// NewCreateMeteringAssignmentStrategyUsingPOSTParams creates a new CreateMeteringAssignmentStrategyUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateMeteringAssignmentStrategyUsingPOSTParams() *CreateMeteringAssignmentStrategyUsingPOSTParams { - var () return &CreateMeteringAssignmentStrategyUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithTimeout creates a new CreateMeteringAssignmentStrategyUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithTimeout(timeout time.Duration) *CreateMeteringAssignmentStrategyUsingPOSTParams { - var () return &CreateMeteringAssignmentStrategyUsingPOSTParams{ - timeout: timeout, } } // NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithContext creates a new CreateMeteringAssignmentStrategyUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithContext(ctx context.Context) *CreateMeteringAssignmentStrategyUsingPOSTParams { - var () return &CreateMeteringAssignmentStrategyUsingPOSTParams{ - Context: ctx, } } // NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithHTTPClient creates a new CreateMeteringAssignmentStrategyUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateMeteringAssignmentStrategyUsingPOSTParamsWithHTTPClient(client *http.Client) *CreateMeteringAssignmentStrategyUsingPOSTParams { - var () return &CreateMeteringAssignmentStrategyUsingPOSTParams{ HTTPClient: client, } } -/*CreateMeteringAssignmentStrategyUsingPOSTParams contains all the parameters to send to the API endpoint -for the create metering assignment strategy using p o s t operation typically these are written to a http.Request +/* CreateMeteringAssignmentStrategyUsingPOSTParams contains all the parameters to send to the API endpoint + for the create metering assignment strategy using p o s t operation. + + Typically these are written to a http.Request. */ type CreateMeteringAssignmentStrategyUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*MeteringAssignmentStrategy - The pricing card assignment strategy to be created + /* MeteringAssignmentStrategy. + + The pricing card assignment strategy to be created */ MeteringAssignmentStrategy *models.MeteringAssignmentStrategy @@ -78,6 +78,21 @@ type CreateMeteringAssignmentStrategyUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create metering assignment strategy using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMeteringAssignmentStrategyUsingPOSTParams) WithDefaults() *CreateMeteringAssignmentStrategyUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create metering assignment strategy using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMeteringAssignmentStrategyUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create metering assignment strategy using p o s t params func (o *CreateMeteringAssignmentStrategyUsingPOSTParams) WithTimeout(timeout time.Duration) *CreateMeteringAssignmentStrategyUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateMeteringAssignmentStrategyUsingPOSTParams) WriteToRequest(r runti // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.MeteringAssignmentStrategy != nil { if err := r.SetBodyParam(o.MeteringAssignmentStrategy); err != nil { return err diff --git a/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_responses.go b/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_responses.go index 00b2c2c6..0165a812 100644 --- a/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_responses.go +++ b/pkg/client/pricing_card_assignments/create_metering_assignment_strategy_using_post_responses.go @@ -47,7 +47,6 @@ func (o *CreateMeteringAssignmentStrategyUsingPOSTReader) ReadResponse(response return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateMeteringAssignmentStrategyUsingPOSTOK() *CreateMeteringAssignmentS return &CreateMeteringAssignmentStrategyUsingPOSTOK{} } -/*CreateMeteringAssignmentStrategyUsingPOSTOK handles this case with default header values. +/* CreateMeteringAssignmentStrategyUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type CreateMeteringAssignmentStrategyUsingPOSTOK struct { func (o *CreateMeteringAssignmentStrategyUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-card-assignments/strategy][%d] createMeteringAssignmentStrategyUsingPOSTOK %+v", 200, o.Payload) } - func (o *CreateMeteringAssignmentStrategyUsingPOSTOK) GetPayload() *models.MeteringAssignmentStrategy { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateMeteringAssignmentStrategyUsingPOSTCreated() *CreateMeteringAssign return &CreateMeteringAssignmentStrategyUsingPOSTCreated{} } -/*CreateMeteringAssignmentStrategyUsingPOSTCreated handles this case with default header values. +/* CreateMeteringAssignmentStrategyUsingPOSTCreated describes a response with status code 201, with default header values. Created */ @@ -102,7 +100,6 @@ type CreateMeteringAssignmentStrategyUsingPOSTCreated struct { func (o *CreateMeteringAssignmentStrategyUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-card-assignments/strategy][%d] createMeteringAssignmentStrategyUsingPOSTCreated %+v", 201, o.Payload) } - func (o *CreateMeteringAssignmentStrategyUsingPOSTCreated) GetPayload() *models.MeteringAssignmentStrategy { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateMeteringAssignmentStrategyUsingPOSTUnauthorized() *CreateMeteringA return &CreateMeteringAssignmentStrategyUsingPOSTUnauthorized{} } -/*CreateMeteringAssignmentStrategyUsingPOSTUnauthorized handles this case with default header values. +/* CreateMeteringAssignmentStrategyUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateMeteringAssignmentStrategyUsingPOSTForbidden() *CreateMeteringAssi return &CreateMeteringAssignmentStrategyUsingPOSTForbidden{} } -/*CreateMeteringAssignmentStrategyUsingPOSTForbidden handles this case with default header values. +/* CreateMeteringAssignmentStrategyUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_parameters.go b/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_parameters.go index e39e2b70..b5a71a05 100644 --- a/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_parameters.go +++ b/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateMeteringPolicyAssignmentUsingPOSTParams creates a new CreateMeteringPolicyAssignmentUsingPOSTParams object -// with the default values initialized. +// NewCreateMeteringPolicyAssignmentUsingPOSTParams creates a new CreateMeteringPolicyAssignmentUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateMeteringPolicyAssignmentUsingPOSTParams() *CreateMeteringPolicyAssignmentUsingPOSTParams { - var () return &CreateMeteringPolicyAssignmentUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithTimeout creates a new CreateMeteringPolicyAssignmentUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithTimeout(timeout time.Duration) *CreateMeteringPolicyAssignmentUsingPOSTParams { - var () return &CreateMeteringPolicyAssignmentUsingPOSTParams{ - timeout: timeout, } } // NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithContext creates a new CreateMeteringPolicyAssignmentUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithContext(ctx context.Context) *CreateMeteringPolicyAssignmentUsingPOSTParams { - var () return &CreateMeteringPolicyAssignmentUsingPOSTParams{ - Context: ctx, } } // NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithHTTPClient creates a new CreateMeteringPolicyAssignmentUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateMeteringPolicyAssignmentUsingPOSTParamsWithHTTPClient(client *http.Client) *CreateMeteringPolicyAssignmentUsingPOSTParams { - var () return &CreateMeteringPolicyAssignmentUsingPOSTParams{ HTTPClient: client, } } -/*CreateMeteringPolicyAssignmentUsingPOSTParams contains all the parameters to send to the API endpoint -for the create metering policy assignment using p o s t operation typically these are written to a http.Request +/* CreateMeteringPolicyAssignmentUsingPOSTParams contains all the parameters to send to the API endpoint + for the create metering policy assignment using p o s t operation. + + Typically these are written to a http.Request. */ type CreateMeteringPolicyAssignmentUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*MeteringPolicyAssignment - The pricing card assignment to be created + /* MeteringPolicyAssignment. + + The pricing card assignment to be created */ MeteringPolicyAssignment *models.MeteringPolicyAssignment @@ -78,6 +78,21 @@ type CreateMeteringPolicyAssignmentUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create metering policy assignment using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMeteringPolicyAssignmentUsingPOSTParams) WithDefaults() *CreateMeteringPolicyAssignmentUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create metering policy assignment using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMeteringPolicyAssignmentUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create metering policy assignment using p o s t params func (o *CreateMeteringPolicyAssignmentUsingPOSTParams) WithTimeout(timeout time.Duration) *CreateMeteringPolicyAssignmentUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateMeteringPolicyAssignmentUsingPOSTParams) WriteToRequest(r runtime // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.MeteringPolicyAssignment != nil { if err := r.SetBodyParam(o.MeteringPolicyAssignment); err != nil { return err diff --git a/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_responses.go b/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_responses.go index c607b10e..b19ddb50 100644 --- a/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_responses.go +++ b/pkg/client/pricing_card_assignments/create_metering_policy_assignment_using_post_responses.go @@ -47,7 +47,6 @@ func (o *CreateMeteringPolicyAssignmentUsingPOSTReader) ReadResponse(response ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateMeteringPolicyAssignmentUsingPOSTOK() *CreateMeteringPolicyAssignm return &CreateMeteringPolicyAssignmentUsingPOSTOK{} } -/*CreateMeteringPolicyAssignmentUsingPOSTOK handles this case with default header values. +/* CreateMeteringPolicyAssignmentUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type CreateMeteringPolicyAssignmentUsingPOSTOK struct { func (o *CreateMeteringPolicyAssignmentUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-card-assignments][%d] createMeteringPolicyAssignmentUsingPOSTOK %+v", 200, o.Payload) } - func (o *CreateMeteringPolicyAssignmentUsingPOSTOK) GetPayload() *models.MeteringPolicyAssignment { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateMeteringPolicyAssignmentUsingPOSTCreated() *CreateMeteringPolicyAs return &CreateMeteringPolicyAssignmentUsingPOSTCreated{} } -/*CreateMeteringPolicyAssignmentUsingPOSTCreated handles this case with default header values. +/* CreateMeteringPolicyAssignmentUsingPOSTCreated describes a response with status code 201, with default header values. Created */ @@ -102,7 +100,6 @@ type CreateMeteringPolicyAssignmentUsingPOSTCreated struct { func (o *CreateMeteringPolicyAssignmentUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-card-assignments][%d] createMeteringPolicyAssignmentUsingPOSTCreated %+v", 201, o.Payload) } - func (o *CreateMeteringPolicyAssignmentUsingPOSTCreated) GetPayload() *models.MeteringPolicyAssignment { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateMeteringPolicyAssignmentUsingPOSTUnauthorized() *CreateMeteringPol return &CreateMeteringPolicyAssignmentUsingPOSTUnauthorized{} } -/*CreateMeteringPolicyAssignmentUsingPOSTUnauthorized handles this case with default header values. +/* CreateMeteringPolicyAssignmentUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateMeteringPolicyAssignmentUsingPOSTForbidden() *CreateMeteringPolicy return &CreateMeteringPolicyAssignmentUsingPOSTForbidden{} } -/*CreateMeteringPolicyAssignmentUsingPOSTForbidden handles this case with default header values. +/* CreateMeteringPolicyAssignmentUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_parameters.go b/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_parameters.go index 4a835c49..faa47221 100644 --- a/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_parameters.go +++ b/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteMeteringPolicyAssignmentUsingDELETEParams creates a new DeleteMeteringPolicyAssignmentUsingDELETEParams object -// with the default values initialized. +// NewDeleteMeteringPolicyAssignmentUsingDELETEParams creates a new DeleteMeteringPolicyAssignmentUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteMeteringPolicyAssignmentUsingDELETEParams() *DeleteMeteringPolicyAssignmentUsingDELETEParams { - var () return &DeleteMeteringPolicyAssignmentUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithTimeout creates a new DeleteMeteringPolicyAssignmentUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteMeteringPolicyAssignmentUsingDELETEParams { - var () return &DeleteMeteringPolicyAssignmentUsingDELETEParams{ - timeout: timeout, } } // NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithContext creates a new DeleteMeteringPolicyAssignmentUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithContext(ctx context.Context) *DeleteMeteringPolicyAssignmentUsingDELETEParams { - var () return &DeleteMeteringPolicyAssignmentUsingDELETEParams{ - Context: ctx, } } // NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithHTTPClient creates a new DeleteMeteringPolicyAssignmentUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteMeteringPolicyAssignmentUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteMeteringPolicyAssignmentUsingDELETEParams { - var () return &DeleteMeteringPolicyAssignmentUsingDELETEParams{ HTTPClient: client, } } -/*DeleteMeteringPolicyAssignmentUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete metering policy assignment using d e l e t e operation typically these are written to a http.Request +/* DeleteMeteringPolicyAssignmentUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete metering policy assignment using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteMeteringPolicyAssignmentUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card Assignment Id + /* ID. + + pricing card Assignment Id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeleteMeteringPolicyAssignmentUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete metering policy assignment using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMeteringPolicyAssignmentUsingDELETEParams) WithDefaults() *DeleteMeteringPolicyAssignmentUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete metering policy assignment using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMeteringPolicyAssignmentUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete metering policy assignment using d e l e t e params func (o *DeleteMeteringPolicyAssignmentUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteMeteringPolicyAssignmentUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeleteMeteringPolicyAssignmentUsingDELETEParams) WriteToRequest(r runti // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_responses.go b/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_responses.go index 292b4c9b..8e8500ff 100644 --- a/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_responses.go +++ b/pkg/client/pricing_card_assignments/delete_metering_policy_assignment_using_delete_responses.go @@ -41,7 +41,6 @@ func (o *DeleteMeteringPolicyAssignmentUsingDELETEReader) ReadResponse(response return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewDeleteMeteringPolicyAssignmentUsingDELETEOK() *DeleteMeteringPolicyAssig return &DeleteMeteringPolicyAssignmentUsingDELETEOK{} } -/*DeleteMeteringPolicyAssignmentUsingDELETEOK handles this case with default header values. +/* DeleteMeteringPolicyAssignmentUsingDELETEOK describes a response with status code 200, with default header values. No Content */ @@ -73,7 +72,7 @@ func NewDeleteMeteringPolicyAssignmentUsingDELETEUnauthorized() *DeleteMeteringP return &DeleteMeteringPolicyAssignmentUsingDELETEUnauthorized{} } -/*DeleteMeteringPolicyAssignmentUsingDELETEUnauthorized handles this case with default header values. +/* DeleteMeteringPolicyAssignmentUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -94,7 +93,7 @@ func NewDeleteMeteringPolicyAssignmentUsingDELETENotFound() *DeleteMeteringPolic return &DeleteMeteringPolicyAssignmentUsingDELETENotFound{} } -/*DeleteMeteringPolicyAssignmentUsingDELETENotFound handles this case with default header values. +/* DeleteMeteringPolicyAssignmentUsingDELETENotFound describes a response with status code 404, with default header values. Not Found */ @@ -105,7 +104,6 @@ type DeleteMeteringPolicyAssignmentUsingDELETENotFound struct { func (o *DeleteMeteringPolicyAssignmentUsingDELETENotFound) Error() string { return fmt.Sprintf("[DELETE /price/api/private/pricing-card-assignments/{id}][%d] deleteMeteringPolicyAssignmentUsingDELETENotFound %+v", 404, o.Payload) } - func (o *DeleteMeteringPolicyAssignmentUsingDELETENotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_parameters.go b/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_parameters.go index b1c605bb..cfc0ab62 100644 --- a/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_parameters.go +++ b/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_parameters.go @@ -17,85 +17,82 @@ import ( "github.com/go-openapi/swag" ) -// NewGetAllMeteringPolicyAssignmentsUsingGETParams creates a new GetAllMeteringPolicyAssignmentsUsingGETParams object -// with the default values initialized. +// NewGetAllMeteringPolicyAssignmentsUsingGETParams creates a new GetAllMeteringPolicyAssignmentsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAllMeteringPolicyAssignmentsUsingGETParams() *GetAllMeteringPolicyAssignmentsUsingGETParams { - var ( - refreshEntitiesDefault = bool(true) - ) return &GetAllMeteringPolicyAssignmentsUsingGETParams{ - RefreshEntities: &refreshEntitiesDefault, - timeout: cr.DefaultTimeout, } } // NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithTimeout creates a new GetAllMeteringPolicyAssignmentsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithTimeout(timeout time.Duration) *GetAllMeteringPolicyAssignmentsUsingGETParams { - var ( - refreshEntitiesDefault = bool(true) - ) return &GetAllMeteringPolicyAssignmentsUsingGETParams{ - RefreshEntities: &refreshEntitiesDefault, - timeout: timeout, } } // NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithContext creates a new GetAllMeteringPolicyAssignmentsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithContext(ctx context.Context) *GetAllMeteringPolicyAssignmentsUsingGETParams { - var ( - refreshEntitiesDefault = bool(true) - ) return &GetAllMeteringPolicyAssignmentsUsingGETParams{ - RefreshEntities: &refreshEntitiesDefault, - Context: ctx, } } // NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithHTTPClient creates a new GetAllMeteringPolicyAssignmentsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAllMeteringPolicyAssignmentsUsingGETParamsWithHTTPClient(client *http.Client) *GetAllMeteringPolicyAssignmentsUsingGETParams { - var ( - refreshEntitiesDefault = bool(true) - ) return &GetAllMeteringPolicyAssignmentsUsingGETParams{ - RefreshEntities: &refreshEntitiesDefault, - HTTPClient: client, + HTTPClient: client, } } -/*GetAllMeteringPolicyAssignmentsUsingGETParams contains all the parameters to send to the API endpoint -for the get all metering policy assignments using g e t operation typically these are written to a http.Request +/* GetAllMeteringPolicyAssignmentsUsingGETParams contains all the parameters to send to the API endpoint + for the get all metering policy assignments using g e t operation. + + Typically these are written to a http.Request. */ type GetAllMeteringPolicyAssignmentsUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*RefreshEntities - Search by name and description + /* RefreshEntities. + + Search by name and description + + Default: true */ RefreshEntities *bool @@ -104,6 +101,32 @@ type GetAllMeteringPolicyAssignmentsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get all metering policy assignments using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) WithDefaults() *GetAllMeteringPolicyAssignmentsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get all metering policy assignments using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) SetDefaults() { + var ( + refreshEntitiesDefault = bool(true) + ) + + val := GetAllMeteringPolicyAssignmentsUsingGETParams{ + RefreshEntities: &refreshEntitiesDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the get all metering policy assignments using get params func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) WithTimeout(timeout time.Duration) *GetAllMeteringPolicyAssignmentsUsingGETParams { o.SetTimeout(timeout) @@ -200,76 +223,83 @@ func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) WriteToRequest(r runtime } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.RefreshEntities != nil { // query param refreshEntities var qrRefreshEntities bool + if o.RefreshEntities != nil { qrRefreshEntities = *o.RefreshEntities } qRefreshEntities := swag.FormatBool(qrRefreshEntities) if qRefreshEntities != "" { + if err := r.SetQueryParam("refreshEntities", qRefreshEntities); err != nil { return err } } - } if len(res) > 0 { @@ -277,3 +307,20 @@ func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) WriteToRequest(r runtime } return nil } + +// bindParamGetAllMeteringPolicyAssignmentsUsingGET binds the parameter $orderby +func (o *GetAllMeteringPolicyAssignmentsUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_responses.go b/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_responses.go index d7dadd42..2c668c30 100644 --- a/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_responses.go +++ b/pkg/client/pricing_card_assignments/get_all_metering_policy_assignments_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetAllMeteringPolicyAssignmentsUsingGETReader) ReadResponse(response ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAllMeteringPolicyAssignmentsUsingGETOK() *GetAllMeteringPolicyAssignm return &GetAllMeteringPolicyAssignmentsUsingGETOK{} } -/*GetAllMeteringPolicyAssignmentsUsingGETOK handles this case with default header values. +/* GetAllMeteringPolicyAssignmentsUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetAllMeteringPolicyAssignmentsUsingGETOK struct { func (o *GetAllMeteringPolicyAssignmentsUsingGETOK) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-card-assignments][%d] getAllMeteringPolicyAssignmentsUsingGETOK %+v", 200, o.Payload) } - func (o *GetAllMeteringPolicyAssignmentsUsingGETOK) GetPayload() *models.PageOfMeteringPolicyAssignment { return o.Payload } @@ -79,7 +77,7 @@ func NewGetAllMeteringPolicyAssignmentsUsingGETUnauthorized() *GetAllMeteringPol return &GetAllMeteringPolicyAssignmentsUsingGETUnauthorized{} } -/*GetAllMeteringPolicyAssignmentsUsingGETUnauthorized handles this case with default header values. +/* GetAllMeteringPolicyAssignmentsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_parameters.go b/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_parameters.go index e29d31de..26838e24 100644 --- a/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_parameters.go +++ b/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMeteringAssignmentStrategyUsingGETParams creates a new GetMeteringAssignmentStrategyUsingGETParams object -// with the default values initialized. +// NewGetMeteringAssignmentStrategyUsingGETParams creates a new GetMeteringAssignmentStrategyUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMeteringAssignmentStrategyUsingGETParams() *GetMeteringAssignmentStrategyUsingGETParams { - var () return &GetMeteringAssignmentStrategyUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetMeteringAssignmentStrategyUsingGETParamsWithTimeout creates a new GetMeteringAssignmentStrategyUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMeteringAssignmentStrategyUsingGETParamsWithTimeout(timeout time.Duration) *GetMeteringAssignmentStrategyUsingGETParams { - var () return &GetMeteringAssignmentStrategyUsingGETParams{ - timeout: timeout, } } // NewGetMeteringAssignmentStrategyUsingGETParamsWithContext creates a new GetMeteringAssignmentStrategyUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMeteringAssignmentStrategyUsingGETParamsWithContext(ctx context.Context) *GetMeteringAssignmentStrategyUsingGETParams { - var () return &GetMeteringAssignmentStrategyUsingGETParams{ - Context: ctx, } } // NewGetMeteringAssignmentStrategyUsingGETParamsWithHTTPClient creates a new GetMeteringAssignmentStrategyUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMeteringAssignmentStrategyUsingGETParamsWithHTTPClient(client *http.Client) *GetMeteringAssignmentStrategyUsingGETParams { - var () return &GetMeteringAssignmentStrategyUsingGETParams{ HTTPClient: client, } } -/*GetMeteringAssignmentStrategyUsingGETParams contains all the parameters to send to the API endpoint -for the get metering assignment strategy using g e t operation typically these are written to a http.Request +/* GetMeteringAssignmentStrategyUsingGETParams contains all the parameters to send to the API endpoint + for the get metering assignment strategy using g e t operation. + + Typically these are written to a http.Request. */ type GetMeteringAssignmentStrategyUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string @@ -71,6 +70,21 @@ type GetMeteringAssignmentStrategyUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get metering assignment strategy using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeteringAssignmentStrategyUsingGETParams) WithDefaults() *GetMeteringAssignmentStrategyUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get metering assignment strategy using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeteringAssignmentStrategyUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get metering assignment strategy using get params func (o *GetMeteringAssignmentStrategyUsingGETParams) WithTimeout(timeout time.Duration) *GetMeteringAssignmentStrategyUsingGETParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetMeteringAssignmentStrategyUsingGETParams) WriteToRequest(r runtime.C // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_responses.go b/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_responses.go index cf8a5d28..4038eee1 100644 --- a/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_responses.go +++ b/pkg/client/pricing_card_assignments/get_metering_assignment_strategy_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetMeteringAssignmentStrategyUsingGETReader) ReadResponse(response runt return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMeteringAssignmentStrategyUsingGETOK() *GetMeteringAssignmentStrategy return &GetMeteringAssignmentStrategyUsingGETOK{} } -/*GetMeteringAssignmentStrategyUsingGETOK handles this case with default header values. +/* GetMeteringAssignmentStrategyUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetMeteringAssignmentStrategyUsingGETOK struct { func (o *GetMeteringAssignmentStrategyUsingGETOK) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-card-assignments/strategy][%d] getMeteringAssignmentStrategyUsingGETOK %+v", 200, o.Payload) } - func (o *GetMeteringAssignmentStrategyUsingGETOK) GetPayload() *models.MeteringAssignmentStrategy { return o.Payload } @@ -85,7 +83,7 @@ func NewGetMeteringAssignmentStrategyUsingGETUnauthorized() *GetMeteringAssignme return &GetMeteringAssignmentStrategyUsingGETUnauthorized{} } -/*GetMeteringAssignmentStrategyUsingGETUnauthorized handles this case with default header values. +/* GetMeteringAssignmentStrategyUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetMeteringAssignmentStrategyUsingGETNotFound() *GetMeteringAssignmentSt return &GetMeteringAssignmentStrategyUsingGETNotFound{} } -/*GetMeteringAssignmentStrategyUsingGETNotFound handles this case with default header values. +/* GetMeteringAssignmentStrategyUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetMeteringAssignmentStrategyUsingGETNotFound struct { func (o *GetMeteringAssignmentStrategyUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-card-assignments/strategy][%d] getMeteringAssignmentStrategyUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetMeteringAssignmentStrategyUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_parameters.go b/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_parameters.go index 513d11e5..d4561ff7 100644 --- a/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_parameters.go +++ b/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetMeteringPolicyAssignmentUsingGETParams creates a new GetMeteringPolicyAssignmentUsingGETParams object -// with the default values initialized. +// NewGetMeteringPolicyAssignmentUsingGETParams creates a new GetMeteringPolicyAssignmentUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetMeteringPolicyAssignmentUsingGETParams() *GetMeteringPolicyAssignmentUsingGETParams { - var () return &GetMeteringPolicyAssignmentUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetMeteringPolicyAssignmentUsingGETParamsWithTimeout creates a new GetMeteringPolicyAssignmentUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetMeteringPolicyAssignmentUsingGETParamsWithTimeout(timeout time.Duration) *GetMeteringPolicyAssignmentUsingGETParams { - var () return &GetMeteringPolicyAssignmentUsingGETParams{ - timeout: timeout, } } // NewGetMeteringPolicyAssignmentUsingGETParamsWithContext creates a new GetMeteringPolicyAssignmentUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetMeteringPolicyAssignmentUsingGETParamsWithContext(ctx context.Context) *GetMeteringPolicyAssignmentUsingGETParams { - var () return &GetMeteringPolicyAssignmentUsingGETParams{ - Context: ctx, } } // NewGetMeteringPolicyAssignmentUsingGETParamsWithHTTPClient creates a new GetMeteringPolicyAssignmentUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetMeteringPolicyAssignmentUsingGETParamsWithHTTPClient(client *http.Client) *GetMeteringPolicyAssignmentUsingGETParams { - var () return &GetMeteringPolicyAssignmentUsingGETParams{ HTTPClient: client, } } -/*GetMeteringPolicyAssignmentUsingGETParams contains all the parameters to send to the API endpoint -for the get metering policy assignment using g e t operation typically these are written to a http.Request +/* GetMeteringPolicyAssignmentUsingGETParams contains all the parameters to send to the API endpoint + for the get metering policy assignment using g e t operation. + + Typically these are written to a http.Request. */ type GetMeteringPolicyAssignmentUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card assignment id + /* ID. + + pricing card assignment id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetMeteringPolicyAssignmentUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get metering policy assignment using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeteringPolicyAssignmentUsingGETParams) WithDefaults() *GetMeteringPolicyAssignmentUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get metering policy assignment using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeteringPolicyAssignmentUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get metering policy assignment using get params func (o *GetMeteringPolicyAssignmentUsingGETParams) WithTimeout(timeout time.Duration) *GetMeteringPolicyAssignmentUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetMeteringPolicyAssignmentUsingGETParams) WriteToRequest(r runtime.Cli // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_responses.go b/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_responses.go index b0f6df9b..c6cbcf48 100644 --- a/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_responses.go +++ b/pkg/client/pricing_card_assignments/get_metering_policy_assignment_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetMeteringPolicyAssignmentUsingGETReader) ReadResponse(response runtim return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetMeteringPolicyAssignmentUsingGETOK() *GetMeteringPolicyAssignmentUsin return &GetMeteringPolicyAssignmentUsingGETOK{} } -/*GetMeteringPolicyAssignmentUsingGETOK handles this case with default header values. +/* GetMeteringPolicyAssignmentUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetMeteringPolicyAssignmentUsingGETOK struct { func (o *GetMeteringPolicyAssignmentUsingGETOK) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-card-assignments/{id}][%d] getMeteringPolicyAssignmentUsingGETOK %+v", 200, o.Payload) } - func (o *GetMeteringPolicyAssignmentUsingGETOK) GetPayload() *models.MeteringPolicyAssignment { return o.Payload } @@ -85,7 +83,7 @@ func NewGetMeteringPolicyAssignmentUsingGETUnauthorized() *GetMeteringPolicyAssi return &GetMeteringPolicyAssignmentUsingGETUnauthorized{} } -/*GetMeteringPolicyAssignmentUsingGETUnauthorized handles this case with default header values. +/* GetMeteringPolicyAssignmentUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetMeteringPolicyAssignmentUsingGETNotFound() *GetMeteringPolicyAssignme return &GetMeteringPolicyAssignmentUsingGETNotFound{} } -/*GetMeteringPolicyAssignmentUsingGETNotFound handles this case with default header values. +/* GetMeteringPolicyAssignmentUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetMeteringPolicyAssignmentUsingGETNotFound struct { func (o *GetMeteringPolicyAssignmentUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-card-assignments/{id}][%d] getMeteringPolicyAssignmentUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetMeteringPolicyAssignmentUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_parameters.go b/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_parameters.go index a87831fb..f23ab24c 100644 --- a/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_parameters.go +++ b/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewPatchMeteringPolicyAssignmentUsingPATCHParams creates a new PatchMeteringPolicyAssignmentUsingPATCHParams object -// with the default values initialized. +// NewPatchMeteringPolicyAssignmentUsingPATCHParams creates a new PatchMeteringPolicyAssignmentUsingPATCHParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPatchMeteringPolicyAssignmentUsingPATCHParams() *PatchMeteringPolicyAssignmentUsingPATCHParams { - var () return &PatchMeteringPolicyAssignmentUsingPATCHParams{ - timeout: cr.DefaultTimeout, } } // NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithTimeout creates a new PatchMeteringPolicyAssignmentUsingPATCHParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithTimeout(timeout time.Duration) *PatchMeteringPolicyAssignmentUsingPATCHParams { - var () return &PatchMeteringPolicyAssignmentUsingPATCHParams{ - timeout: timeout, } } // NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithContext creates a new PatchMeteringPolicyAssignmentUsingPATCHParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithContext(ctx context.Context) *PatchMeteringPolicyAssignmentUsingPATCHParams { - var () return &PatchMeteringPolicyAssignmentUsingPATCHParams{ - Context: ctx, } } // NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithHTTPClient creates a new PatchMeteringPolicyAssignmentUsingPATCHParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchMeteringPolicyAssignmentUsingPATCHParamsWithHTTPClient(client *http.Client) *PatchMeteringPolicyAssignmentUsingPATCHParams { - var () return &PatchMeteringPolicyAssignmentUsingPATCHParams{ HTTPClient: client, } } -/*PatchMeteringPolicyAssignmentUsingPATCHParams contains all the parameters to send to the API endpoint -for the patch metering policy assignment using p a t c h operation typically these are written to a http.Request +/* PatchMeteringPolicyAssignmentUsingPATCHParams contains all the parameters to send to the API endpoint + for the patch metering policy assignment using p a t c h operation. + + Typically these are written to a http.Request. */ type PatchMeteringPolicyAssignmentUsingPATCHParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card Assignment Id + /* ID. + + pricing card Assignment Id + + Format: uuid */ ID strfmt.UUID - /*MeteringPolicyAssignment - A pricing card assignment with pricing card Id to override existing pricing card Id + /* MeteringPolicyAssignment. + + A pricing card assignment with pricing card Id to override existing pricing card Id */ MeteringPolicyAssignment *models.MeteringPolicyAssignment @@ -83,6 +86,21 @@ type PatchMeteringPolicyAssignmentUsingPATCHParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the patch metering policy assignment using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchMeteringPolicyAssignmentUsingPATCHParams) WithDefaults() *PatchMeteringPolicyAssignmentUsingPATCHParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch metering policy assignment using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchMeteringPolicyAssignmentUsingPATCHParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the patch metering policy assignment using p a t c h params func (o *PatchMeteringPolicyAssignmentUsingPATCHParams) WithTimeout(timeout time.Duration) *PatchMeteringPolicyAssignmentUsingPATCHParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *PatchMeteringPolicyAssignmentUsingPATCHParams) WriteToRequest(r runtime // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id if err := r.SetPathParam("id", o.ID.String()); err != nil { return err } - if o.MeteringPolicyAssignment != nil { if err := r.SetBodyParam(o.MeteringPolicyAssignment); err != nil { return err diff --git a/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_responses.go b/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_responses.go index b11234b3..2ffa305d 100644 --- a/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_responses.go +++ b/pkg/client/pricing_card_assignments/patch_metering_policy_assignment_using_patch_responses.go @@ -35,7 +35,6 @@ func (o *PatchMeteringPolicyAssignmentUsingPATCHReader) ReadResponse(response ru return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewPatchMeteringPolicyAssignmentUsingPATCHOK() *PatchMeteringPolicyAssignme return &PatchMeteringPolicyAssignmentUsingPATCHOK{} } -/*PatchMeteringPolicyAssignmentUsingPATCHOK handles this case with default header values. +/* PatchMeteringPolicyAssignmentUsingPATCHOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type PatchMeteringPolicyAssignmentUsingPATCHOK struct { func (o *PatchMeteringPolicyAssignmentUsingPATCHOK) Error() string { return fmt.Sprintf("[PATCH /price/api/private/pricing-card-assignments/{id}][%d] patchMeteringPolicyAssignmentUsingPATCHOK %+v", 200, o.Payload) } - func (o *PatchMeteringPolicyAssignmentUsingPATCHOK) GetPayload() *models.MeteringPolicyAssignment { return o.Payload } @@ -79,7 +77,7 @@ func NewPatchMeteringPolicyAssignmentUsingPATCHUnauthorized() *PatchMeteringPoli return &PatchMeteringPolicyAssignmentUsingPATCHUnauthorized{} } -/*PatchMeteringPolicyAssignmentUsingPATCHUnauthorized handles this case with default header values. +/* PatchMeteringPolicyAssignmentUsingPATCHUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/pricing_card_assignments/pricing_card_assignments_client.go b/pkg/client/pricing_card_assignments/pricing_card_assignments_client.go index cd7d8453..44167a92 100644 --- a/pkg/client/pricing_card_assignments/pricing_card_assignments_client.go +++ b/pkg/client/pricing_card_assignments/pricing_card_assignments_client.go @@ -25,23 +25,26 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteringAssignmentStrategyUsingPATCHParams) (*ChangeMeteringAssignmentStrategyUsingPATCHOK, error) + ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteringAssignmentStrategyUsingPATCHParams, opts ...ClientOption) (*ChangeMeteringAssignmentStrategyUsingPATCHOK, error) - CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeteringAssignmentStrategyUsingPOSTParams) (*CreateMeteringAssignmentStrategyUsingPOSTOK, *CreateMeteringAssignmentStrategyUsingPOSTCreated, error) + CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeteringAssignmentStrategyUsingPOSTParams, opts ...ClientOption) (*CreateMeteringAssignmentStrategyUsingPOSTOK, *CreateMeteringAssignmentStrategyUsingPOSTCreated, error) - CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringPolicyAssignmentUsingPOSTParams) (*CreateMeteringPolicyAssignmentUsingPOSTOK, *CreateMeteringPolicyAssignmentUsingPOSTCreated, error) + CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringPolicyAssignmentUsingPOSTParams, opts ...ClientOption) (*CreateMeteringPolicyAssignmentUsingPOSTOK, *CreateMeteringPolicyAssignmentUsingPOSTCreated, error) - DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeteringPolicyAssignmentUsingDELETEParams) (*DeleteMeteringPolicyAssignmentUsingDELETEOK, error) + DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeteringPolicyAssignmentUsingDELETEParams, opts ...ClientOption) (*DeleteMeteringPolicyAssignmentUsingDELETEOK, error) - GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringPolicyAssignmentsUsingGETParams) (*GetAllMeteringPolicyAssignmentsUsingGETOK, error) + GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringPolicyAssignmentsUsingGETParams, opts ...ClientOption) (*GetAllMeteringPolicyAssignmentsUsingGETOK, error) - GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssignmentStrategyUsingGETParams) (*GetMeteringAssignmentStrategyUsingGETOK, error) + GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssignmentStrategyUsingGETParams, opts ...ClientOption) (*GetMeteringAssignmentStrategyUsingGETOK, error) - GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAssignmentUsingGETParams) (*GetMeteringPolicyAssignmentUsingGETOK, error) + GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAssignmentUsingGETParams, opts ...ClientOption) (*GetMeteringPolicyAssignmentUsingGETOK, error) - PatchMeteringPolicyAssignmentUsingPATCH(params *PatchMeteringPolicyAssignmentUsingPATCHParams) (*PatchMeteringPolicyAssignmentUsingPATCHOK, error) + PatchMeteringPolicyAssignmentUsingPATCH(params *PatchMeteringPolicyAssignmentUsingPATCHParams, opts ...ClientOption) (*PatchMeteringPolicyAssignmentUsingPATCHOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { /* ChangeMeteringAssignmentStrategyUsingPATCH updates the pricing card assignment strategy for the org */ -func (a *Client) ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteringAssignmentStrategyUsingPATCHParams) (*ChangeMeteringAssignmentStrategyUsingPATCHOK, error) { +func (a *Client) ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteringAssignmentStrategyUsingPATCHParams, opts ...ClientOption) (*ChangeMeteringAssignmentStrategyUsingPATCHOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeMeteringAssignmentStrategyUsingPATCHParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "changeMeteringAssignmentStrategyUsingPATCH", Method: "PATCH", PathPattern: "/price/api/private/pricing-card-assignments/strategy", @@ -66,7 +68,12 @@ func (a *Client) ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteri Reader: &ChangeMeteringAssignmentStrategyUsingPATCHReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) ChangeMeteringAssignmentStrategyUsingPATCH(params *ChangeMeteri Create a new pricing card assignment strategy based on request body and validate its field according to business rules. */ -func (a *Client) CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeteringAssignmentStrategyUsingPOSTParams) (*CreateMeteringAssignmentStrategyUsingPOSTOK, *CreateMeteringAssignmentStrategyUsingPOSTCreated, error) { +func (a *Client) CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeteringAssignmentStrategyUsingPOSTParams, opts ...ClientOption) (*CreateMeteringAssignmentStrategyUsingPOSTOK, *CreateMeteringAssignmentStrategyUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateMeteringAssignmentStrategyUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createMeteringAssignmentStrategyUsingPOST", Method: "POST", PathPattern: "/price/api/private/pricing-card-assignments/strategy", @@ -102,7 +108,12 @@ func (a *Client) CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeterin Reader: &CreateMeteringAssignmentStrategyUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -122,13 +133,12 @@ func (a *Client) CreateMeteringAssignmentStrategyUsingPOST(params *CreateMeterin Create a new pricing card policy assignment based on request body and validate its field according to business rules. Request body with ALL entityType will delete the older assignments for the given pricingCardId */ -func (a *Client) CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringPolicyAssignmentUsingPOSTParams) (*CreateMeteringPolicyAssignmentUsingPOSTOK, *CreateMeteringPolicyAssignmentUsingPOSTCreated, error) { +func (a *Client) CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringPolicyAssignmentUsingPOSTParams, opts ...ClientOption) (*CreateMeteringPolicyAssignmentUsingPOSTOK, *CreateMeteringPolicyAssignmentUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateMeteringPolicyAssignmentUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createMeteringPolicyAssignmentUsingPOST", Method: "POST", PathPattern: "/price/api/private/pricing-card-assignments", @@ -139,7 +149,12 @@ func (a *Client) CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringP Reader: &CreateMeteringPolicyAssignmentUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -159,13 +174,12 @@ func (a *Client) CreateMeteringPolicyAssignmentUsingPOST(params *CreateMeteringP Deletes the pricing card assignment with the specified id */ -func (a *Client) DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeteringPolicyAssignmentUsingDELETEParams) (*DeleteMeteringPolicyAssignmentUsingDELETEOK, error) { +func (a *Client) DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeteringPolicyAssignmentUsingDELETEParams, opts ...ClientOption) (*DeleteMeteringPolicyAssignmentUsingDELETEOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteMeteringPolicyAssignmentUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteMeteringPolicyAssignmentUsingDELETE", Method: "DELETE", PathPattern: "/price/api/private/pricing-card-assignments/{id}", @@ -176,7 +190,12 @@ func (a *Client) DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeterin Reader: &DeleteMeteringPolicyAssignmentUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -195,13 +214,12 @@ func (a *Client) DeleteMeteringPolicyAssignmentUsingDELETE(params *DeleteMeterin Returns a paginated list of pricing card assignments */ -func (a *Client) GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringPolicyAssignmentsUsingGETParams) (*GetAllMeteringPolicyAssignmentsUsingGETOK, error) { +func (a *Client) GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringPolicyAssignmentsUsingGETParams, opts ...ClientOption) (*GetAllMeteringPolicyAssignmentsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAllMeteringPolicyAssignmentsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAllMeteringPolicyAssignmentsUsingGET", Method: "GET", PathPattern: "/price/api/private/pricing-card-assignments", @@ -212,7 +230,12 @@ func (a *Client) GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringP Reader: &GetAllMeteringPolicyAssignmentsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -231,13 +254,12 @@ func (a *Client) GetAllMeteringPolicyAssignmentsUsingGET(params *GetAllMeteringP Returns a pricing card assignment strategy for the Org */ -func (a *Client) GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssignmentStrategyUsingGETParams) (*GetMeteringAssignmentStrategyUsingGETOK, error) { +func (a *Client) GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssignmentStrategyUsingGETParams, opts ...ClientOption) (*GetMeteringAssignmentStrategyUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMeteringAssignmentStrategyUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMeteringAssignmentStrategyUsingGET", Method: "GET", PathPattern: "/price/api/private/pricing-card-assignments/strategy", @@ -248,7 +270,12 @@ func (a *Client) GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssign Reader: &GetMeteringAssignmentStrategyUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -267,13 +294,12 @@ func (a *Client) GetMeteringAssignmentStrategyUsingGET(params *GetMeteringAssign Returns a pricing card assignments by id */ -func (a *Client) GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAssignmentUsingGETParams) (*GetMeteringPolicyAssignmentUsingGETOK, error) { +func (a *Client) GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAssignmentUsingGETParams, opts ...ClientOption) (*GetMeteringPolicyAssignmentUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetMeteringPolicyAssignmentUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getMeteringPolicyAssignmentUsingGET", Method: "GET", PathPattern: "/price/api/private/pricing-card-assignments/{id}", @@ -284,7 +310,12 @@ func (a *Client) GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAs Reader: &GetMeteringPolicyAssignmentUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -301,13 +332,12 @@ func (a *Client) GetMeteringPolicyAssignmentUsingGET(params *GetMeteringPolicyAs /* PatchMeteringPolicyAssignmentUsingPATCH updates the pricing card assignment id with the supplied id request body with a l l entity type will delete the older assignments for the given pricing card Id */ -func (a *Client) PatchMeteringPolicyAssignmentUsingPATCH(params *PatchMeteringPolicyAssignmentUsingPATCHParams) (*PatchMeteringPolicyAssignmentUsingPATCHOK, error) { +func (a *Client) PatchMeteringPolicyAssignmentUsingPATCH(params *PatchMeteringPolicyAssignmentUsingPATCHParams, opts ...ClientOption) (*PatchMeteringPolicyAssignmentUsingPATCHOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchMeteringPolicyAssignmentUsingPATCHParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchMeteringPolicyAssignmentUsingPATCH", Method: "PATCH", PathPattern: "/price/api/private/pricing-card-assignments/{id}", @@ -318,7 +348,12 @@ func (a *Client) PatchMeteringPolicyAssignmentUsingPATCH(params *PatchMeteringPo Reader: &PatchMeteringPolicyAssignmentUsingPATCHReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/pricing_cards/create_policy_using_post_parameters.go b/pkg/client/pricing_cards/create_policy_using_post_parameters.go index 2cb3ab8c..bb1682d0 100644 --- a/pkg/client/pricing_cards/create_policy_using_post_parameters.go +++ b/pkg/client/pricing_cards/create_policy_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreatePolicyUsingPOSTParams creates a new CreatePolicyUsingPOSTParams object -// with the default values initialized. +// NewCreatePolicyUsingPOSTParams creates a new CreatePolicyUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreatePolicyUsingPOSTParams() *CreatePolicyUsingPOSTParams { - var () return &CreatePolicyUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePolicyUsingPOSTParamsWithTimeout creates a new CreatePolicyUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePolicyUsingPOSTParamsWithTimeout(timeout time.Duration) *CreatePolicyUsingPOSTParams { - var () return &CreatePolicyUsingPOSTParams{ - timeout: timeout, } } // NewCreatePolicyUsingPOSTParamsWithContext creates a new CreatePolicyUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePolicyUsingPOSTParamsWithContext(ctx context.Context) *CreatePolicyUsingPOSTParams { - var () return &CreatePolicyUsingPOSTParams{ - Context: ctx, } } // NewCreatePolicyUsingPOSTParamsWithHTTPClient creates a new CreatePolicyUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePolicyUsingPOSTParamsWithHTTPClient(client *http.Client) *CreatePolicyUsingPOSTParams { - var () return &CreatePolicyUsingPOSTParams{ HTTPClient: client, } } -/*CreatePolicyUsingPOSTParams contains all the parameters to send to the API endpoint -for the create policy using p o s t operation typically these are written to a http.Request +/* CreatePolicyUsingPOSTParams contains all the parameters to send to the API endpoint + for the create policy using p o s t operation. + + Typically these are written to a http.Request. */ type CreatePolicyUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*MeteringPolicy - The pricing card to be created + /* MeteringPolicy. + + The pricing card to be created */ MeteringPolicy *models.MeteringPolicy @@ -78,6 +78,21 @@ type CreatePolicyUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create policy using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePolicyUsingPOSTParams) WithDefaults() *CreatePolicyUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create policy using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePolicyUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create policy using p o s t params func (o *CreatePolicyUsingPOSTParams) WithTimeout(timeout time.Duration) *CreatePolicyUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreatePolicyUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.MeteringPolicy != nil { if err := r.SetBodyParam(o.MeteringPolicy); err != nil { return err diff --git a/pkg/client/pricing_cards/create_policy_using_post_responses.go b/pkg/client/pricing_cards/create_policy_using_post_responses.go index 28b29f91..b14ad562 100644 --- a/pkg/client/pricing_cards/create_policy_using_post_responses.go +++ b/pkg/client/pricing_cards/create_policy_using_post_responses.go @@ -41,7 +41,6 @@ func (o *CreatePolicyUsingPOSTReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreatePolicyUsingPOSTOK() *CreatePolicyUsingPOSTOK { return &CreatePolicyUsingPOSTOK{} } -/*CreatePolicyUsingPOSTOK handles this case with default header values. +/* CreatePolicyUsingPOSTOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type CreatePolicyUsingPOSTOK struct { func (o *CreatePolicyUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-cards][%d] createPolicyUsingPOSTOK %+v", 200, o.Payload) } - func (o *CreatePolicyUsingPOSTOK) GetPayload() *models.MeteringPolicy { return o.Payload } @@ -85,7 +83,7 @@ func NewCreatePolicyUsingPOSTCreated() *CreatePolicyUsingPOSTCreated { return &CreatePolicyUsingPOSTCreated{} } -/*CreatePolicyUsingPOSTCreated handles this case with default header values. +/* CreatePolicyUsingPOSTCreated describes a response with status code 201, with default header values. Created */ @@ -96,7 +94,6 @@ type CreatePolicyUsingPOSTCreated struct { func (o *CreatePolicyUsingPOSTCreated) Error() string { return fmt.Sprintf("[POST /price/api/private/pricing-cards][%d] createPolicyUsingPOSTCreated %+v", 201, o.Payload) } - func (o *CreatePolicyUsingPOSTCreated) GetPayload() *models.MeteringPolicy { return o.Payload } @@ -118,7 +115,7 @@ func NewCreatePolicyUsingPOSTUnauthorized() *CreatePolicyUsingPOSTUnauthorized { return &CreatePolicyUsingPOSTUnauthorized{} } -/*CreatePolicyUsingPOSTUnauthorized handles this case with default header values. +/* CreatePolicyUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/pricing_cards/delete_policy_using_delete_parameters.go b/pkg/client/pricing_cards/delete_policy_using_delete_parameters.go index f548d3de..6c17eda2 100644 --- a/pkg/client/pricing_cards/delete_policy_using_delete_parameters.go +++ b/pkg/client/pricing_cards/delete_policy_using_delete_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeletePolicyUsingDELETEParams creates a new DeletePolicyUsingDELETEParams object -// with the default values initialized. +// NewDeletePolicyUsingDELETEParams creates a new DeletePolicyUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeletePolicyUsingDELETEParams() *DeletePolicyUsingDELETEParams { - var () return &DeletePolicyUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeletePolicyUsingDELETEParamsWithTimeout creates a new DeletePolicyUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeletePolicyUsingDELETEParamsWithTimeout(timeout time.Duration) *DeletePolicyUsingDELETEParams { - var () return &DeletePolicyUsingDELETEParams{ - timeout: timeout, } } // NewDeletePolicyUsingDELETEParamsWithContext creates a new DeletePolicyUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeletePolicyUsingDELETEParamsWithContext(ctx context.Context) *DeletePolicyUsingDELETEParams { - var () return &DeletePolicyUsingDELETEParams{ - Context: ctx, } } // NewDeletePolicyUsingDELETEParamsWithHTTPClient creates a new DeletePolicyUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeletePolicyUsingDELETEParamsWithHTTPClient(client *http.Client) *DeletePolicyUsingDELETEParams { - var () return &DeletePolicyUsingDELETEParams{ HTTPClient: client, } } -/*DeletePolicyUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete policy using d e l e t e operation typically these are written to a http.Request +/* DeletePolicyUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete policy using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeletePolicyUsingDELETEParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card Id + /* ID. + + pricing card Id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type DeletePolicyUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete policy using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePolicyUsingDELETEParams) WithDefaults() *DeletePolicyUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete policy using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePolicyUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete policy using d e l e t e params func (o *DeletePolicyUsingDELETEParams) WithTimeout(timeout time.Duration) *DeletePolicyUsingDELETEParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *DeletePolicyUsingDELETEParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/pricing_cards/delete_policy_using_delete_responses.go b/pkg/client/pricing_cards/delete_policy_using_delete_responses.go index 18ecca6f..dd7c9c45 100644 --- a/pkg/client/pricing_cards/delete_policy_using_delete_responses.go +++ b/pkg/client/pricing_cards/delete_policy_using_delete_responses.go @@ -47,7 +47,6 @@ func (o *DeletePolicyUsingDELETEReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewDeletePolicyUsingDELETEOK() *DeletePolicyUsingDELETEOK { return &DeletePolicyUsingDELETEOK{} } -/*DeletePolicyUsingDELETEOK handles this case with default header values. +/* DeletePolicyUsingDELETEOK describes a response with status code 200, with default header values. OK */ @@ -79,7 +78,7 @@ func NewDeletePolicyUsingDELETENoContent() *DeletePolicyUsingDELETENoContent { return &DeletePolicyUsingDELETENoContent{} } -/*DeletePolicyUsingDELETENoContent handles this case with default header values. +/* DeletePolicyUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ @@ -100,7 +99,7 @@ func NewDeletePolicyUsingDELETEUnauthorized() *DeletePolicyUsingDELETEUnauthoriz return &DeletePolicyUsingDELETEUnauthorized{} } -/*DeletePolicyUsingDELETEUnauthorized handles this case with default header values. +/* DeletePolicyUsingDELETEUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -121,7 +120,7 @@ func NewDeletePolicyUsingDELETENotFound() *DeletePolicyUsingDELETENotFound { return &DeletePolicyUsingDELETENotFound{} } -/*DeletePolicyUsingDELETENotFound handles this case with default header values. +/* DeletePolicyUsingDELETENotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,7 +131,6 @@ type DeletePolicyUsingDELETENotFound struct { func (o *DeletePolicyUsingDELETENotFound) Error() string { return fmt.Sprintf("[DELETE /price/api/private/pricing-cards/{id}][%d] deletePolicyUsingDELETENotFound %+v", 404, o.Payload) } - func (o *DeletePolicyUsingDELETENotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/pricing_cards/get_policies_using_get_parameters.go b/pkg/client/pricing_cards/get_policies_using_get_parameters.go index 316b1489..2906223b 100644 --- a/pkg/client/pricing_cards/get_policies_using_get_parameters.go +++ b/pkg/client/pricing_cards/get_policies_using_get_parameters.go @@ -17,83 +17,92 @@ import ( "github.com/go-openapi/swag" ) -// NewGetPoliciesUsingGETParams creates a new GetPoliciesUsingGETParams object -// with the default values initialized. +// NewGetPoliciesUsingGETParams creates a new GetPoliciesUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPoliciesUsingGETParams() *GetPoliciesUsingGETParams { - var () return &GetPoliciesUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetPoliciesUsingGETParamsWithTimeout creates a new GetPoliciesUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPoliciesUsingGETParamsWithTimeout(timeout time.Duration) *GetPoliciesUsingGETParams { - var () return &GetPoliciesUsingGETParams{ - timeout: timeout, } } // NewGetPoliciesUsingGETParamsWithContext creates a new GetPoliciesUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPoliciesUsingGETParamsWithContext(ctx context.Context) *GetPoliciesUsingGETParams { - var () return &GetPoliciesUsingGETParams{ - Context: ctx, } } // NewGetPoliciesUsingGETParamsWithHTTPClient creates a new GetPoliciesUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPoliciesUsingGETParamsWithHTTPClient(client *http.Client) *GetPoliciesUsingGETParams { - var () return &GetPoliciesUsingGETParams{ HTTPClient: client, } } -/*GetPoliciesUsingGETParams contains all the parameters to send to the API endpoint -for the get policies using g e t operation typically these are written to a http.Request +/* GetPoliciesUsingGETParams contains all the parameters to send to the API endpoint + for the get policies using g e t operation. + + Typically these are written to a http.Request. */ type GetPoliciesUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ExpandAssignmentInfo - Whether or not returns count of assignments. + /* ExpandAssignmentInfo. + + Whether or not returns count of assignments. */ ExpandAssignmentInfo *bool - /*ExpandPricingCard - Whether or not returns detailed pricing card for each result. + /* ExpandPricingCard. + + Whether or not returns detailed pricing card for each result. */ ExpandPricingCard *bool - /*Search - Search by name and description + /* Search. + + Search by name and description */ Search *string @@ -102,6 +111,21 @@ type GetPoliciesUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get policies using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPoliciesUsingGETParams) WithDefaults() *GetPoliciesUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get policies using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPoliciesUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get policies using get params func (o *GetPoliciesUsingGETParams) WithTimeout(timeout time.Duration) *GetPoliciesUsingGETParams { o.SetTimeout(timeout) @@ -220,108 +244,117 @@ func (o *GetPoliciesUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ExpandAssignmentInfo != nil { // query param expandAssignmentInfo var qrExpandAssignmentInfo bool + if o.ExpandAssignmentInfo != nil { qrExpandAssignmentInfo = *o.ExpandAssignmentInfo } qExpandAssignmentInfo := swag.FormatBool(qrExpandAssignmentInfo) if qExpandAssignmentInfo != "" { + if err := r.SetQueryParam("expandAssignmentInfo", qExpandAssignmentInfo); err != nil { return err } } - } if o.ExpandPricingCard != nil { // query param expandPricingCard var qrExpandPricingCard bool + if o.ExpandPricingCard != nil { qrExpandPricingCard = *o.ExpandPricingCard } qExpandPricingCard := swag.FormatBool(qrExpandPricingCard) if qExpandPricingCard != "" { + if err := r.SetQueryParam("expandPricingCard", qExpandPricingCard); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -329,3 +362,20 @@ func (o *GetPoliciesUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } return nil } + +// bindParamGetPoliciesUsingGET binds the parameter $orderby +func (o *GetPoliciesUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/pricing_cards/get_policies_using_get_responses.go b/pkg/client/pricing_cards/get_policies_using_get_responses.go index a31089e4..54bf1c2d 100644 --- a/pkg/client/pricing_cards/get_policies_using_get_responses.go +++ b/pkg/client/pricing_cards/get_policies_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetPoliciesUsingGETReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetPoliciesUsingGETOK() *GetPoliciesUsingGETOK { return &GetPoliciesUsingGETOK{} } -/*GetPoliciesUsingGETOK handles this case with default header values. +/* GetPoliciesUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type GetPoliciesUsingGETOK struct { func (o *GetPoliciesUsingGETOK) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-cards][%d] getPoliciesUsingGETOK %+v", 200, o.Payload) } - func (o *GetPoliciesUsingGETOK) GetPayload() *models.PageOfMeteringPolicy { return o.Payload } @@ -79,7 +77,7 @@ func NewGetPoliciesUsingGETUnauthorized() *GetPoliciesUsingGETUnauthorized { return &GetPoliciesUsingGETUnauthorized{} } -/*GetPoliciesUsingGETUnauthorized handles this case with default header values. +/* GetPoliciesUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/pricing_cards/get_policy_using_get_parameters.go b/pkg/client/pricing_cards/get_policy_using_get_parameters.go index 58dc3fbb..bfc48611 100644 --- a/pkg/client/pricing_cards/get_policy_using_get_parameters.go +++ b/pkg/client/pricing_cards/get_policy_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPolicyUsingGETParams creates a new GetPolicyUsingGETParams object -// with the default values initialized. +// NewGetPolicyUsingGETParams creates a new GetPolicyUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetPolicyUsingGETParams() *GetPolicyUsingGETParams { - var () return &GetPolicyUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetPolicyUsingGETParamsWithTimeout creates a new GetPolicyUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPolicyUsingGETParamsWithTimeout(timeout time.Duration) *GetPolicyUsingGETParams { - var () return &GetPolicyUsingGETParams{ - timeout: timeout, } } // NewGetPolicyUsingGETParamsWithContext creates a new GetPolicyUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPolicyUsingGETParamsWithContext(ctx context.Context) *GetPolicyUsingGETParams { - var () return &GetPolicyUsingGETParams{ - Context: ctx, } } // NewGetPolicyUsingGETParamsWithHTTPClient creates a new GetPolicyUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPolicyUsingGETParamsWithHTTPClient(client *http.Client) *GetPolicyUsingGETParams { - var () return &GetPolicyUsingGETParams{ HTTPClient: client, } } -/*GetPolicyUsingGETParams contains all the parameters to send to the API endpoint -for the get policy using g e t operation typically these are written to a http.Request +/* GetPolicyUsingGETParams contains all the parameters to send to the API endpoint + for the get policy using g e t operation. + + Typically these are written to a http.Request. */ type GetPolicyUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card Id + /* ID. + + pricing card Id + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetPolicyUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get policy using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyUsingGETParams) WithDefaults() *GetPolicyUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get policy using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPolicyUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get policy using get params func (o *GetPolicyUsingGETParams) WithTimeout(timeout time.Duration) *GetPolicyUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetPolicyUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/pricing_cards/get_policy_using_get_responses.go b/pkg/client/pricing_cards/get_policy_using_get_responses.go index c4344ea2..9d53453d 100644 --- a/pkg/client/pricing_cards/get_policy_using_get_responses.go +++ b/pkg/client/pricing_cards/get_policy_using_get_responses.go @@ -41,7 +41,6 @@ func (o *GetPolicyUsingGETReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetPolicyUsingGETOK() *GetPolicyUsingGETOK { return &GetPolicyUsingGETOK{} } -/*GetPolicyUsingGETOK handles this case with default header values. +/* GetPolicyUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetPolicyUsingGETOK struct { func (o *GetPolicyUsingGETOK) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-cards/{id}][%d] getPolicyUsingGETOK %+v", 200, o.Payload) } - func (o *GetPolicyUsingGETOK) GetPayload() *models.MeteringPolicy { return o.Payload } @@ -85,7 +83,7 @@ func NewGetPolicyUsingGETUnauthorized() *GetPolicyUsingGETUnauthorized { return &GetPolicyUsingGETUnauthorized{} } -/*GetPolicyUsingGETUnauthorized handles this case with default header values. +/* GetPolicyUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetPolicyUsingGETNotFound() *GetPolicyUsingGETNotFound { return &GetPolicyUsingGETNotFound{} } -/*GetPolicyUsingGETNotFound handles this case with default header values. +/* GetPolicyUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetPolicyUsingGETNotFound struct { func (o *GetPolicyUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /price/api/private/pricing-cards/{id}][%d] getPolicyUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetPolicyUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/pricing_cards/pricing_cards_client.go b/pkg/client/pricing_cards/pricing_cards_client.go index 8bf38fd8..d53be4e2 100644 --- a/pkg/client/pricing_cards/pricing_cards_client.go +++ b/pkg/client/pricing_cards/pricing_cards_client.go @@ -25,17 +25,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams) (*CreatePolicyUsingPOSTOK, *CreatePolicyUsingPOSTCreated, error) + CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams, opts ...ClientOption) (*CreatePolicyUsingPOSTOK, *CreatePolicyUsingPOSTCreated, error) - DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams) (*DeletePolicyUsingDELETEOK, *DeletePolicyUsingDELETENoContent, error) + DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams, opts ...ClientOption) (*DeletePolicyUsingDELETEOK, *DeletePolicyUsingDELETENoContent, error) - GetPoliciesUsingGET(params *GetPoliciesUsingGETParams) (*GetPoliciesUsingGETOK, error) + GetPoliciesUsingGET(params *GetPoliciesUsingGETParams, opts ...ClientOption) (*GetPoliciesUsingGETOK, error) - GetPolicyUsingGET(params *GetPolicyUsingGETParams) (*GetPolicyUsingGETOK, error) + GetPolicyUsingGET(params *GetPolicyUsingGETParams, opts ...ClientOption) (*GetPolicyUsingGETOK, error) - UpdatePolicyUsingPUT(params *UpdatePolicyUsingPUTParams) (*UpdatePolicyUsingPUTOK, error) + UpdatePolicyUsingPUT(params *UpdatePolicyUsingPUTParams, opts ...ClientOption) (*UpdatePolicyUsingPUTOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,13 +48,12 @@ type ClientService interface { Create a new pricing card based on request body and validate its field according to business rules. */ -func (a *Client) CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams) (*CreatePolicyUsingPOSTOK, *CreatePolicyUsingPOSTCreated, error) { +func (a *Client) CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams, opts ...ClientOption) (*CreatePolicyUsingPOSTOK, *CreatePolicyUsingPOSTCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreatePolicyUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createPolicyUsingPOST", Method: "POST", PathPattern: "/price/api/private/pricing-cards", @@ -62,7 +64,12 @@ func (a *Client) CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams) (*Cr Reader: &CreatePolicyUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -82,13 +89,12 @@ func (a *Client) CreatePolicyUsingPOST(params *CreatePolicyUsingPOSTParams) (*Cr Deletes the pricing card with the specified id */ -func (a *Client) DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams) (*DeletePolicyUsingDELETEOK, *DeletePolicyUsingDELETENoContent, error) { +func (a *Client) DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams, opts ...ClientOption) (*DeletePolicyUsingDELETEOK, *DeletePolicyUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeletePolicyUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deletePolicyUsingDELETE", Method: "DELETE", PathPattern: "/price/api/private/pricing-cards/{id}", @@ -99,7 +105,12 @@ func (a *Client) DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams) Reader: &DeletePolicyUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -119,13 +130,12 @@ func (a *Client) DeletePolicyUsingDELETE(params *DeletePolicyUsingDELETEParams) Returns a paginated list of pricing cards */ -func (a *Client) GetPoliciesUsingGET(params *GetPoliciesUsingGETParams) (*GetPoliciesUsingGETOK, error) { +func (a *Client) GetPoliciesUsingGET(params *GetPoliciesUsingGETParams, opts ...ClientOption) (*GetPoliciesUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPoliciesUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPoliciesUsingGET", Method: "GET", PathPattern: "/price/api/private/pricing-cards", @@ -136,7 +146,12 @@ func (a *Client) GetPoliciesUsingGET(params *GetPoliciesUsingGETParams) (*GetPol Reader: &GetPoliciesUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -155,13 +170,12 @@ func (a *Client) GetPoliciesUsingGET(params *GetPoliciesUsingGETParams) (*GetPol Returns the pricing card with the specified id */ -func (a *Client) GetPolicyUsingGET(params *GetPolicyUsingGETParams) (*GetPolicyUsingGETOK, error) { +func (a *Client) GetPolicyUsingGET(params *GetPolicyUsingGETParams, opts ...ClientOption) (*GetPolicyUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPolicyUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getPolicyUsingGET", Method: "GET", PathPattern: "/price/api/private/pricing-cards/{id}", @@ -172,7 +186,12 @@ func (a *Client) GetPolicyUsingGET(params *GetPolicyUsingGETParams) (*GetPolicyU Reader: &GetPolicyUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -191,13 +210,12 @@ func (a *Client) GetPolicyUsingGET(params *GetPolicyUsingGETParams) (*GetPolicyU Updates the pricing card with the specified Id */ -func (a *Client) UpdatePolicyUsingPUT(params *UpdatePolicyUsingPUTParams) (*UpdatePolicyUsingPUTOK, error) { +func (a *Client) UpdatePolicyUsingPUT(params *UpdatePolicyUsingPUTParams, opts ...ClientOption) (*UpdatePolicyUsingPUTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdatePolicyUsingPUTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updatePolicyUsingPUT", Method: "PUT", PathPattern: "/price/api/private/pricing-cards/{id}", @@ -208,7 +226,12 @@ func (a *Client) UpdatePolicyUsingPUT(params *UpdatePolicyUsingPUTParams) (*Upda Reader: &UpdatePolicyUsingPUTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/pricing_cards/update_policy_using_put_parameters.go b/pkg/client/pricing_cards/update_policy_using_put_parameters.go index 3f5d8d98..da9c1ff9 100644 --- a/pkg/client/pricing_cards/update_policy_using_put_parameters.go +++ b/pkg/client/pricing_cards/update_policy_using_put_parameters.go @@ -18,63 +18,66 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdatePolicyUsingPUTParams creates a new UpdatePolicyUsingPUTParams object -// with the default values initialized. +// NewUpdatePolicyUsingPUTParams creates a new UpdatePolicyUsingPUTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdatePolicyUsingPUTParams() *UpdatePolicyUsingPUTParams { - var () return &UpdatePolicyUsingPUTParams{ - timeout: cr.DefaultTimeout, } } // NewUpdatePolicyUsingPUTParamsWithTimeout creates a new UpdatePolicyUsingPUTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdatePolicyUsingPUTParamsWithTimeout(timeout time.Duration) *UpdatePolicyUsingPUTParams { - var () return &UpdatePolicyUsingPUTParams{ - timeout: timeout, } } // NewUpdatePolicyUsingPUTParamsWithContext creates a new UpdatePolicyUsingPUTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdatePolicyUsingPUTParamsWithContext(ctx context.Context) *UpdatePolicyUsingPUTParams { - var () return &UpdatePolicyUsingPUTParams{ - Context: ctx, } } // NewUpdatePolicyUsingPUTParamsWithHTTPClient creates a new UpdatePolicyUsingPUTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdatePolicyUsingPUTParamsWithHTTPClient(client *http.Client) *UpdatePolicyUsingPUTParams { - var () return &UpdatePolicyUsingPUTParams{ HTTPClient: client, } } -/*UpdatePolicyUsingPUTParams contains all the parameters to send to the API endpoint -for the update policy using p u t operation typically these are written to a http.Request +/* UpdatePolicyUsingPUTParams contains all the parameters to send to the API endpoint + for the update policy using p u t operation. + + Typically these are written to a http.Request. */ type UpdatePolicyUsingPUTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ID - pricing card Id + /* ID. + + pricing card Id + + Format: uuid */ ID strfmt.UUID - /*MeteringPolicy - A set of pricing card fields to be updated. + /* MeteringPolicy. + + A set of pricing card fields to be updated. */ MeteringPolicy *models.MeteringPolicy @@ -83,6 +86,21 @@ type UpdatePolicyUsingPUTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update policy using p u t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePolicyUsingPUTParams) WithDefaults() *UpdatePolicyUsingPUTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update policy using p u t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePolicyUsingPUTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update policy using p u t params func (o *UpdatePolicyUsingPUTParams) WithTimeout(timeout time.Duration) *UpdatePolicyUsingPUTParams { o.SetTimeout(timeout) @@ -161,23 +179,23 @@ func (o *UpdatePolicyUsingPUTParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id if err := r.SetPathParam("id", o.ID.String()); err != nil { return err } - if o.MeteringPolicy != nil { if err := r.SetBodyParam(o.MeteringPolicy); err != nil { return err diff --git a/pkg/client/pricing_cards/update_policy_using_put_responses.go b/pkg/client/pricing_cards/update_policy_using_put_responses.go index 726a875c..fd46c9e3 100644 --- a/pkg/client/pricing_cards/update_policy_using_put_responses.go +++ b/pkg/client/pricing_cards/update_policy_using_put_responses.go @@ -41,7 +41,6 @@ func (o *UpdatePolicyUsingPUTReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdatePolicyUsingPUTOK() *UpdatePolicyUsingPUTOK { return &UpdatePolicyUsingPUTOK{} } -/*UpdatePolicyUsingPUTOK handles this case with default header values. +/* UpdatePolicyUsingPUTOK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type UpdatePolicyUsingPUTOK struct { func (o *UpdatePolicyUsingPUTOK) Error() string { return fmt.Sprintf("[PUT /price/api/private/pricing-cards/{id}][%d] updatePolicyUsingPUTOK %+v", 200, o.Payload) } - func (o *UpdatePolicyUsingPUTOK) GetPayload() *models.MeteringPolicy { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdatePolicyUsingPUTUnauthorized() *UpdatePolicyUsingPUTUnauthorized { return &UpdatePolicyUsingPUTUnauthorized{} } -/*UpdatePolicyUsingPUTUnauthorized handles this case with default header values. +/* UpdatePolicyUsingPUTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewUpdatePolicyUsingPUTNotFound() *UpdatePolicyUsingPUTNotFound { return &UpdatePolicyUsingPUTNotFound{} } -/*UpdatePolicyUsingPUTNotFound handles this case with default header values. +/* UpdatePolicyUsingPUTNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type UpdatePolicyUsingPUTNotFound struct { func (o *UpdatePolicyUsingPUTNotFound) Error() string { return fmt.Sprintf("[PUT /price/api/private/pricing-cards/{id}][%d] updatePolicyUsingPUTNotFound %+v", 404, o.Payload) } - func (o *UpdatePolicyUsingPUTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/project/create_project_parameters.go b/pkg/client/project/create_project_parameters.go index 51d8132e..a2606fc8 100644 --- a/pkg/client/project/create_project_parameters.go +++ b/pkg/client/project/create_project_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateProjectParams creates a new CreateProjectParams object -// with the default values initialized. +// NewCreateProjectParams creates a new CreateProjectParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateProjectParams() *CreateProjectParams { - var () return &CreateProjectParams{ - timeout: cr.DefaultTimeout, } } // NewCreateProjectParamsWithTimeout creates a new CreateProjectParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateProjectParamsWithTimeout(timeout time.Duration) *CreateProjectParams { - var () return &CreateProjectParams{ - timeout: timeout, } } // NewCreateProjectParamsWithContext creates a new CreateProjectParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateProjectParamsWithContext(ctx context.Context) *CreateProjectParams { - var () return &CreateProjectParams{ - Context: ctx, } } // NewCreateProjectParamsWithHTTPClient creates a new CreateProjectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateProjectParamsWithHTTPClient(client *http.Client) *CreateProjectParams { - var () return &CreateProjectParams{ HTTPClient: client, } } -/*CreateProjectParams contains all the parameters to send to the API endpoint -for the create project operation typically these are written to a http.Request +/* CreateProjectParams contains all the parameters to send to the API endpoint + for the create project operation. + + Typically these are written to a http.Request. */ type CreateProjectParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Project Specification instance + /* Body. + + Project Specification instance */ Body *models.ProjectSpecification @@ -78,6 +78,21 @@ type CreateProjectParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateProjectParams) WithDefaults() *CreateProjectParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateProjectParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create project params func (o *CreateProjectParams) WithTimeout(timeout time.Duration) *CreateProjectParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/project/create_project_responses.go b/pkg/client/project/create_project_responses.go index 57cd979e..e842a787 100644 --- a/pkg/client/project/create_project_responses.go +++ b/pkg/client/project/create_project_responses.go @@ -41,7 +41,6 @@ func (o *CreateProjectReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateProjectCreated() *CreateProjectCreated { return &CreateProjectCreated{} } -/*CreateProjectCreated handles this case with default header values. +/* CreateProjectCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateProjectCreated struct { func (o *CreateProjectCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/projects][%d] createProjectCreated %+v", 201, o.Payload) } - func (o *CreateProjectCreated) GetPayload() *models.Project { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateProjectBadRequest() *CreateProjectBadRequest { return &CreateProjectBadRequest{} } -/*CreateProjectBadRequest handles this case with default header values. +/* CreateProjectBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateProjectBadRequest struct { func (o *CreateProjectBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/projects][%d] createProjectBadRequest %+v", 400, o.Payload) } - func (o *CreateProjectBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateProjectForbidden() *CreateProjectForbidden { return &CreateProjectForbidden{} } -/*CreateProjectForbidden handles this case with default header values. +/* CreateProjectForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateProjectForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateProjectForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/projects][%d] createProjectForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/projects][%d] createProjectForbidden %+v", 403, o.Payload) +} +func (o *CreateProjectForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateProjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/project/delete_project_parameters.go b/pkg/client/project/delete_project_parameters.go index 950e17ca..f11f0cf1 100644 --- a/pkg/client/project/delete_project_parameters.go +++ b/pkg/client/project/delete_project_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteProjectParams creates a new DeleteProjectParams object -// with the default values initialized. +// NewDeleteProjectParams creates a new DeleteProjectParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteProjectParams() *DeleteProjectParams { - var () return &DeleteProjectParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteProjectParamsWithTimeout creates a new DeleteProjectParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteProjectParamsWithTimeout(timeout time.Duration) *DeleteProjectParams { - var () return &DeleteProjectParams{ - timeout: timeout, } } // NewDeleteProjectParamsWithContext creates a new DeleteProjectParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteProjectParamsWithContext(ctx context.Context) *DeleteProjectParams { - var () return &DeleteProjectParams{ - Context: ctx, } } // NewDeleteProjectParamsWithHTTPClient creates a new DeleteProjectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteProjectParamsWithHTTPClient(client *http.Client) *DeleteProjectParams { - var () return &DeleteProjectParams{ HTTPClient: client, } } -/*DeleteProjectParams contains all the parameters to send to the API endpoint -for the delete project operation typically these are written to a http.Request +/* DeleteProjectParams contains all the parameters to send to the API endpoint + for the delete project operation. + + Typically these are written to a http.Request. */ type DeleteProjectParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the project. + /* ID. + + The ID of the project. */ ID string @@ -76,6 +76,21 @@ type DeleteProjectParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteProjectParams) WithDefaults() *DeleteProjectParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteProjectParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete project params func (o *DeleteProjectParams) WithTimeout(timeout time.Duration) *DeleteProjectParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/project/delete_project_responses.go b/pkg/client/project/delete_project_responses.go index 063b821e..ceaabb4f 100644 --- a/pkg/client/project/delete_project_responses.go +++ b/pkg/client/project/delete_project_responses.go @@ -7,9 +7,12 @@ package project import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteProjectReader is a Reader for the DeleteProject structure. @@ -38,7 +41,6 @@ func (o *DeleteProjectReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -49,7 +51,7 @@ func NewDeleteProjectNoContent() *DeleteProjectNoContent { return &DeleteProjectNoContent{} } -/*DeleteProjectNoContent handles this case with default header values. +/* DeleteProjectNoContent describes a response with status code 204, with default header values. No Content */ @@ -70,19 +72,30 @@ func NewDeleteProjectForbidden() *DeleteProjectForbidden { return &DeleteProjectForbidden{} } -/*DeleteProjectForbidden handles this case with default header values. +/* DeleteProjectForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteProjectForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteProjectForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/projects/{id}][%d] deleteProjectForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/projects/{id}][%d] deleteProjectForbidden %+v", 403, o.Payload) +} +func (o *DeleteProjectForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteProjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -91,18 +104,29 @@ func NewDeleteProjectConflict() *DeleteProjectConflict { return &DeleteProjectConflict{} } -/*DeleteProjectConflict handles this case with default header values. +/* DeleteProjectConflict describes a response with status code 409, with default header values. Conflict, when the project is in use */ type DeleteProjectConflict struct { + Payload *models.ServiceErrorResponse } func (o *DeleteProjectConflict) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/projects/{id}][%d] deleteProjectConflict ", 409) + return fmt.Sprintf("[DELETE /iaas/api/projects/{id}][%d] deleteProjectConflict %+v", 409, o.Payload) +} +func (o *DeleteProjectConflict) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteProjectConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/project/get_project_parameters.go b/pkg/client/project/get_project_parameters.go index 5be769fe..08d1fa48 100644 --- a/pkg/client/project/get_project_parameters.go +++ b/pkg/client/project/get_project_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetProjectParams creates a new GetProjectParams object -// with the default values initialized. +// NewGetProjectParams creates a new GetProjectParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetProjectParams() *GetProjectParams { - var () return &GetProjectParams{ - timeout: cr.DefaultTimeout, } } // NewGetProjectParamsWithTimeout creates a new GetProjectParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetProjectParamsWithTimeout(timeout time.Duration) *GetProjectParams { - var () return &GetProjectParams{ - timeout: timeout, } } // NewGetProjectParamsWithContext creates a new GetProjectParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetProjectParamsWithContext(ctx context.Context) *GetProjectParams { - var () return &GetProjectParams{ - Context: ctx, } } // NewGetProjectParamsWithHTTPClient creates a new GetProjectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetProjectParamsWithHTTPClient(client *http.Client) *GetProjectParams { - var () return &GetProjectParams{ HTTPClient: client, } } -/*GetProjectParams contains all the parameters to send to the API endpoint -for the get project operation typically these are written to a http.Request +/* GetProjectParams contains all the parameters to send to the API endpoint + for the get project operation. + + Typically these are written to a http.Request. */ type GetProjectParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the project. + /* ID. + + The ID of the project. */ ID string @@ -76,6 +76,21 @@ type GetProjectParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectParams) WithDefaults() *GetProjectParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get project params func (o *GetProjectParams) WithTimeout(timeout time.Duration) *GetProjectParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/project/get_project_resource_metadata_parameters.go b/pkg/client/project/get_project_resource_metadata_parameters.go index 295f9bee..35cafa72 100644 --- a/pkg/client/project/get_project_resource_metadata_parameters.go +++ b/pkg/client/project/get_project_resource_metadata_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetProjectResourceMetadataParams creates a new GetProjectResourceMetadataParams object -// with the default values initialized. +// NewGetProjectResourceMetadataParams creates a new GetProjectResourceMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetProjectResourceMetadataParams() *GetProjectResourceMetadataParams { - var () return &GetProjectResourceMetadataParams{ - timeout: cr.DefaultTimeout, } } // NewGetProjectResourceMetadataParamsWithTimeout creates a new GetProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetProjectResourceMetadataParamsWithTimeout(timeout time.Duration) *GetProjectResourceMetadataParams { - var () return &GetProjectResourceMetadataParams{ - timeout: timeout, } } // NewGetProjectResourceMetadataParamsWithContext creates a new GetProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetProjectResourceMetadataParamsWithContext(ctx context.Context) *GetProjectResourceMetadataParams { - var () return &GetProjectResourceMetadataParams{ - Context: ctx, } } // NewGetProjectResourceMetadataParamsWithHTTPClient creates a new GetProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetProjectResourceMetadataParamsWithHTTPClient(client *http.Client) *GetProjectResourceMetadataParams { - var () return &GetProjectResourceMetadataParams{ HTTPClient: client, } } -/*GetProjectResourceMetadataParams contains all the parameters to send to the API endpoint -for the get project resource metadata operation typically these are written to a http.Request +/* GetProjectResourceMetadataParams contains all the parameters to send to the API endpoint + for the get project resource metadata operation. + + Typically these are written to a http.Request. */ type GetProjectResourceMetadataParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the project. + /* ID. + + The ID of the project. */ ID string @@ -76,6 +76,21 @@ type GetProjectResourceMetadataParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get project resource metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectResourceMetadataParams) WithDefaults() *GetProjectResourceMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get project resource metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectResourceMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get project resource metadata params func (o *GetProjectResourceMetadataParams) WithTimeout(timeout time.Duration) *GetProjectResourceMetadataParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetProjectResourceMetadataParams) WriteToRequest(r runtime.ClientReques // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/project/get_project_resource_metadata_responses.go b/pkg/client/project/get_project_resource_metadata_responses.go index 0bee34b5..d69931ba 100644 --- a/pkg/client/project/get_project_resource_metadata_responses.go +++ b/pkg/client/project/get_project_resource_metadata_responses.go @@ -41,7 +41,6 @@ func (o *GetProjectResourceMetadataReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetProjectResourceMetadataOK() *GetProjectResourceMetadataOK { return &GetProjectResourceMetadataOK{} } -/*GetProjectResourceMetadataOK handles this case with default header values. +/* GetProjectResourceMetadataOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetProjectResourceMetadataOK struct { func (o *GetProjectResourceMetadataOK) Error() string { return fmt.Sprintf("[GET /iaas/api/projects/{id}/resource-metadata][%d] getProjectResourceMetadataOK %+v", 200, o.Payload) } - func (o *GetProjectResourceMetadataOK) GetPayload() *models.ProjectResourceMetadata { return o.Payload } @@ -85,19 +83,30 @@ func NewGetProjectResourceMetadataForbidden() *GetProjectResourceMetadataForbidd return &GetProjectResourceMetadataForbidden{} } -/*GetProjectResourceMetadataForbidden handles this case with default header values. +/* GetProjectResourceMetadataForbidden describes a response with status code 403, with default header values. Forbidden */ type GetProjectResourceMetadataForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetProjectResourceMetadataForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/projects/{id}/resource-metadata][%d] getProjectResourceMetadataForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/projects/{id}/resource-metadata][%d] getProjectResourceMetadataForbidden %+v", 403, o.Payload) +} +func (o *GetProjectResourceMetadataForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetProjectResourceMetadataForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetProjectResourceMetadataNotFound() *GetProjectResourceMetadataNotFound return &GetProjectResourceMetadataNotFound{} } -/*GetProjectResourceMetadataNotFound handles this case with default header values. +/* GetProjectResourceMetadataNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetProjectResourceMetadataNotFound struct { func (o *GetProjectResourceMetadataNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/projects/{id}/resource-metadata][%d] getProjectResourceMetadataNotFound %+v", 404, o.Payload) } - func (o *GetProjectResourceMetadataNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/project/get_project_responses.go b/pkg/client/project/get_project_responses.go index 9fd7e8d4..001fa611 100644 --- a/pkg/client/project/get_project_responses.go +++ b/pkg/client/project/get_project_responses.go @@ -41,7 +41,6 @@ func (o *GetProjectReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetProjectOK() *GetProjectOK { return &GetProjectOK{} } -/*GetProjectOK handles this case with default header values. +/* GetProjectOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetProjectOK struct { func (o *GetProjectOK) Error() string { return fmt.Sprintf("[GET /iaas/api/projects/{id}][%d] getProjectOK %+v", 200, o.Payload) } - func (o *GetProjectOK) GetPayload() *models.Project { return o.Payload } @@ -85,19 +83,30 @@ func NewGetProjectForbidden() *GetProjectForbidden { return &GetProjectForbidden{} } -/*GetProjectForbidden handles this case with default header values. +/* GetProjectForbidden describes a response with status code 403, with default header values. Forbidden */ type GetProjectForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetProjectForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/projects/{id}][%d] getProjectForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/projects/{id}][%d] getProjectForbidden %+v", 403, o.Payload) +} +func (o *GetProjectForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetProjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetProjectNotFound() *GetProjectNotFound { return &GetProjectNotFound{} } -/*GetProjectNotFound handles this case with default header values. +/* GetProjectNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetProjectNotFound struct { func (o *GetProjectNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/projects/{id}][%d] getProjectNotFound %+v", 404, o.Payload) } - func (o *GetProjectNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/project/get_projects_parameters.go b/pkg/client/project/get_projects_parameters.go index 4cfb5774..0a144b14 100644 --- a/pkg/client/project/get_projects_parameters.go +++ b/pkg/client/project/get_projects_parameters.go @@ -17,57 +17,58 @@ import ( "github.com/go-openapi/swag" ) -// NewGetProjectsParams creates a new GetProjectsParams object -// with the default values initialized. +// NewGetProjectsParams creates a new GetProjectsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetProjectsParams() *GetProjectsParams { - var () return &GetProjectsParams{ - timeout: cr.DefaultTimeout, } } // NewGetProjectsParamsWithTimeout creates a new GetProjectsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetProjectsParamsWithTimeout(timeout time.Duration) *GetProjectsParams { - var () return &GetProjectsParams{ - timeout: timeout, } } // NewGetProjectsParamsWithContext creates a new GetProjectsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetProjectsParamsWithContext(ctx context.Context) *GetProjectsParams { - var () return &GetProjectsParams{ - Context: ctx, } } // NewGetProjectsParamsWithHTTPClient creates a new GetProjectsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetProjectsParamsWithHTTPClient(client *http.Client) *GetProjectsParams { - var () return &GetProjectsParams{ HTTPClient: client, } } -/*GetProjectsParams contains all the parameters to send to the API endpoint -for the get projects operation typically these are written to a http.Request +/* GetProjectsParams contains all the parameters to send to the API endpoint + for the get projects operation. + + Typically these are written to a http.Request. */ type GetProjectsParams struct { - /*DollarCount - Total number of records. If the collection has a filter, the number of records matching the filter + /* DollarCount. + Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter. */ DollarCount *bool - /*DollarFilter - Filter the results by a specified predicate expression. A set of operators and functions are defined for use: + + /* DollarFilter. + + Filter the results by a specified predicate expression. A set of operators and functions are defined for use: Operators: eq, ne, gt, ge, lt, le, and, or, not. Functions: bool substringof(string p0, string p1) @@ -82,35 +83,53 @@ type GetProjectsParams struct { string toupper(string p0) string trim(string p0) string concat(string p0, string p1) - */ DollarFilter *string - /*DollarSkip - Number of records you want to skip + /* DollarOrderBy. + + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + */ + DollarOrderBy *string + + /* DollarSkip. + + Number of records you want to skip. */ DollarSkip *int64 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want to get. */ DollarTop *int64 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about - */ - APIVersion *string - /*OrderBy - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ - OrderBy *string + APIVersion *string timeout time.Duration Context context.Context HTTPClient *http.Client } +// WithDefaults hydrates default values in the get projects params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectsParams) WithDefaults() *GetProjectsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get projects params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetProjectsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get projects params func (o *GetProjectsParams) WithTimeout(timeout time.Duration) *GetProjectsParams { o.SetTimeout(timeout) @@ -166,6 +185,17 @@ func (o *GetProjectsParams) SetDollarFilter(dollarFilter *string) { o.DollarFilter = dollarFilter } +// WithDollarOrderBy adds the dollarOrderBy to the get projects params +func (o *GetProjectsParams) WithDollarOrderBy(dollarOrderBy *string) *GetProjectsParams { + o.SetDollarOrderBy(dollarOrderBy) + return o +} + +// SetDollarOrderBy adds the dollarOrderBy to the get projects params +func (o *GetProjectsParams) SetDollarOrderBy(dollarOrderBy *string) { + o.DollarOrderBy = dollarOrderBy +} + // WithDollarSkip adds the dollarSkip to the get projects params func (o *GetProjectsParams) WithDollarSkip(dollarSkip *int64) *GetProjectsParams { o.SetDollarSkip(dollarSkip) @@ -199,17 +229,6 @@ func (o *GetProjectsParams) SetAPIVersion(aPIVersion *string) { o.APIVersion = aPIVersion } -// WithOrderBy adds the orderBy to the get projects params -func (o *GetProjectsParams) WithOrderBy(orderBy *string) *GetProjectsParams { - o.SetOrderBy(orderBy) - return o -} - -// SetOrderBy adds the orderBy to the get projects params -func (o *GetProjectsParams) SetOrderBy(orderBy *string) { - o.OrderBy = orderBy -} - // WriteToRequest writes these params to a swagger request func (o *GetProjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -222,96 +241,102 @@ func (o *GetProjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // query param $count var qrDollarCount bool + if o.DollarCount != nil { qrDollarCount = *o.DollarCount } qDollarCount := swag.FormatBool(qrDollarCount) if qDollarCount != "" { + if err := r.SetQueryParam("$count", qDollarCount); err != nil { return err } } - } if o.DollarFilter != nil { // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } + } + + if o.DollarOrderBy != nil { + + // query param $orderBy + var qrDollarOrderBy string + if o.DollarOrderBy != nil { + qrDollarOrderBy = *o.DollarOrderBy + } + qDollarOrderBy := qrDollarOrderBy + if qDollarOrderBy != "" { + + if err := r.SetQueryParam("$orderBy", qDollarOrderBy); err != nil { + return err + } + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int64 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt64(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int64 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt64(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { - if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { - return err - } - } - - } - - if o.OrderBy != nil { - // query param orderBy - var qrOrderBy string - if o.OrderBy != nil { - qrOrderBy = *o.OrderBy - } - qOrderBy := qrOrderBy - if qOrderBy != "" { - if err := r.SetQueryParam("orderBy", qOrderBy); err != nil { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/project/get_projects_responses.go b/pkg/client/project/get_projects_responses.go index f3ac1715..4d67220e 100644 --- a/pkg/client/project/get_projects_responses.go +++ b/pkg/client/project/get_projects_responses.go @@ -35,7 +35,6 @@ func (o *GetProjectsReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetProjectsOK() *GetProjectsOK { return &GetProjectsOK{} } -/*GetProjectsOK handles this case with default header values. +/* GetProjectsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetProjectsOK struct { func (o *GetProjectsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/projects][%d] getProjectsOK %+v", 200, o.Payload) } - func (o *GetProjectsOK) GetPayload() *models.ProjectResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetProjectsForbidden() *GetProjectsForbidden { return &GetProjectsForbidden{} } -/*GetProjectsForbidden handles this case with default header values. +/* GetProjectsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetProjectsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetProjectsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/projects][%d] getProjectsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/projects][%d] getProjectsForbidden %+v", 403, o.Payload) +} +func (o *GetProjectsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetProjectsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/project/project_client.go b/pkg/client/project/project_client.go index 51e7539e..57290406 100644 --- a/pkg/client/project/project_client.go +++ b/pkg/client/project/project_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateProject(params *CreateProjectParams) (*CreateProjectCreated, error) + CreateProject(params *CreateProjectParams, opts ...ClientOption) (*CreateProjectCreated, error) - DeleteProject(params *DeleteProjectParams) (*DeleteProjectNoContent, error) + DeleteProject(params *DeleteProjectParams, opts ...ClientOption) (*DeleteProjectNoContent, error) - GetProject(params *GetProjectParams) (*GetProjectOK, error) + GetProject(params *GetProjectParams, opts ...ClientOption) (*GetProjectOK, error) - GetProjectResourceMetadata(params *GetProjectResourceMetadataParams) (*GetProjectResourceMetadataOK, error) + GetProjectResourceMetadata(params *GetProjectResourceMetadataParams, opts ...ClientOption) (*GetProjectResourceMetadataOK, error) - GetProjects(params *GetProjectsParams) (*GetProjectsOK, error) + GetProjects(params *GetProjectsParams, opts ...ClientOption) (*GetProjectsOK, error) - UpdateProject(params *UpdateProjectParams) (*UpdateProjectOK, error) + UpdateProject(params *UpdateProjectParams, opts ...ClientOption) (*UpdateProjectOK, error) - UpdateProjectResourceMetadata(params *UpdateProjectResourceMetadataParams) (*UpdateProjectResourceMetadataOK, error) + UpdateProjectResourceMetadata(params *UpdateProjectResourceMetadataParams, opts ...ClientOption) (*UpdateProjectResourceMetadataOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Create project */ -func (a *Client) CreateProject(params *CreateProjectParams) (*CreateProjectCreated, error) { +func (a *Client) CreateProject(params *CreateProjectParams, opts ...ClientOption) (*CreateProjectCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateProjectParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createProject", Method: "POST", PathPattern: "/iaas/api/projects", @@ -66,7 +68,12 @@ func (a *Client) CreateProject(params *CreateProjectParams) (*CreateProjectCreat Reader: &CreateProjectReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -85,13 +92,12 @@ func (a *Client) CreateProject(params *CreateProjectParams) (*CreateProjectCreat Delete project with a given id */ -func (a *Client) DeleteProject(params *DeleteProjectParams) (*DeleteProjectNoContent, error) { +func (a *Client) DeleteProject(params *DeleteProjectParams, opts ...ClientOption) (*DeleteProjectNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteProjectParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteProject", Method: "DELETE", PathPattern: "/iaas/api/projects/{id}", @@ -102,7 +108,12 @@ func (a *Client) DeleteProject(params *DeleteProjectParams) (*DeleteProjectNoCon Reader: &DeleteProjectReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -121,13 +132,12 @@ func (a *Client) DeleteProject(params *DeleteProjectParams) (*DeleteProjectNoCon Get project with a given id */ -func (a *Client) GetProject(params *GetProjectParams) (*GetProjectOK, error) { +func (a *Client) GetProject(params *GetProjectParams, opts ...ClientOption) (*GetProjectOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetProjectParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getProject", Method: "GET", PathPattern: "/iaas/api/projects/{id}", @@ -138,7 +148,12 @@ func (a *Client) GetProject(params *GetProjectParams) (*GetProjectOK, error) { Reader: &GetProjectReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -157,13 +172,12 @@ func (a *Client) GetProject(params *GetProjectParams) (*GetProjectOK, error) { Get project resource metadata by a given project id */ -func (a *Client) GetProjectResourceMetadata(params *GetProjectResourceMetadataParams) (*GetProjectResourceMetadataOK, error) { +func (a *Client) GetProjectResourceMetadata(params *GetProjectResourceMetadataParams, opts ...ClientOption) (*GetProjectResourceMetadataOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetProjectResourceMetadataParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getProjectResourceMetadata", Method: "GET", PathPattern: "/iaas/api/projects/{id}/resource-metadata", @@ -174,7 +188,12 @@ func (a *Client) GetProjectResourceMetadata(params *GetProjectResourceMetadataPa Reader: &GetProjectResourceMetadataReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -193,13 +212,12 @@ func (a *Client) GetProjectResourceMetadata(params *GetProjectResourceMetadataPa Get all projects */ -func (a *Client) GetProjects(params *GetProjectsParams) (*GetProjectsOK, error) { +func (a *Client) GetProjects(params *GetProjectsParams, opts ...ClientOption) (*GetProjectsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetProjectsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getProjects", Method: "GET", PathPattern: "/iaas/api/projects", @@ -210,7 +228,12 @@ func (a *Client) GetProjects(params *GetProjectsParams) (*GetProjectsOK, error) Reader: &GetProjectsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -229,13 +252,12 @@ func (a *Client) GetProjects(params *GetProjectsParams) (*GetProjectsOK, error) Update project */ -func (a *Client) UpdateProject(params *UpdateProjectParams) (*UpdateProjectOK, error) { +func (a *Client) UpdateProject(params *UpdateProjectParams, opts ...ClientOption) (*UpdateProjectOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateProjectParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateProject", Method: "PATCH", PathPattern: "/iaas/api/projects/{id}", @@ -246,7 +268,12 @@ func (a *Client) UpdateProject(params *UpdateProjectParams) (*UpdateProjectOK, e Reader: &UpdateProjectReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -265,13 +292,12 @@ func (a *Client) UpdateProject(params *UpdateProjectParams) (*UpdateProjectOK, e Update project resource metadata by a given project id */ -func (a *Client) UpdateProjectResourceMetadata(params *UpdateProjectResourceMetadataParams) (*UpdateProjectResourceMetadataOK, error) { +func (a *Client) UpdateProjectResourceMetadata(params *UpdateProjectResourceMetadataParams, opts ...ClientOption) (*UpdateProjectResourceMetadataOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateProjectResourceMetadataParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateProjectResourceMetadata", Method: "PATCH", PathPattern: "/iaas/api/projects/{id}/resource-metadata", @@ -282,7 +308,12 @@ func (a *Client) UpdateProjectResourceMetadata(params *UpdateProjectResourceMeta Reader: &UpdateProjectResourceMetadataReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/project/update_project_parameters.go b/pkg/client/project/update_project_parameters.go index ce7009e2..01961963 100644 --- a/pkg/client/project/update_project_parameters.go +++ b/pkg/client/project/update_project_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateProjectParams creates a new UpdateProjectParams object -// with the default values initialized. +// NewUpdateProjectParams creates a new UpdateProjectParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateProjectParams() *UpdateProjectParams { - var () return &UpdateProjectParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateProjectParamsWithTimeout creates a new UpdateProjectParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateProjectParamsWithTimeout(timeout time.Duration) *UpdateProjectParams { - var () return &UpdateProjectParams{ - timeout: timeout, } } // NewUpdateProjectParamsWithContext creates a new UpdateProjectParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateProjectParamsWithContext(ctx context.Context) *UpdateProjectParams { - var () return &UpdateProjectParams{ - Context: ctx, } } // NewUpdateProjectParamsWithHTTPClient creates a new UpdateProjectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateProjectParamsWithHTTPClient(client *http.Client) *UpdateProjectParams { - var () return &UpdateProjectParams{ HTTPClient: client, } } -/*UpdateProjectParams contains all the parameters to send to the API endpoint -for the update project operation typically these are written to a http.Request +/* UpdateProjectParams contains all the parameters to send to the API endpoint + for the update project operation. + + Typically these are written to a http.Request. */ type UpdateProjectParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Project specification + /* Body. + + Project specification */ Body *models.ProjectSpecification - /*ID - The ID of the project. + /* ID. + + The ID of the project. */ ID string @@ -83,6 +84,21 @@ type UpdateProjectParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateProjectParams) WithDefaults() *UpdateProjectParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateProjectParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update project params func (o *UpdateProjectParams) WithTimeout(timeout time.Duration) *UpdateProjectParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/project/update_project_resource_metadata_parameters.go b/pkg/client/project/update_project_resource_metadata_parameters.go index 3bc3b116..b7f98ca0 100644 --- a/pkg/client/project/update_project_resource_metadata_parameters.go +++ b/pkg/client/project/update_project_resource_metadata_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateProjectResourceMetadataParams creates a new UpdateProjectResourceMetadataParams object -// with the default values initialized. +// NewUpdateProjectResourceMetadataParams creates a new UpdateProjectResourceMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateProjectResourceMetadataParams() *UpdateProjectResourceMetadataParams { - var () return &UpdateProjectResourceMetadataParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateProjectResourceMetadataParamsWithTimeout creates a new UpdateProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateProjectResourceMetadataParamsWithTimeout(timeout time.Duration) *UpdateProjectResourceMetadataParams { - var () return &UpdateProjectResourceMetadataParams{ - timeout: timeout, } } // NewUpdateProjectResourceMetadataParamsWithContext creates a new UpdateProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateProjectResourceMetadataParamsWithContext(ctx context.Context) *UpdateProjectResourceMetadataParams { - var () return &UpdateProjectResourceMetadataParams{ - Context: ctx, } } // NewUpdateProjectResourceMetadataParamsWithHTTPClient creates a new UpdateProjectResourceMetadataParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateProjectResourceMetadataParamsWithHTTPClient(client *http.Client) *UpdateProjectResourceMetadataParams { - var () return &UpdateProjectResourceMetadataParams{ HTTPClient: client, } } -/*UpdateProjectResourceMetadataParams contains all the parameters to send to the API endpoint -for the update project resource metadata operation typically these are written to a http.Request +/* UpdateProjectResourceMetadataParams contains all the parameters to send to the API endpoint + for the update project resource metadata operation. + + Typically these are written to a http.Request. */ type UpdateProjectResourceMetadataParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Project specification + /* Body. + + Project specification */ Body *models.ProjectResourceMetadataSpecification - /*ID - The ID of the project. + /* ID. + + The ID of the project. */ ID string @@ -83,6 +84,21 @@ type UpdateProjectResourceMetadataParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update project resource metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateProjectResourceMetadataParams) WithDefaults() *UpdateProjectResourceMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update project resource metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateProjectResourceMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update project resource metadata params func (o *UpdateProjectResourceMetadataParams) WithTimeout(timeout time.Duration) *UpdateProjectResourceMetadataParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateProjectResourceMetadataParams) WriteToRequest(r runtime.ClientReq // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/project/update_project_resource_metadata_responses.go b/pkg/client/project/update_project_resource_metadata_responses.go index 7b8f176c..5c5e3394 100644 --- a/pkg/client/project/update_project_resource_metadata_responses.go +++ b/pkg/client/project/update_project_resource_metadata_responses.go @@ -41,7 +41,6 @@ func (o *UpdateProjectResourceMetadataReader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateProjectResourceMetadataOK() *UpdateProjectResourceMetadataOK { return &UpdateProjectResourceMetadataOK{} } -/*UpdateProjectResourceMetadataOK handles this case with default header values. +/* UpdateProjectResourceMetadataOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateProjectResourceMetadataOK struct { func (o *UpdateProjectResourceMetadataOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/projects/{id}/resource-metadata][%d] updateProjectResourceMetadataOK %+v", 200, o.Payload) } - func (o *UpdateProjectResourceMetadataOK) GetPayload() *models.Project { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateProjectResourceMetadataBadRequest() *UpdateProjectResourceMetadata return &UpdateProjectResourceMetadataBadRequest{} } -/*UpdateProjectResourceMetadataBadRequest handles this case with default header values. +/* UpdateProjectResourceMetadataBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateProjectResourceMetadataBadRequest struct { func (o *UpdateProjectResourceMetadataBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/projects/{id}/resource-metadata][%d] updateProjectResourceMetadataBadRequest %+v", 400, o.Payload) } - func (o *UpdateProjectResourceMetadataBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateProjectResourceMetadataForbidden() *UpdateProjectResourceMetadataF return &UpdateProjectResourceMetadataForbidden{} } -/*UpdateProjectResourceMetadataForbidden handles this case with default header values. +/* UpdateProjectResourceMetadataForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateProjectResourceMetadataForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateProjectResourceMetadataForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/projects/{id}/resource-metadata][%d] updateProjectResourceMetadataForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/projects/{id}/resource-metadata][%d] updateProjectResourceMetadataForbidden %+v", 403, o.Payload) +} +func (o *UpdateProjectResourceMetadataForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateProjectResourceMetadataForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/project/update_project_responses.go b/pkg/client/project/update_project_responses.go index 0b5ec32c..dee3a034 100644 --- a/pkg/client/project/update_project_responses.go +++ b/pkg/client/project/update_project_responses.go @@ -41,7 +41,6 @@ func (o *UpdateProjectReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateProjectOK() *UpdateProjectOK { return &UpdateProjectOK{} } -/*UpdateProjectOK handles this case with default header values. +/* UpdateProjectOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateProjectOK struct { func (o *UpdateProjectOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/projects/{id}][%d] updateProjectOK %+v", 200, o.Payload) } - func (o *UpdateProjectOK) GetPayload() *models.Project { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateProjectBadRequest() *UpdateProjectBadRequest { return &UpdateProjectBadRequest{} } -/*UpdateProjectBadRequest handles this case with default header values. +/* UpdateProjectBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateProjectBadRequest struct { func (o *UpdateProjectBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/projects/{id}][%d] updateProjectBadRequest %+v", 400, o.Payload) } - func (o *UpdateProjectBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateProjectForbidden() *UpdateProjectForbidden { return &UpdateProjectForbidden{} } -/*UpdateProjectForbidden handles this case with default header values. +/* UpdateProjectForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateProjectForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateProjectForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/projects/{id}][%d] updateProjectForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/projects/{id}][%d] updateProjectForbidden %+v", 403, o.Payload) +} +func (o *UpdateProjectForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateProjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/request/delete_request_parameters.go b/pkg/client/request/delete_request_parameters.go index 3421e6a0..66ee1d1e 100644 --- a/pkg/client/request/delete_request_parameters.go +++ b/pkg/client/request/delete_request_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteRequestParams creates a new DeleteRequestParams object -// with the default values initialized. +// NewDeleteRequestParams creates a new DeleteRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteRequestParams() *DeleteRequestParams { - var () return &DeleteRequestParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteRequestParamsWithTimeout creates a new DeleteRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteRequestParamsWithTimeout(timeout time.Duration) *DeleteRequestParams { - var () return &DeleteRequestParams{ - timeout: timeout, } } // NewDeleteRequestParamsWithContext creates a new DeleteRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteRequestParamsWithContext(ctx context.Context) *DeleteRequestParams { - var () return &DeleteRequestParams{ - Context: ctx, } } // NewDeleteRequestParamsWithHTTPClient creates a new DeleteRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteRequestParamsWithHTTPClient(client *http.Client) *DeleteRequestParams { - var () return &DeleteRequestParams{ HTTPClient: client, } } -/*DeleteRequestParams contains all the parameters to send to the API endpoint -for the delete request operation typically these are written to a http.Request +/* DeleteRequestParams contains all the parameters to send to the API endpoint + for the delete request operation. + + Typically these are written to a http.Request. */ type DeleteRequestParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the request. + /* ID. + + The ID of the request. */ ID string @@ -76,6 +76,21 @@ type DeleteRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRequestParams) WithDefaults() *DeleteRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete request params func (o *DeleteRequestParams) WithTimeout(timeout time.Duration) *DeleteRequestParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/request/delete_request_responses.go b/pkg/client/request/delete_request_responses.go index 7e1af721..acfd449a 100644 --- a/pkg/client/request/delete_request_responses.go +++ b/pkg/client/request/delete_request_responses.go @@ -7,9 +7,12 @@ package request import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteRequestReader is a Reader for the DeleteRequest structure. @@ -32,7 +35,6 @@ func (o *DeleteRequestReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteRequestNoContent() *DeleteRequestNoContent { return &DeleteRequestNoContent{} } -/*DeleteRequestNoContent handles this case with default header values. +/* DeleteRequestNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteRequestForbidden() *DeleteRequestForbidden { return &DeleteRequestForbidden{} } -/*DeleteRequestForbidden handles this case with default header values. +/* DeleteRequestForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteRequestForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteRequestForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/request-tracker/{id}][%d] deleteRequestForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/request-tracker/{id}][%d] deleteRequestForbidden %+v", 403, o.Payload) +} +func (o *DeleteRequestForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteRequestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/request/get_request_tracker_parameters.go b/pkg/client/request/get_request_tracker_parameters.go index 2e779671..e3bcd307 100644 --- a/pkg/client/request/get_request_tracker_parameters.go +++ b/pkg/client/request/get_request_tracker_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetRequestTrackerParams creates a new GetRequestTrackerParams object -// with the default values initialized. +// NewGetRequestTrackerParams creates a new GetRequestTrackerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRequestTrackerParams() *GetRequestTrackerParams { - var () return &GetRequestTrackerParams{ - timeout: cr.DefaultTimeout, } } // NewGetRequestTrackerParamsWithTimeout creates a new GetRequestTrackerParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRequestTrackerParamsWithTimeout(timeout time.Duration) *GetRequestTrackerParams { - var () return &GetRequestTrackerParams{ - timeout: timeout, } } // NewGetRequestTrackerParamsWithContext creates a new GetRequestTrackerParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRequestTrackerParamsWithContext(ctx context.Context) *GetRequestTrackerParams { - var () return &GetRequestTrackerParams{ - Context: ctx, } } // NewGetRequestTrackerParamsWithHTTPClient creates a new GetRequestTrackerParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRequestTrackerParamsWithHTTPClient(client *http.Client) *GetRequestTrackerParams { - var () return &GetRequestTrackerParams{ HTTPClient: client, } } -/*GetRequestTrackerParams contains all the parameters to send to the API endpoint -for the get request tracker operation typically these are written to a http.Request +/* GetRequestTrackerParams contains all the parameters to send to the API endpoint + for the get request tracker operation. + + Typically these are written to a http.Request. */ type GetRequestTrackerParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the request. + /* ID. + + The ID of the request. */ ID string @@ -76,6 +76,21 @@ type GetRequestTrackerParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get request tracker params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestTrackerParams) WithDefaults() *GetRequestTrackerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get request tracker params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestTrackerParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get request tracker params func (o *GetRequestTrackerParams) WithTimeout(timeout time.Duration) *GetRequestTrackerParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetRequestTrackerParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/request/get_request_tracker_responses.go b/pkg/client/request/get_request_tracker_responses.go index c6ed6686..401d77ff 100644 --- a/pkg/client/request/get_request_tracker_responses.go +++ b/pkg/client/request/get_request_tracker_responses.go @@ -41,7 +41,6 @@ func (o *GetRequestTrackerReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetRequestTrackerOK() *GetRequestTrackerOK { return &GetRequestTrackerOK{} } -/*GetRequestTrackerOK handles this case with default header values. +/* GetRequestTrackerOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetRequestTrackerOK struct { func (o *GetRequestTrackerOK) Error() string { return fmt.Sprintf("[GET /iaas/api/request-tracker/{id}][%d] getRequestTrackerOK %+v", 200, o.Payload) } - func (o *GetRequestTrackerOK) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,19 +83,30 @@ func NewGetRequestTrackerForbidden() *GetRequestTrackerForbidden { return &GetRequestTrackerForbidden{} } -/*GetRequestTrackerForbidden handles this case with default header values. +/* GetRequestTrackerForbidden describes a response with status code 403, with default header values. Forbidden */ type GetRequestTrackerForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetRequestTrackerForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/request-tracker/{id}][%d] getRequestTrackerForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/request-tracker/{id}][%d] getRequestTrackerForbidden %+v", 403, o.Payload) +} +func (o *GetRequestTrackerForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetRequestTrackerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetRequestTrackerNotFound() *GetRequestTrackerNotFound { return &GetRequestTrackerNotFound{} } -/*GetRequestTrackerNotFound handles this case with default header values. +/* GetRequestTrackerNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetRequestTrackerNotFound struct { func (o *GetRequestTrackerNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/request-tracker/{id}][%d] getRequestTrackerNotFound %+v", 404, o.Payload) } - func (o *GetRequestTrackerNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/request/get_request_trackers_parameters.go b/pkg/client/request/get_request_trackers_parameters.go index 2cd89aea..4aad024b 100644 --- a/pkg/client/request/get_request_trackers_parameters.go +++ b/pkg/client/request/get_request_trackers_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetRequestTrackersParams creates a new GetRequestTrackersParams object -// with the default values initialized. +// NewGetRequestTrackersParams creates a new GetRequestTrackersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetRequestTrackersParams() *GetRequestTrackersParams { - var () return &GetRequestTrackersParams{ - timeout: cr.DefaultTimeout, } } // NewGetRequestTrackersParamsWithTimeout creates a new GetRequestTrackersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetRequestTrackersParamsWithTimeout(timeout time.Duration) *GetRequestTrackersParams { - var () return &GetRequestTrackersParams{ - timeout: timeout, } } // NewGetRequestTrackersParamsWithContext creates a new GetRequestTrackersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetRequestTrackersParamsWithContext(ctx context.Context) *GetRequestTrackersParams { - var () return &GetRequestTrackersParams{ - Context: ctx, } } // NewGetRequestTrackersParamsWithHTTPClient creates a new GetRequestTrackersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetRequestTrackersParamsWithHTTPClient(client *http.Client) *GetRequestTrackersParams { - var () return &GetRequestTrackersParams{ HTTPClient: client, } } -/*GetRequestTrackersParams contains all the parameters to send to the API endpoint -for the get request trackers operation typically these are written to a http.Request +/* GetRequestTrackersParams contains all the parameters to send to the API endpoint + for the get request trackers operation. + + Typically these are written to a http.Request. */ type GetRequestTrackersParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -71,6 +70,21 @@ type GetRequestTrackersParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get request trackers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestTrackersParams) WithDefaults() *GetRequestTrackersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get request trackers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRequestTrackersParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get request trackers params func (o *GetRequestTrackersParams) WithTimeout(timeout time.Duration) *GetRequestTrackersParams { o.SetTimeout(timeout) @@ -127,16 +141,17 @@ func (o *GetRequestTrackersParams) WriteToRequest(r runtime.ClientRequest, reg s // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/request/get_request_trackers_responses.go b/pkg/client/request/get_request_trackers_responses.go index 9340325e..c16b41ab 100644 --- a/pkg/client/request/get_request_trackers_responses.go +++ b/pkg/client/request/get_request_trackers_responses.go @@ -35,7 +35,6 @@ func (o *GetRequestTrackersReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetRequestTrackersOK() *GetRequestTrackersOK { return &GetRequestTrackersOK{} } -/*GetRequestTrackersOK handles this case with default header values. +/* GetRequestTrackersOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetRequestTrackersOK struct { func (o *GetRequestTrackersOK) Error() string { return fmt.Sprintf("[GET /iaas/api/request-tracker][%d] getRequestTrackersOK %+v", 200, o.Payload) } - func (o *GetRequestTrackersOK) GetPayload() *models.RequestTrackerResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetRequestTrackersForbidden() *GetRequestTrackersForbidden { return &GetRequestTrackersForbidden{} } -/*GetRequestTrackersForbidden handles this case with default header values. +/* GetRequestTrackersForbidden describes a response with status code 403, with default header values. Forbidden */ type GetRequestTrackersForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetRequestTrackersForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/request-tracker][%d] getRequestTrackersForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/request-tracker][%d] getRequestTrackersForbidden %+v", 403, o.Payload) +} +func (o *GetRequestTrackersForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetRequestTrackersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/request/request_client.go b/pkg/client/request/request_client.go index b1b82d23..69c95c3b 100644 --- a/pkg/client/request/request_client.go +++ b/pkg/client/request/request_client.go @@ -25,13 +25,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DeleteRequest(params *DeleteRequestParams) (*DeleteRequestNoContent, error) + DeleteRequest(params *DeleteRequestParams, opts ...ClientOption) (*DeleteRequestNoContent, error) - GetRequestTracker(params *GetRequestTrackerParams) (*GetRequestTrackerOK, error) + GetRequestTracker(params *GetRequestTrackerParams, opts ...ClientOption) (*GetRequestTrackerOK, error) - GetRequestTrackers(params *GetRequestTrackersParams) (*GetRequestTrackersOK, error) + GetRequestTrackers(params *GetRequestTrackersParams, opts ...ClientOption) (*GetRequestTrackersOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { Delete a single Request */ -func (a *Client) DeleteRequest(params *DeleteRequestParams) (*DeleteRequestNoContent, error) { +func (a *Client) DeleteRequest(params *DeleteRequestParams, opts ...ClientOption) (*DeleteRequestNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteRequest", Method: "DELETE", PathPattern: "/iaas/api/request-tracker/{id}", @@ -58,7 +60,12 @@ func (a *Client) DeleteRequest(params *DeleteRequestParams) (*DeleteRequestNoCon Reader: &DeleteRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) DeleteRequest(params *DeleteRequestParams) (*DeleteRequestNoCon Get request tracker with a given id */ -func (a *Client) GetRequestTracker(params *GetRequestTrackerParams) (*GetRequestTrackerOK, error) { +func (a *Client) GetRequestTracker(params *GetRequestTrackerParams, opts ...ClientOption) (*GetRequestTrackerOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRequestTrackerParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRequestTracker", Method: "GET", PathPattern: "/iaas/api/request-tracker/{id}", @@ -94,7 +100,12 @@ func (a *Client) GetRequestTracker(params *GetRequestTrackerParams) (*GetRequest Reader: &GetRequestTrackerReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) GetRequestTracker(params *GetRequestTrackerParams) (*GetRequest Get all request trackers */ -func (a *Client) GetRequestTrackers(params *GetRequestTrackersParams) (*GetRequestTrackersOK, error) { +func (a *Client) GetRequestTrackers(params *GetRequestTrackersParams, opts ...ClientOption) (*GetRequestTrackersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetRequestTrackersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getRequestTrackers", Method: "GET", PathPattern: "/iaas/api/request-tracker", @@ -130,7 +140,12 @@ func (a *Client) GetRequestTrackers(params *GetRequestTrackersParams) (*GetReque Reader: &GetRequestTrackersReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/resource_types/get_resource_type_using_get_mixin1_parameters.go b/pkg/client/resource_types/get_resource_type_using_get_mixin1_parameters.go index 42bd97f9..ae575e0f 100644 --- a/pkg/client/resource_types/get_resource_type_using_get_mixin1_parameters.go +++ b/pkg/client/resource_types/get_resource_type_using_get_mixin1_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourceTypeUsingGETMixin1Params creates a new GetResourceTypeUsingGETMixin1Params object -// with the default values initialized. +// NewGetResourceTypeUsingGETMixin1Params creates a new GetResourceTypeUsingGETMixin1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetResourceTypeUsingGETMixin1Params() *GetResourceTypeUsingGETMixin1Params { - var () return &GetResourceTypeUsingGETMixin1Params{ - timeout: cr.DefaultTimeout, } } // NewGetResourceTypeUsingGETMixin1ParamsWithTimeout creates a new GetResourceTypeUsingGETMixin1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourceTypeUsingGETMixin1ParamsWithTimeout(timeout time.Duration) *GetResourceTypeUsingGETMixin1Params { - var () return &GetResourceTypeUsingGETMixin1Params{ - timeout: timeout, } } // NewGetResourceTypeUsingGETMixin1ParamsWithContext creates a new GetResourceTypeUsingGETMixin1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourceTypeUsingGETMixin1ParamsWithContext(ctx context.Context) *GetResourceTypeUsingGETMixin1Params { - var () return &GetResourceTypeUsingGETMixin1Params{ - Context: ctx, } } // NewGetResourceTypeUsingGETMixin1ParamsWithHTTPClient creates a new GetResourceTypeUsingGETMixin1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourceTypeUsingGETMixin1ParamsWithHTTPClient(client *http.Client) *GetResourceTypeUsingGETMixin1Params { - var () return &GetResourceTypeUsingGETMixin1Params{ HTTPClient: client, } } -/*GetResourceTypeUsingGETMixin1Params contains all the parameters to send to the API endpoint -for the get resource type using g e t mixin1 operation typically these are written to a http.Request +/* GetResourceTypeUsingGETMixin1Params contains all the parameters to send to the API endpoint + for the get resource type using g e t mixin1 operation. + + Typically these are written to a http.Request. */ type GetResourceTypeUsingGETMixin1Params struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ResourceTypeID - resourceTypeId + /* ResourceTypeID. + + resourceTypeId */ ResourceTypeID string @@ -76,6 +76,21 @@ type GetResourceTypeUsingGETMixin1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resource type using g e t mixin1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceTypeUsingGETMixin1Params) WithDefaults() *GetResourceTypeUsingGETMixin1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource type using g e t mixin1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceTypeUsingGETMixin1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resource type using g e t mixin1 params func (o *GetResourceTypeUsingGETMixin1Params) WithTimeout(timeout time.Duration) *GetResourceTypeUsingGETMixin1Params { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetResourceTypeUsingGETMixin1Params) WriteToRequest(r runtime.ClientReq // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param resourceTypeId diff --git a/pkg/client/resource_types/get_resource_type_using_get_mixin1_responses.go b/pkg/client/resource_types/get_resource_type_using_get_mixin1_responses.go index bd673646..af071b62 100644 --- a/pkg/client/resource_types/get_resource_type_using_get_mixin1_responses.go +++ b/pkg/client/resource_types/get_resource_type_using_get_mixin1_responses.go @@ -41,7 +41,6 @@ func (o *GetResourceTypeUsingGETMixin1Reader) ReadResponse(response runtime.Clie return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetResourceTypeUsingGETMixin1OK() *GetResourceTypeUsingGETMixin1OK { return &GetResourceTypeUsingGETMixin1OK{} } -/*GetResourceTypeUsingGETMixin1OK handles this case with default header values. +/* GetResourceTypeUsingGETMixin1OK describes a response with status code 200, with default header values. OK */ @@ -63,7 +62,6 @@ type GetResourceTypeUsingGETMixin1OK struct { func (o *GetResourceTypeUsingGETMixin1OK) Error() string { return fmt.Sprintf("[GET /deployment/api/resource-types/{resourceTypeId}][%d] getResourceTypeUsingGETMixin1OK %+v", 200, o.Payload) } - func (o *GetResourceTypeUsingGETMixin1OK) GetPayload() *models.DeploymentResourceType { return o.Payload } @@ -85,7 +83,7 @@ func NewGetResourceTypeUsingGETMixin1Unauthorized() *GetResourceTypeUsingGETMixi return &GetResourceTypeUsingGETMixin1Unauthorized{} } -/*GetResourceTypeUsingGETMixin1Unauthorized handles this case with default header values. +/* GetResourceTypeUsingGETMixin1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -106,7 +104,7 @@ func NewGetResourceTypeUsingGETMixin1NotFound() *GetResourceTypeUsingGETMixin1No return &GetResourceTypeUsingGETMixin1NotFound{} } -/*GetResourceTypeUsingGETMixin1NotFound handles this case with default header values. +/* GetResourceTypeUsingGETMixin1NotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +115,6 @@ type GetResourceTypeUsingGETMixin1NotFound struct { func (o *GetResourceTypeUsingGETMixin1NotFound) Error() string { return fmt.Sprintf("[GET /deployment/api/resource-types/{resourceTypeId}][%d] getResourceTypeUsingGETMixin1NotFound %+v", 404, o.Payload) } - func (o *GetResourceTypeUsingGETMixin1NotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/resource_types/get_resource_type_using_get_parameters.go b/pkg/client/resource_types/get_resource_type_using_get_parameters.go index f509fd19..9990b3f9 100644 --- a/pkg/client/resource_types/get_resource_type_using_get_parameters.go +++ b/pkg/client/resource_types/get_resource_type_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourceTypeUsingGETParams creates a new GetResourceTypeUsingGETParams object -// with the default values initialized. +// NewGetResourceTypeUsingGETParams creates a new GetResourceTypeUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetResourceTypeUsingGETParams() *GetResourceTypeUsingGETParams { - var () return &GetResourceTypeUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetResourceTypeUsingGETParamsWithTimeout creates a new GetResourceTypeUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourceTypeUsingGETParamsWithTimeout(timeout time.Duration) *GetResourceTypeUsingGETParams { - var () return &GetResourceTypeUsingGETParams{ - timeout: timeout, } } // NewGetResourceTypeUsingGETParamsWithContext creates a new GetResourceTypeUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourceTypeUsingGETParamsWithContext(ctx context.Context) *GetResourceTypeUsingGETParams { - var () return &GetResourceTypeUsingGETParams{ - Context: ctx, } } // NewGetResourceTypeUsingGETParamsWithHTTPClient creates a new GetResourceTypeUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourceTypeUsingGETParamsWithHTTPClient(client *http.Client) *GetResourceTypeUsingGETParams { - var () return &GetResourceTypeUsingGETParams{ HTTPClient: client, } } -/*GetResourceTypeUsingGETParams contains all the parameters to send to the API endpoint -for the get resource type using g e t operation typically these are written to a http.Request +/* GetResourceTypeUsingGETParams contains all the parameters to send to the API endpoint + for the get resource type using g e t operation. + + Typically these are written to a http.Request. */ type GetResourceTypeUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*ResourceTypeID - resourceTypeId + /* ResourceTypeID. + + resourceTypeId */ ResourceTypeID string @@ -76,6 +76,21 @@ type GetResourceTypeUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resource type using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceTypeUsingGETParams) WithDefaults() *GetResourceTypeUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource type using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceTypeUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resource type using get params func (o *GetResourceTypeUsingGETParams) WithTimeout(timeout time.Duration) *GetResourceTypeUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetResourceTypeUsingGETParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param resourceTypeId diff --git a/pkg/client/resource_types/get_resource_type_using_get_responses.go b/pkg/client/resource_types/get_resource_type_using_get_responses.go index 3bb1d8e8..bcd33a59 100644 --- a/pkg/client/resource_types/get_resource_type_using_get_responses.go +++ b/pkg/client/resource_types/get_resource_type_using_get_responses.go @@ -47,7 +47,6 @@ func (o *GetResourceTypeUsingGETReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetResourceTypeUsingGETOK() *GetResourceTypeUsingGETOK { return &GetResourceTypeUsingGETOK{} } -/*GetResourceTypeUsingGETOK handles this case with default header values. +/* GetResourceTypeUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type GetResourceTypeUsingGETOK struct { func (o *GetResourceTypeUsingGETOK) Error() string { return fmt.Sprintf("[GET /blueprint/api/resource-types/{resourceTypeId}][%d] getResourceTypeUsingGETOK %+v", 200, o.Payload) } - func (o *GetResourceTypeUsingGETOK) GetPayload() *models.ResourceType { return o.Payload } @@ -91,7 +89,7 @@ func NewGetResourceTypeUsingGETUnauthorized() *GetResourceTypeUsingGETUnauthoriz return &GetResourceTypeUsingGETUnauthorized{} } -/*GetResourceTypeUsingGETUnauthorized handles this case with default header values. +/* GetResourceTypeUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -112,7 +110,7 @@ func NewGetResourceTypeUsingGETForbidden() *GetResourceTypeUsingGETForbidden { return &GetResourceTypeUsingGETForbidden{} } -/*GetResourceTypeUsingGETForbidden handles this case with default header values. +/* GetResourceTypeUsingGETForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -133,7 +131,7 @@ func NewGetResourceTypeUsingGETNotFound() *GetResourceTypeUsingGETNotFound { return &GetResourceTypeUsingGETNotFound{} } -/*GetResourceTypeUsingGETNotFound handles this case with default header values. +/* GetResourceTypeUsingGETNotFound describes a response with status code 404, with default header values. Not Found */ @@ -144,7 +142,6 @@ type GetResourceTypeUsingGETNotFound struct { func (o *GetResourceTypeUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /blueprint/api/resource-types/{resourceTypeId}][%d] getResourceTypeUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetResourceTypeUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/resource_types/list_resource_types_using_get_mixin1_parameters.go b/pkg/client/resource_types/list_resource_types_using_get_mixin1_parameters.go index a1e00e9e..f8b996d2 100644 --- a/pkg/client/resource_types/list_resource_types_using_get_mixin1_parameters.go +++ b/pkg/client/resource_types/list_resource_types_using_get_mixin1_parameters.go @@ -17,93 +17,104 @@ import ( "github.com/go-openapi/swag" ) -// NewListResourceTypesUsingGETMixin1Params creates a new ListResourceTypesUsingGETMixin1Params object -// with the default values initialized. +// NewListResourceTypesUsingGETMixin1Params creates a new ListResourceTypesUsingGETMixin1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListResourceTypesUsingGETMixin1Params() *ListResourceTypesUsingGETMixin1Params { - var () return &ListResourceTypesUsingGETMixin1Params{ - timeout: cr.DefaultTimeout, } } // NewListResourceTypesUsingGETMixin1ParamsWithTimeout creates a new ListResourceTypesUsingGETMixin1Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListResourceTypesUsingGETMixin1ParamsWithTimeout(timeout time.Duration) *ListResourceTypesUsingGETMixin1Params { - var () return &ListResourceTypesUsingGETMixin1Params{ - timeout: timeout, } } // NewListResourceTypesUsingGETMixin1ParamsWithContext creates a new ListResourceTypesUsingGETMixin1Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListResourceTypesUsingGETMixin1ParamsWithContext(ctx context.Context) *ListResourceTypesUsingGETMixin1Params { - var () return &ListResourceTypesUsingGETMixin1Params{ - Context: ctx, } } // NewListResourceTypesUsingGETMixin1ParamsWithHTTPClient creates a new ListResourceTypesUsingGETMixin1Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListResourceTypesUsingGETMixin1ParamsWithHTTPClient(client *http.Client) *ListResourceTypesUsingGETMixin1Params { - var () return &ListResourceTypesUsingGETMixin1Params{ HTTPClient: client, } } -/*ListResourceTypesUsingGETMixin1Params contains all the parameters to send to the API endpoint -for the list resource types using g e t mixin1 operation typically these are written to a http.Request +/* ListResourceTypesUsingGETMixin1Params contains all the parameters to send to the API endpoint + for the list resource types using g e t mixin1 operation. + + Typically these are written to a http.Request. */ type ListResourceTypesUsingGETMixin1Params struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). If you do not specify explicitly an exact version, you will be calling the latest supported API version. */ APIVersion *string - /*ComposableOnly - Include only composable resource types + /* ComposableOnly. + + Include only composable resource types */ ComposableOnly *bool - /*Ids - Filter by list of resource type ids + /* Ids. + + Filter by list of resource type ids */ Ids []string - /*ProjectIds - Filter by list of project ids + /* ProjectIds. + + Filter by list of project ids */ ProjectIds []string - /*ProviderID - Filter by provider ID + /* ProviderID. + + Filter by provider ID */ ProviderID *string - /*Search - Search by name and description + /* Search. + + Search by name and description */ Search *string @@ -112,6 +123,21 @@ type ListResourceTypesUsingGETMixin1Params struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list resource types using g e t mixin1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListResourceTypesUsingGETMixin1Params) WithDefaults() *ListResourceTypesUsingGETMixin1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list resource types using g e t mixin1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListResourceTypesUsingGETMixin1Params) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list resource types using g e t mixin1 params func (o *ListResourceTypesUsingGETMixin1Params) WithTimeout(timeout time.Duration) *ListResourceTypesUsingGETMixin1Params { o.SetTimeout(timeout) @@ -252,124 +278,139 @@ func (o *ListResourceTypesUsingGETMixin1Params) WriteToRequest(r runtime.ClientR } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ComposableOnly != nil { // query param composableOnly var qrComposableOnly bool + if o.ComposableOnly != nil { qrComposableOnly = *o.ComposableOnly } qComposableOnly := swag.FormatBool(qrComposableOnly) if qComposableOnly != "" { + if err := r.SetQueryParam("composableOnly", qComposableOnly); err != nil { return err } } - } - valuesIds := o.Ids + if o.Ids != nil { - joinedIds := swag.JoinByFormat(valuesIds, "multi") - // query array param ids - if err := r.SetQueryParam("ids", joinedIds...); err != nil { - return err + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } } - valuesProjectIds := o.ProjectIds + if o.ProjectIds != nil { - joinedProjectIds := swag.JoinByFormat(valuesProjectIds, "multi") - // query array param projectIds - if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { - return err + // binding items for projectIds + joinedProjectIds := o.bindParamProjectIds(reg) + + // query array param projectIds + if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { + return err + } } if o.ProviderID != nil { // query param providerId var qrProviderID string + if o.ProviderID != nil { qrProviderID = *o.ProviderID } qProviderID := qrProviderID if qProviderID != "" { + if err := r.SetQueryParam("providerId", qProviderID); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -377,3 +418,54 @@ func (o *ListResourceTypesUsingGETMixin1Params) WriteToRequest(r runtime.ClientR } return nil } + +// bindParamListResourceTypesUsingGETMixin1 binds the parameter $orderby +func (o *ListResourceTypesUsingGETMixin1Params) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} + +// bindParamListResourceTypesUsingGETMixin1 binds the parameter ids +func (o *ListResourceTypesUsingGETMixin1Params) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} + +// bindParamListResourceTypesUsingGETMixin1 binds the parameter projectIds +func (o *ListResourceTypesUsingGETMixin1Params) bindParamProjectIds(formats strfmt.Registry) []string { + projectIdsIR := o.ProjectIds + + var projectIdsIC []string + for _, projectIdsIIR := range projectIdsIR { // explode []string + + projectIdsIIV := projectIdsIIR // string as string + projectIdsIC = append(projectIdsIC, projectIdsIIV) + } + + // items.CollectionFormat: "multi" + projectIdsIS := swag.JoinByFormat(projectIdsIC, "multi") + + return projectIdsIS +} diff --git a/pkg/client/resource_types/list_resource_types_using_get_mixin1_responses.go b/pkg/client/resource_types/list_resource_types_using_get_mixin1_responses.go index c3f17e39..99a39d97 100644 --- a/pkg/client/resource_types/list_resource_types_using_get_mixin1_responses.go +++ b/pkg/client/resource_types/list_resource_types_using_get_mixin1_responses.go @@ -35,7 +35,6 @@ func (o *ListResourceTypesUsingGETMixin1Reader) ReadResponse(response runtime.Cl return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewListResourceTypesUsingGETMixin1OK() *ListResourceTypesUsingGETMixin1OK { return &ListResourceTypesUsingGETMixin1OK{} } -/*ListResourceTypesUsingGETMixin1OK handles this case with default header values. +/* ListResourceTypesUsingGETMixin1OK describes a response with status code 200, with default header values. OK */ @@ -57,7 +56,6 @@ type ListResourceTypesUsingGETMixin1OK struct { func (o *ListResourceTypesUsingGETMixin1OK) Error() string { return fmt.Sprintf("[GET /deployment/api/resource-types][%d] listResourceTypesUsingGETMixin1OK %+v", 200, o.Payload) } - func (o *ListResourceTypesUsingGETMixin1OK) GetPayload() *models.PageOfDeploymentResourceType { return o.Payload } @@ -79,7 +77,7 @@ func NewListResourceTypesUsingGETMixin1Unauthorized() *ListResourceTypesUsingGET return &ListResourceTypesUsingGETMixin1Unauthorized{} } -/*ListResourceTypesUsingGETMixin1Unauthorized handles this case with default header values. +/* ListResourceTypesUsingGETMixin1Unauthorized describes a response with status code 401, with default header values. Unauthorized */ diff --git a/pkg/client/resource_types/list_resource_types_using_get_parameters.go b/pkg/client/resource_types/list_resource_types_using_get_parameters.go index c6bef1cb..b0535645 100644 --- a/pkg/client/resource_types/list_resource_types_using_get_parameters.go +++ b/pkg/client/resource_types/list_resource_types_using_get_parameters.go @@ -17,100 +17,100 @@ import ( "github.com/go-openapi/swag" ) -// NewListResourceTypesUsingGETParams creates a new ListResourceTypesUsingGETParams object -// with the default values initialized. +// NewListResourceTypesUsingGETParams creates a new ListResourceTypesUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListResourceTypesUsingGETParams() *ListResourceTypesUsingGETParams { - var ( - expandDefault = bool(true) - ) return &ListResourceTypesUsingGETParams{ - Expand: &expandDefault, - timeout: cr.DefaultTimeout, } } // NewListResourceTypesUsingGETParamsWithTimeout creates a new ListResourceTypesUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListResourceTypesUsingGETParamsWithTimeout(timeout time.Duration) *ListResourceTypesUsingGETParams { - var ( - expandDefault = bool(true) - ) return &ListResourceTypesUsingGETParams{ - Expand: &expandDefault, - timeout: timeout, } } // NewListResourceTypesUsingGETParamsWithContext creates a new ListResourceTypesUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListResourceTypesUsingGETParamsWithContext(ctx context.Context) *ListResourceTypesUsingGETParams { - var ( - expandDefault = bool(true) - ) return &ListResourceTypesUsingGETParams{ - Expand: &expandDefault, - Context: ctx, } } // NewListResourceTypesUsingGETParamsWithHTTPClient creates a new ListResourceTypesUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListResourceTypesUsingGETParamsWithHTTPClient(client *http.Client) *ListResourceTypesUsingGETParams { - var ( - expandDefault = bool(true) - ) return &ListResourceTypesUsingGETParams{ - Expand: &expandDefault, HTTPClient: client, } } -/*ListResourceTypesUsingGETParams contains all the parameters to send to the API endpoint -for the list resource types using g e t operation typically these are written to a http.Request +/* ListResourceTypesUsingGETParams contains all the parameters to send to the API endpoint + for the list resource types using g e t operation. + + Typically these are written to a http.Request. */ type ListResourceTypesUsingGETParams struct { - /*DollarOrderby - Sorting criteria in the format: property (asc|desc). Default sort order is ascending on name. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name. + /* DollarOrderby. + Sorting criteria in the format: property (asc|desc). Default sort order is ascending on name. Sorting is supported on fields createdAt, updatedAt, createdBy, updatedBy, name. */ DollarOrderby []string - /*DollarSkip - Number of records you want to skip + /* DollarSkip. + + Number of records you want to skip + + Format: int32 */ DollarSkip *int32 - /*DollarTop - Number of records you want + /* DollarTop. + + Number of records you want + + Format: int32 */ DollarTop *int32 - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /blueprint/api/about */ APIVersion *string - /*Expand - Expand with content + /* Expand. + + Expand with content + + Default: true */ Expand *bool - /*Name - Filter by name + /* Name. + + Filter by name */ Name *string - /*ProviderID - Filter by provider ID + /* ProviderID. + + Filter by provider ID */ ProviderID *string - /*Search - Search by name and description + /* Search. + + Search by name and description */ Search *string @@ -119,6 +119,32 @@ type ListResourceTypesUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list resource types using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListResourceTypesUsingGETParams) WithDefaults() *ListResourceTypesUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list resource types using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListResourceTypesUsingGETParams) SetDefaults() { + var ( + expandDefault = bool(true) + ) + + val := ListResourceTypesUsingGETParams{ + Expand: &expandDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the list resource types using get params func (o *ListResourceTypesUsingGETParams) WithTimeout(timeout time.Duration) *ListResourceTypesUsingGETParams { o.SetTimeout(timeout) @@ -248,124 +274,134 @@ func (o *ListResourceTypesUsingGETParams) WriteToRequest(r runtime.ClientRequest } var res []error - valuesDollarOrderby := o.DollarOrderby + if o.DollarOrderby != nil { - joinedDollarOrderby := swag.JoinByFormat(valuesDollarOrderby, "multi") - // query array param $orderby - if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { - return err + // binding items for $orderby + joinedDollarOrderby := o.bindParamDollarOrderby(reg) + + // query array param $orderby + if err := r.SetQueryParam("$orderby", joinedDollarOrderby...); err != nil { + return err + } } if o.DollarSkip != nil { // query param $skip var qrDollarSkip int32 + if o.DollarSkip != nil { qrDollarSkip = *o.DollarSkip } qDollarSkip := swag.FormatInt32(qrDollarSkip) if qDollarSkip != "" { + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { return err } } - } if o.DollarTop != nil { // query param $top var qrDollarTop int32 + if o.DollarTop != nil { qrDollarTop = *o.DollarTop } qDollarTop := swag.FormatInt32(qrDollarTop) if qDollarTop != "" { + if err := r.SetQueryParam("$top", qDollarTop); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.Expand != nil { // query param expand var qrExpand bool + if o.Expand != nil { qrExpand = *o.Expand } qExpand := swag.FormatBool(qrExpand) if qExpand != "" { + if err := r.SetQueryParam("expand", qExpand); 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.ProviderID != nil { // query param providerId var qrProviderID string + if o.ProviderID != nil { qrProviderID = *o.ProviderID } qProviderID := qrProviderID if qProviderID != "" { + if err := r.SetQueryParam("providerId", qProviderID); err != nil { return err } } - } if o.Search != nil { // query param search var qrSearch string + if o.Search != nil { qrSearch = *o.Search } qSearch := qrSearch if qSearch != "" { + if err := r.SetQueryParam("search", qSearch); err != nil { return err } } - } if len(res) > 0 { @@ -373,3 +409,20 @@ func (o *ListResourceTypesUsingGETParams) WriteToRequest(r runtime.ClientRequest } return nil } + +// bindParamListResourceTypesUsingGET binds the parameter $orderby +func (o *ListResourceTypesUsingGETParams) bindParamDollarOrderby(formats strfmt.Registry) []string { + dollarOrderbyIR := o.DollarOrderby + + var dollarOrderbyIC []string + for _, dollarOrderbyIIR := range dollarOrderbyIR { // explode []string + + dollarOrderbyIIV := dollarOrderbyIIR // string as string + dollarOrderbyIC = append(dollarOrderbyIC, dollarOrderbyIIV) + } + + // items.CollectionFormat: "multi" + dollarOrderbyIS := swag.JoinByFormat(dollarOrderbyIC, "multi") + + return dollarOrderbyIS +} diff --git a/pkg/client/resource_types/list_resource_types_using_get_responses.go b/pkg/client/resource_types/list_resource_types_using_get_responses.go index 237a2c6e..8bf25c40 100644 --- a/pkg/client/resource_types/list_resource_types_using_get_responses.go +++ b/pkg/client/resource_types/list_resource_types_using_get_responses.go @@ -47,7 +47,6 @@ func (o *ListResourceTypesUsingGETReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewListResourceTypesUsingGETOK() *ListResourceTypesUsingGETOK { return &ListResourceTypesUsingGETOK{} } -/*ListResourceTypesUsingGETOK handles this case with default header values. +/* ListResourceTypesUsingGETOK describes a response with status code 200, with default header values. OK */ @@ -69,7 +68,6 @@ type ListResourceTypesUsingGETOK struct { func (o *ListResourceTypesUsingGETOK) Error() string { return fmt.Sprintf("[GET /blueprint/api/resource-types][%d] listResourceTypesUsingGETOK %+v", 200, o.Payload) } - func (o *ListResourceTypesUsingGETOK) GetPayload() *models.PageOfResourceType { return o.Payload } @@ -91,7 +89,7 @@ func NewListResourceTypesUsingGETBadRequest() *ListResourceTypesUsingGETBadReque return &ListResourceTypesUsingGETBadRequest{} } -/*ListResourceTypesUsingGETBadRequest handles this case with default header values. +/* ListResourceTypesUsingGETBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type ListResourceTypesUsingGETBadRequest struct { func (o *ListResourceTypesUsingGETBadRequest) Error() string { return fmt.Sprintf("[GET /blueprint/api/resource-types][%d] listResourceTypesUsingGETBadRequest %+v", 400, o.Payload) } - func (o *ListResourceTypesUsingGETBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewListResourceTypesUsingGETUnauthorized() *ListResourceTypesUsingGETUnauth return &ListResourceTypesUsingGETUnauthorized{} } -/*ListResourceTypesUsingGETUnauthorized handles this case with default header values. +/* ListResourceTypesUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewListResourceTypesUsingGETForbidden() *ListResourceTypesUsingGETForbidden return &ListResourceTypesUsingGETForbidden{} } -/*ListResourceTypesUsingGETForbidden handles this case with default header values. +/* ListResourceTypesUsingGETForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/resource_types/resource_types_client.go b/pkg/client/resource_types/resource_types_client.go index 081e7b4d..03e43b29 100644 --- a/pkg/client/resource_types/resource_types_client.go +++ b/pkg/client/resource_types/resource_types_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams) (*GetResourceTypeUsingGETOK, error) + GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams, opts ...ClientOption) (*GetResourceTypeUsingGETOK, error) - GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMixin1Params) (*GetResourceTypeUsingGETMixin1OK, error) + GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMixin1Params, opts ...ClientOption) (*GetResourceTypeUsingGETMixin1OK, error) - ListResourceTypesUsingGET(params *ListResourceTypesUsingGETParams) (*ListResourceTypesUsingGETOK, error) + ListResourceTypesUsingGET(params *ListResourceTypesUsingGETParams, opts ...ClientOption) (*ListResourceTypesUsingGETOK, error) - ListResourceTypesUsingGETMixin1(params *ListResourceTypesUsingGETMixin1Params) (*ListResourceTypesUsingGETMixin1OK, error) + ListResourceTypesUsingGETMixin1(params *ListResourceTypesUsingGETMixin1Params, opts ...ClientOption) (*ListResourceTypesUsingGETMixin1OK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* GetResourceTypeUsingGET returns resource type details */ -func (a *Client) GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams) (*GetResourceTypeUsingGETOK, error) { +func (a *Client) GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams, opts ...ClientOption) (*GetResourceTypeUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourceTypeUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getResourceTypeUsingGET", Method: "GET", PathPattern: "/blueprint/api/resource-types/{resourceTypeId}", @@ -58,7 +60,12 @@ func (a *Client) GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams) Reader: &GetResourceTypeUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) GetResourceTypeUsingGET(params *GetResourceTypeUsingGETParams) Returns the Resource type with the supplied ID. */ -func (a *Client) GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMixin1Params) (*GetResourceTypeUsingGETMixin1OK, error) { +func (a *Client) GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMixin1Params, opts ...ClientOption) (*GetResourceTypeUsingGETMixin1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourceTypeUsingGETMixin1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getResourceTypeUsingGETMixin1", Method: "GET", PathPattern: "/deployment/api/resource-types/{resourceTypeId}", @@ -94,7 +100,12 @@ func (a *Client) GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMi Reader: &GetResourceTypeUsingGETMixin1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -111,13 +122,12 @@ func (a *Client) GetResourceTypeUsingGETMixin1(params *GetResourceTypeUsingGETMi /* ListResourceTypesUsingGET lists resource types */ -func (a *Client) ListResourceTypesUsingGET(params *ListResourceTypesUsingGETParams) (*ListResourceTypesUsingGETOK, error) { +func (a *Client) ListResourceTypesUsingGET(params *ListResourceTypesUsingGETParams, opts ...ClientOption) (*ListResourceTypesUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListResourceTypesUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listResourceTypesUsingGET", Method: "GET", PathPattern: "/blueprint/api/resource-types", @@ -128,7 +138,12 @@ func (a *Client) ListResourceTypesUsingGET(params *ListResourceTypesUsingGETPara Reader: &ListResourceTypesUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -147,13 +162,12 @@ func (a *Client) ListResourceTypesUsingGET(params *ListResourceTypesUsingGETPara Returns a paginated list of Resource Types. */ -func (a *Client) ListResourceTypesUsingGETMixin1(params *ListResourceTypesUsingGETMixin1Params) (*ListResourceTypesUsingGETMixin1OK, error) { +func (a *Client) ListResourceTypesUsingGETMixin1(params *ListResourceTypesUsingGETMixin1Params, opts ...ClientOption) (*ListResourceTypesUsingGETMixin1OK, error) { // TODO: Validate the params before sending if params == nil { params = NewListResourceTypesUsingGETMixin1Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listResourceTypesUsingGETMixin1", Method: "GET", PathPattern: "/deployment/api/resource-types", @@ -164,7 +178,12 @@ func (a *Client) ListResourceTypesUsingGETMixin1(params *ListResourceTypesUsingG Reader: &ListResourceTypesUsingGETMixin1Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/security_group/change_security_groups_parameters.go b/pkg/client/security_group/change_security_groups_parameters.go index 3937eb19..58163221 100644 --- a/pkg/client/security_group/change_security_groups_parameters.go +++ b/pkg/client/security_group/change_security_groups_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewChangeSecurityGroupsParams creates a new ChangeSecurityGroupsParams object -// with the default values initialized. +// NewChangeSecurityGroupsParams creates a new ChangeSecurityGroupsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewChangeSecurityGroupsParams() *ChangeSecurityGroupsParams { - var () return &ChangeSecurityGroupsParams{ - timeout: cr.DefaultTimeout, } } // NewChangeSecurityGroupsParamsWithTimeout creates a new ChangeSecurityGroupsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeSecurityGroupsParamsWithTimeout(timeout time.Duration) *ChangeSecurityGroupsParams { - var () return &ChangeSecurityGroupsParams{ - timeout: timeout, } } // NewChangeSecurityGroupsParamsWithContext creates a new ChangeSecurityGroupsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeSecurityGroupsParamsWithContext(ctx context.Context) *ChangeSecurityGroupsParams { - var () return &ChangeSecurityGroupsParams{ - Context: ctx, } } // NewChangeSecurityGroupsParamsWithHTTPClient creates a new ChangeSecurityGroupsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeSecurityGroupsParamsWithHTTPClient(client *http.Client) *ChangeSecurityGroupsParams { - var () return &ChangeSecurityGroupsParams{ HTTPClient: client, } } -/*ChangeSecurityGroupsParams contains all the parameters to send to the API endpoint -for the change security groups operation typically these are written to a http.Request +/* ChangeSecurityGroupsParams contains all the parameters to send to the API endpoint + for the change security groups operation. + + Typically these are written to a http.Request. */ type ChangeSecurityGroupsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Change security groups details + /* Body. + + Change security groups details */ Body *models.ChangeSecurityGroupSpecification - /*ID - The id of the vSphere machine. + /* ID. + + The id of the vSphere machine. */ ID string @@ -83,6 +84,21 @@ type ChangeSecurityGroupsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change security groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeSecurityGroupsParams) WithDefaults() *ChangeSecurityGroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change security groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeSecurityGroupsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change security groups params func (o *ChangeSecurityGroupsParams) WithTimeout(timeout time.Duration) *ChangeSecurityGroupsParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *ChangeSecurityGroupsParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/security_group/change_security_groups_responses.go b/pkg/client/security_group/change_security_groups_responses.go index 4f0aea68..809c3047 100644 --- a/pkg/client/security_group/change_security_groups_responses.go +++ b/pkg/client/security_group/change_security_groups_responses.go @@ -47,7 +47,6 @@ func (o *ChangeSecurityGroupsReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewChangeSecurityGroupsAccepted() *ChangeSecurityGroupsAccepted { return &ChangeSecurityGroupsAccepted{} } -/*ChangeSecurityGroupsAccepted handles this case with default header values. +/* ChangeSecurityGroupsAccepted describes a response with status code 202, with default header values. successful operation */ @@ -69,7 +68,6 @@ type ChangeSecurityGroupsAccepted struct { func (o *ChangeSecurityGroupsAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/change-security-groups][%d] changeSecurityGroupsAccepted %+v", 202, o.Payload) } - func (o *ChangeSecurityGroupsAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -91,7 +89,7 @@ func NewChangeSecurityGroupsBadRequest() *ChangeSecurityGroupsBadRequest { return &ChangeSecurityGroupsBadRequest{} } -/*ChangeSecurityGroupsBadRequest handles this case with default header values. +/* ChangeSecurityGroupsBadRequest describes a response with status code 400, with default header values. Change security groups action is not supported for a machine cluster */ @@ -102,7 +100,6 @@ type ChangeSecurityGroupsBadRequest struct { func (o *ChangeSecurityGroupsBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/change-security-groups][%d] changeSecurityGroupsBadRequest %+v", 400, o.Payload) } - func (o *ChangeSecurityGroupsBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,19 +121,30 @@ func NewChangeSecurityGroupsForbidden() *ChangeSecurityGroupsForbidden { return &ChangeSecurityGroupsForbidden{} } -/*ChangeSecurityGroupsForbidden handles this case with default header values. +/* ChangeSecurityGroupsForbidden describes a response with status code 403, with default header values. Forbidden */ type ChangeSecurityGroupsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ChangeSecurityGroupsForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/change-security-groups][%d] changeSecurityGroupsForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/change-security-groups][%d] changeSecurityGroupsForbidden %+v", 403, o.Payload) +} +func (o *ChangeSecurityGroupsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ChangeSecurityGroupsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -145,7 +153,7 @@ func NewChangeSecurityGroupsNotFound() *ChangeSecurityGroupsNotFound { return &ChangeSecurityGroupsNotFound{} } -/*ChangeSecurityGroupsNotFound handles this case with default header values. +/* ChangeSecurityGroupsNotFound describes a response with status code 404, with default header values. Not Found */ @@ -156,7 +164,6 @@ type ChangeSecurityGroupsNotFound struct { func (o *ChangeSecurityGroupsNotFound) Error() string { return fmt.Sprintf("[POST /iaas/api/machines/{id}/operations/change-security-groups][%d] changeSecurityGroupsNotFound %+v", 404, o.Payload) } - func (o *ChangeSecurityGroupsNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/security_group/create_on_demand_security_group_parameters.go b/pkg/client/security_group/create_on_demand_security_group_parameters.go index e3f23dbd..9783d9c9 100644 --- a/pkg/client/security_group/create_on_demand_security_group_parameters.go +++ b/pkg/client/security_group/create_on_demand_security_group_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateOnDemandSecurityGroupParams creates a new CreateOnDemandSecurityGroupParams object -// with the default values initialized. +// NewCreateOnDemandSecurityGroupParams creates a new CreateOnDemandSecurityGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateOnDemandSecurityGroupParams() *CreateOnDemandSecurityGroupParams { - var () return &CreateOnDemandSecurityGroupParams{ - timeout: cr.DefaultTimeout, } } // NewCreateOnDemandSecurityGroupParamsWithTimeout creates a new CreateOnDemandSecurityGroupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateOnDemandSecurityGroupParamsWithTimeout(timeout time.Duration) *CreateOnDemandSecurityGroupParams { - var () return &CreateOnDemandSecurityGroupParams{ - timeout: timeout, } } // NewCreateOnDemandSecurityGroupParamsWithContext creates a new CreateOnDemandSecurityGroupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateOnDemandSecurityGroupParamsWithContext(ctx context.Context) *CreateOnDemandSecurityGroupParams { - var () return &CreateOnDemandSecurityGroupParams{ - Context: ctx, } } // NewCreateOnDemandSecurityGroupParamsWithHTTPClient creates a new CreateOnDemandSecurityGroupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateOnDemandSecurityGroupParamsWithHTTPClient(client *http.Client) *CreateOnDemandSecurityGroupParams { - var () return &CreateOnDemandSecurityGroupParams{ HTTPClient: client, } } -/*CreateOnDemandSecurityGroupParams contains all the parameters to send to the API endpoint -for the create on demand security group operation typically these are written to a http.Request +/* CreateOnDemandSecurityGroupParams contains all the parameters to send to the API endpoint + for the create on demand security group operation. + + Typically these are written to a http.Request. */ type CreateOnDemandSecurityGroupParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Security group Specification instance + /* Body. + + Security group Specification instance */ Body *models.SecurityGroupSpecification @@ -78,6 +78,21 @@ type CreateOnDemandSecurityGroupParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create on demand security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOnDemandSecurityGroupParams) WithDefaults() *CreateOnDemandSecurityGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create on demand security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOnDemandSecurityGroupParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create on demand security group params func (o *CreateOnDemandSecurityGroupParams) WithTimeout(timeout time.Duration) *CreateOnDemandSecurityGroupParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateOnDemandSecurityGroupParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/security_group/create_on_demand_security_group_responses.go b/pkg/client/security_group/create_on_demand_security_group_responses.go index f9342f70..c6a572f5 100644 --- a/pkg/client/security_group/create_on_demand_security_group_responses.go +++ b/pkg/client/security_group/create_on_demand_security_group_responses.go @@ -41,7 +41,6 @@ func (o *CreateOnDemandSecurityGroupReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateOnDemandSecurityGroupAccepted() *CreateOnDemandSecurityGroupAccept return &CreateOnDemandSecurityGroupAccepted{} } -/*CreateOnDemandSecurityGroupAccepted handles this case with default header values. +/* CreateOnDemandSecurityGroupAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateOnDemandSecurityGroupAccepted struct { func (o *CreateOnDemandSecurityGroupAccepted) Error() string { return fmt.Sprintf("[POST /iaas/api/security-groups][%d] createOnDemandSecurityGroupAccepted %+v", 202, o.Payload) } - func (o *CreateOnDemandSecurityGroupAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateOnDemandSecurityGroupBadRequest() *CreateOnDemandSecurityGroupBadR return &CreateOnDemandSecurityGroupBadRequest{} } -/*CreateOnDemandSecurityGroupBadRequest handles this case with default header values. +/* CreateOnDemandSecurityGroupBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateOnDemandSecurityGroupBadRequest struct { func (o *CreateOnDemandSecurityGroupBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/security-groups][%d] createOnDemandSecurityGroupBadRequest %+v", 400, o.Payload) } - func (o *CreateOnDemandSecurityGroupBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateOnDemandSecurityGroupForbidden() *CreateOnDemandSecurityGroupForbi return &CreateOnDemandSecurityGroupForbidden{} } -/*CreateOnDemandSecurityGroupForbidden handles this case with default header values. +/* CreateOnDemandSecurityGroupForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateOnDemandSecurityGroupForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateOnDemandSecurityGroupForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/security-groups][%d] createOnDemandSecurityGroupForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/security-groups][%d] createOnDemandSecurityGroupForbidden %+v", 403, o.Payload) +} +func (o *CreateOnDemandSecurityGroupForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateOnDemandSecurityGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/security_group/delete_security_group_parameters.go b/pkg/client/security_group/delete_security_group_parameters.go index dcd91341..8c5e50bc 100644 --- a/pkg/client/security_group/delete_security_group_parameters.go +++ b/pkg/client/security_group/delete_security_group_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteSecurityGroupParams creates a new DeleteSecurityGroupParams object -// with the default values initialized. +// NewDeleteSecurityGroupParams creates a new DeleteSecurityGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams { - var () return &DeleteSecurityGroupParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteSecurityGroupParamsWithTimeout creates a new DeleteSecurityGroupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteSecurityGroupParamsWithTimeout(timeout time.Duration) *DeleteSecurityGroupParams { - var () return &DeleteSecurityGroupParams{ - timeout: timeout, } } // NewDeleteSecurityGroupParamsWithContext creates a new DeleteSecurityGroupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteSecurityGroupParamsWithContext(ctx context.Context) *DeleteSecurityGroupParams { - var () return &DeleteSecurityGroupParams{ - Context: ctx, } } // NewDeleteSecurityGroupParamsWithHTTPClient creates a new DeleteSecurityGroupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteSecurityGroupParamsWithHTTPClient(client *http.Client) *DeleteSecurityGroupParams { - var () return &DeleteSecurityGroupParams{ HTTPClient: client, } } -/*DeleteSecurityGroupParams contains all the parameters to send to the API endpoint -for the delete security group operation typically these are written to a http.Request +/* DeleteSecurityGroupParams contains all the parameters to send to the API endpoint + for the delete security group operation. + + Typically these are written to a http.Request. */ type DeleteSecurityGroupParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ForceDelete - Controls whether this is a force delete operation. If true, best effort is made for deleting this security group. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. + /* ForceDelete. + + Controls whether this is a force delete operation. If true, best effort is made for deleting this security group. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA. */ ForceDelete *bool - /*ID - The ID of the security group. + /* ID. + + The ID of the security group. */ ID string @@ -82,6 +83,21 @@ type DeleteSecurityGroupParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSecurityGroupParams) WithDefaults() *DeleteSecurityGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSecurityGroupParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete security group params func (o *DeleteSecurityGroupParams) WithTimeout(timeout time.Duration) *DeleteSecurityGroupParams { o.SetTimeout(timeout) @@ -160,32 +176,34 @@ func (o *DeleteSecurityGroupParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ForceDelete != nil { // query param forceDelete var qrForceDelete bool + if o.ForceDelete != nil { qrForceDelete = *o.ForceDelete } qForceDelete := swag.FormatBool(qrForceDelete) if qForceDelete != "" { + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { return err } } - } // path param id diff --git a/pkg/client/security_group/delete_security_group_responses.go b/pkg/client/security_group/delete_security_group_responses.go index d3721331..85ce4e18 100644 --- a/pkg/client/security_group/delete_security_group_responses.go +++ b/pkg/client/security_group/delete_security_group_responses.go @@ -41,7 +41,6 @@ func (o *DeleteSecurityGroupReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewDeleteSecurityGroupAccepted() *DeleteSecurityGroupAccepted { return &DeleteSecurityGroupAccepted{} } -/*DeleteSecurityGroupAccepted handles this case with default header values. +/* DeleteSecurityGroupAccepted describes a response with status code 202, with default header values. successful operation */ @@ -63,7 +62,6 @@ type DeleteSecurityGroupAccepted struct { func (o *DeleteSecurityGroupAccepted) Error() string { return fmt.Sprintf("[DELETE /iaas/api/security-groups/{id}][%d] deleteSecurityGroupAccepted %+v", 202, o.Payload) } - func (o *DeleteSecurityGroupAccepted) GetPayload() *models.RequestTracker { return o.Payload } @@ -85,7 +83,7 @@ func NewDeleteSecurityGroupNoContent() *DeleteSecurityGroupNoContent { return &DeleteSecurityGroupNoContent{} } -/*DeleteSecurityGroupNoContent handles this case with default header values. +/* DeleteSecurityGroupNoContent describes a response with status code 204, with default header values. No Content */ @@ -106,18 +104,29 @@ func NewDeleteSecurityGroupForbidden() *DeleteSecurityGroupForbidden { return &DeleteSecurityGroupForbidden{} } -/*DeleteSecurityGroupForbidden handles this case with default header values. +/* DeleteSecurityGroupForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteSecurityGroupForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteSecurityGroupForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/security-groups/{id}][%d] deleteSecurityGroupForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/security-groups/{id}][%d] deleteSecurityGroupForbidden %+v", 403, o.Payload) +} +func (o *DeleteSecurityGroupForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteSecurityGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/security_group/get_security_group_parameters.go b/pkg/client/security_group/get_security_group_parameters.go index 671c5e1d..d77caca7 100644 --- a/pkg/client/security_group/get_security_group_parameters.go +++ b/pkg/client/security_group/get_security_group_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSecurityGroupParams creates a new GetSecurityGroupParams object -// with the default values initialized. +// NewGetSecurityGroupParams creates a new GetSecurityGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetSecurityGroupParams() *GetSecurityGroupParams { - var () return &GetSecurityGroupParams{ - timeout: cr.DefaultTimeout, } } // NewGetSecurityGroupParamsWithTimeout creates a new GetSecurityGroupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSecurityGroupParamsWithTimeout(timeout time.Duration) *GetSecurityGroupParams { - var () return &GetSecurityGroupParams{ - timeout: timeout, } } // NewGetSecurityGroupParamsWithContext creates a new GetSecurityGroupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSecurityGroupParamsWithContext(ctx context.Context) *GetSecurityGroupParams { - var () return &GetSecurityGroupParams{ - Context: ctx, } } // NewGetSecurityGroupParamsWithHTTPClient creates a new GetSecurityGroupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSecurityGroupParamsWithHTTPClient(client *http.Client) *GetSecurityGroupParams { - var () return &GetSecurityGroupParams{ HTTPClient: client, } } -/*GetSecurityGroupParams contains all the parameters to send to the API endpoint -for the get security group operation typically these are written to a http.Request +/* GetSecurityGroupParams contains all the parameters to send to the API endpoint + for the get security group operation. + + Typically these are written to a http.Request. */ type GetSecurityGroupParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the security group. + /* ID. + + The ID of the security group. */ ID string @@ -76,6 +76,21 @@ type GetSecurityGroupParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityGroupParams) WithDefaults() *GetSecurityGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityGroupParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get security group params func (o *GetSecurityGroupParams) WithTimeout(timeout time.Duration) *GetSecurityGroupParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetSecurityGroupParams) WriteToRequest(r runtime.ClientRequest, reg str // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/security_group/get_security_group_responses.go b/pkg/client/security_group/get_security_group_responses.go index 8b4d900b..720bf7d9 100644 --- a/pkg/client/security_group/get_security_group_responses.go +++ b/pkg/client/security_group/get_security_group_responses.go @@ -41,7 +41,6 @@ func (o *GetSecurityGroupReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetSecurityGroupOK() *GetSecurityGroupOK { return &GetSecurityGroupOK{} } -/*GetSecurityGroupOK handles this case with default header values. +/* GetSecurityGroupOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetSecurityGroupOK struct { func (o *GetSecurityGroupOK) Error() string { return fmt.Sprintf("[GET /iaas/api/security-groups/{id}][%d] getSecurityGroupOK %+v", 200, o.Payload) } - func (o *GetSecurityGroupOK) GetPayload() *models.SecurityGroup { return o.Payload } @@ -85,19 +83,30 @@ func NewGetSecurityGroupForbidden() *GetSecurityGroupForbidden { return &GetSecurityGroupForbidden{} } -/*GetSecurityGroupForbidden handles this case with default header values. +/* GetSecurityGroupForbidden describes a response with status code 403, with default header values. Forbidden */ type GetSecurityGroupForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetSecurityGroupForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/security-groups/{id}][%d] getSecurityGroupForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/security-groups/{id}][%d] getSecurityGroupForbidden %+v", 403, o.Payload) +} +func (o *GetSecurityGroupForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetSecurityGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetSecurityGroupNotFound() *GetSecurityGroupNotFound { return &GetSecurityGroupNotFound{} } -/*GetSecurityGroupNotFound handles this case with default header values. +/* GetSecurityGroupNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetSecurityGroupNotFound struct { func (o *GetSecurityGroupNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/security-groups/{id}][%d] getSecurityGroupNotFound %+v", 404, o.Payload) } - func (o *GetSecurityGroupNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/security_group/get_security_groups_parameters.go b/pkg/client/security_group/get_security_groups_parameters.go index 5b3c632b..72addb9c 100644 --- a/pkg/client/security_group/get_security_groups_parameters.go +++ b/pkg/client/security_group/get_security_groups_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSecurityGroupsParams creates a new GetSecurityGroupsParams object -// with the default values initialized. +// NewGetSecurityGroupsParams creates a new GetSecurityGroupsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetSecurityGroupsParams() *GetSecurityGroupsParams { - var () return &GetSecurityGroupsParams{ - timeout: cr.DefaultTimeout, } } // NewGetSecurityGroupsParamsWithTimeout creates a new GetSecurityGroupsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSecurityGroupsParamsWithTimeout(timeout time.Duration) *GetSecurityGroupsParams { - var () return &GetSecurityGroupsParams{ - timeout: timeout, } } // NewGetSecurityGroupsParamsWithContext creates a new GetSecurityGroupsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSecurityGroupsParamsWithContext(ctx context.Context) *GetSecurityGroupsParams { - var () return &GetSecurityGroupsParams{ - Context: ctx, } } // NewGetSecurityGroupsParamsWithHTTPClient creates a new GetSecurityGroupsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSecurityGroupsParamsWithHTTPClient(client *http.Client) *GetSecurityGroupsParams { - var () return &GetSecurityGroupsParams{ HTTPClient: client, } } -/*GetSecurityGroupsParams contains all the parameters to send to the API endpoint -for the get security groups operation typically these are written to a http.Request +/* GetSecurityGroupsParams contains all the parameters to send to the API endpoint + for the get security groups operation. + + Typically these are written to a http.Request. */ type GetSecurityGroupsParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetSecurityGroupsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get security groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityGroupsParams) WithDefaults() *GetSecurityGroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get security groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityGroupsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get security groups params func (o *GetSecurityGroupsParams) WithTimeout(timeout time.Duration) *GetSecurityGroupsParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetSecurityGroupsParams) WriteToRequest(r runtime.ClientRequest, reg st // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/security_group/get_security_groups_responses.go b/pkg/client/security_group/get_security_groups_responses.go index 3d8e9f0a..f3d491a1 100644 --- a/pkg/client/security_group/get_security_groups_responses.go +++ b/pkg/client/security_group/get_security_groups_responses.go @@ -35,7 +35,6 @@ func (o *GetSecurityGroupsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetSecurityGroupsOK() *GetSecurityGroupsOK { return &GetSecurityGroupsOK{} } -/*GetSecurityGroupsOK handles this case with default header values. +/* GetSecurityGroupsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetSecurityGroupsOK struct { func (o *GetSecurityGroupsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/security-groups][%d] getSecurityGroupsOK %+v", 200, o.Payload) } - func (o *GetSecurityGroupsOK) GetPayload() *models.SecurityGroupResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetSecurityGroupsForbidden() *GetSecurityGroupsForbidden { return &GetSecurityGroupsForbidden{} } -/*GetSecurityGroupsForbidden handles this case with default header values. +/* GetSecurityGroupsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetSecurityGroupsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetSecurityGroupsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/security-groups][%d] getSecurityGroupsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/security-groups][%d] getSecurityGroupsForbidden %+v", 403, o.Payload) +} +func (o *GetSecurityGroupsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetSecurityGroupsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/security_group/reconfigure_security_group_parameters.go b/pkg/client/security_group/reconfigure_security_group_parameters.go new file mode 100644 index 00000000..5d42c125 --- /dev/null +++ b/pkg/client/security_group/reconfigure_security_group_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package security_group + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// NewReconfigureSecurityGroupParams creates a new ReconfigureSecurityGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReconfigureSecurityGroupParams() *ReconfigureSecurityGroupParams { + return &ReconfigureSecurityGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReconfigureSecurityGroupParamsWithTimeout creates a new ReconfigureSecurityGroupParams object +// with the ability to set a timeout on a request. +func NewReconfigureSecurityGroupParamsWithTimeout(timeout time.Duration) *ReconfigureSecurityGroupParams { + return &ReconfigureSecurityGroupParams{ + timeout: timeout, + } +} + +// NewReconfigureSecurityGroupParamsWithContext creates a new ReconfigureSecurityGroupParams object +// with the ability to set a context for a request. +func NewReconfigureSecurityGroupParamsWithContext(ctx context.Context) *ReconfigureSecurityGroupParams { + return &ReconfigureSecurityGroupParams{ + Context: ctx, + } +} + +// NewReconfigureSecurityGroupParamsWithHTTPClient creates a new ReconfigureSecurityGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewReconfigureSecurityGroupParamsWithHTTPClient(client *http.Client) *ReconfigureSecurityGroupParams { + return &ReconfigureSecurityGroupParams{ + HTTPClient: client, + } +} + +/* ReconfigureSecurityGroupParams contains all the parameters to send to the API endpoint + for the reconfigure security group operation. + + Typically these are written to a http.Request. +*/ +type ReconfigureSecurityGroupParams struct { + + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + */ + APIVersion *string + + /* Body. + + Security group Specification instance + */ + Body *models.SecurityGroupSpecification + + /* ID. + + The ID of the security group. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reconfigure security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureSecurityGroupParams) WithDefaults() *ReconfigureSecurityGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reconfigure security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReconfigureSecurityGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithTimeout(timeout time.Duration) *ReconfigureSecurityGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithContext(ctx context.Context) *ReconfigureSecurityGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithHTTPClient(client *http.Client) *ReconfigureSecurityGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIVersion adds the aPIVersion to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithAPIVersion(aPIVersion *string) *ReconfigureSecurityGroupParams { + o.SetAPIVersion(aPIVersion) + return o +} + +// SetAPIVersion adds the apiVersion to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetAPIVersion(aPIVersion *string) { + o.APIVersion = aPIVersion +} + +// WithBody adds the body to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithBody(body *models.SecurityGroupSpecification) *ReconfigureSecurityGroupParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetBody(body *models.SecurityGroupSpecification) { + o.Body = body +} + +// WithID adds the id to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) WithID(id string) *ReconfigureSecurityGroupParams { + o.SetID(id) + return o +} + +// SetID adds the id to the reconfigure security group params +func (o *ReconfigureSecurityGroupParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ReconfigureSecurityGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.APIVersion != nil { + + // query param apiVersion + var qrAPIVersion string + + if o.APIVersion != nil { + qrAPIVersion = *o.APIVersion + } + qAPIVersion := qrAPIVersion + if qAPIVersion != "" { + + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // 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/pkg/client/security_group/reconfigure_security_group_responses.go b/pkg/client/security_group/reconfigure_security_group_responses.go new file mode 100644 index 00000000..f5ebf260 --- /dev/null +++ b/pkg/client/security_group/reconfigure_security_group_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package security_group + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" +) + +// ReconfigureSecurityGroupReader is a Reader for the ReconfigureSecurityGroup structure. +type ReconfigureSecurityGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReconfigureSecurityGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewReconfigureSecurityGroupAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReconfigureSecurityGroupBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReconfigureSecurityGroupForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReconfigureSecurityGroupAccepted creates a ReconfigureSecurityGroupAccepted with default headers values +func NewReconfigureSecurityGroupAccepted() *ReconfigureSecurityGroupAccepted { + return &ReconfigureSecurityGroupAccepted{} +} + +/* ReconfigureSecurityGroupAccepted describes a response with status code 202, with default header values. + +successful operation +*/ +type ReconfigureSecurityGroupAccepted struct { + Payload *models.RequestTracker +} + +func (o *ReconfigureSecurityGroupAccepted) Error() string { + return fmt.Sprintf("[POST /iaas/api/security-groups/{id}/operations/reconfigure][%d] reconfigureSecurityGroupAccepted %+v", 202, o.Payload) +} +func (o *ReconfigureSecurityGroupAccepted) GetPayload() *models.RequestTracker { + return o.Payload +} + +func (o *ReconfigureSecurityGroupAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RequestTracker) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureSecurityGroupBadRequest creates a ReconfigureSecurityGroupBadRequest with default headers values +func NewReconfigureSecurityGroupBadRequest() *ReconfigureSecurityGroupBadRequest { + return &ReconfigureSecurityGroupBadRequest{} +} + +/* ReconfigureSecurityGroupBadRequest describes a response with status code 400, with default header values. + +Reconfigure is not supported for 'existing' type of security group. +*/ +type ReconfigureSecurityGroupBadRequest struct { + Payload *models.Error +} + +func (o *ReconfigureSecurityGroupBadRequest) Error() string { + return fmt.Sprintf("[POST /iaas/api/security-groups/{id}/operations/reconfigure][%d] reconfigureSecurityGroupBadRequest %+v", 400, o.Payload) +} +func (o *ReconfigureSecurityGroupBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *ReconfigureSecurityGroupBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReconfigureSecurityGroupForbidden creates a ReconfigureSecurityGroupForbidden with default headers values +func NewReconfigureSecurityGroupForbidden() *ReconfigureSecurityGroupForbidden { + return &ReconfigureSecurityGroupForbidden{} +} + +/* ReconfigureSecurityGroupForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReconfigureSecurityGroupForbidden struct { + Payload *models.ServiceErrorResponse +} + +func (o *ReconfigureSecurityGroupForbidden) Error() string { + return fmt.Sprintf("[POST /iaas/api/security-groups/{id}/operations/reconfigure][%d] reconfigureSecurityGroupForbidden %+v", 403, o.Payload) +} +func (o *ReconfigureSecurityGroupForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload +} + +func (o *ReconfigureSecurityGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/security_group/security_group_client.go b/pkg/client/security_group/security_group_client.go index 37f3ae8b..8995ebcb 100644 --- a/pkg/client/security_group/security_group_client.go +++ b/pkg/client/security_group/security_group_client.go @@ -25,19 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ChangeSecurityGroups(params *ChangeSecurityGroupsParams) (*ChangeSecurityGroupsAccepted, error) + ChangeSecurityGroups(params *ChangeSecurityGroupsParams, opts ...ClientOption) (*ChangeSecurityGroupsAccepted, error) + + CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroupParams, opts ...ClientOption) (*CreateOnDemandSecurityGroupAccepted, error) - CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroupParams) (*CreateOnDemandSecurityGroupAccepted, error) + DeleteSecurityGroup(params *DeleteSecurityGroupParams, opts ...ClientOption) (*DeleteSecurityGroupAccepted, *DeleteSecurityGroupNoContent, error) - DeleteSecurityGroup(params *DeleteSecurityGroupParams) (*DeleteSecurityGroupAccepted, *DeleteSecurityGroupNoContent, error) + GetSecurityGroup(params *GetSecurityGroupParams, opts ...ClientOption) (*GetSecurityGroupOK, error) - GetSecurityGroup(params *GetSecurityGroupParams) (*GetSecurityGroupOK, error) + GetSecurityGroups(params *GetSecurityGroupsParams, opts ...ClientOption) (*GetSecurityGroupsOK, error) - GetSecurityGroups(params *GetSecurityGroupsParams) (*GetSecurityGroupsOK, error) + ReconfigureSecurityGroup(params *ReconfigureSecurityGroupParams, opts ...ClientOption) (*ReconfigureSecurityGroupAccepted, error) - UpdateSecurityGroup(params *UpdateSecurityGroupParams) (*UpdateSecurityGroupOK, error) + UpdateSecurityGroup(params *UpdateSecurityGroupParams, opts ...ClientOption) (*UpdateSecurityGroupOK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +52,12 @@ type ClientService interface { Change security groups for a vSphere machine network interfaces. Securing group that is part of the same deployment can be added or removed for a machine network interface. */ -func (a *Client) ChangeSecurityGroups(params *ChangeSecurityGroupsParams) (*ChangeSecurityGroupsAccepted, error) { +func (a *Client) ChangeSecurityGroups(params *ChangeSecurityGroupsParams, opts ...ClientOption) (*ChangeSecurityGroupsAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeSecurityGroupsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "changeSecurityGroups", Method: "POST", PathPattern: "/iaas/api/machines/{id}/operations/change-security-groups", @@ -64,7 +68,12 @@ func (a *Client) ChangeSecurityGroups(params *ChangeSecurityGroupsParams) (*Chan Reader: &ChangeSecurityGroupsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -83,13 +92,12 @@ func (a *Client) ChangeSecurityGroups(params *ChangeSecurityGroupsParams) (*Chan Provision a new on-demand security group */ -func (a *Client) CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroupParams) (*CreateOnDemandSecurityGroupAccepted, error) { +func (a *Client) CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroupParams, opts ...ClientOption) (*CreateOnDemandSecurityGroupAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateOnDemandSecurityGroupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createOnDemandSecurityGroup", Method: "POST", PathPattern: "/iaas/api/security-groups", @@ -100,7 +108,12 @@ func (a *Client) CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroup Reader: &CreateOnDemandSecurityGroupReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -119,13 +132,12 @@ func (a *Client) CreateOnDemandSecurityGroup(params *CreateOnDemandSecurityGroup Delete an on-demand security group with a given id */ -func (a *Client) DeleteSecurityGroup(params *DeleteSecurityGroupParams) (*DeleteSecurityGroupAccepted, *DeleteSecurityGroupNoContent, error) { +func (a *Client) DeleteSecurityGroup(params *DeleteSecurityGroupParams, opts ...ClientOption) (*DeleteSecurityGroupAccepted, *DeleteSecurityGroupNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteSecurityGroupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteSecurityGroup", Method: "DELETE", PathPattern: "/iaas/api/security-groups/{id}", @@ -136,7 +148,12 @@ func (a *Client) DeleteSecurityGroup(params *DeleteSecurityGroupParams) (*Delete Reader: &DeleteSecurityGroupReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -156,13 +173,12 @@ func (a *Client) DeleteSecurityGroup(params *DeleteSecurityGroupParams) (*Delete Get security group with a given id */ -func (a *Client) GetSecurityGroup(params *GetSecurityGroupParams) (*GetSecurityGroupOK, error) { +func (a *Client) GetSecurityGroup(params *GetSecurityGroupParams, opts ...ClientOption) (*GetSecurityGroupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSecurityGroupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSecurityGroup", Method: "GET", PathPattern: "/iaas/api/security-groups/{id}", @@ -173,7 +189,12 @@ func (a *Client) GetSecurityGroup(params *GetSecurityGroupParams) (*GetSecurityG Reader: &GetSecurityGroupReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -192,13 +213,12 @@ func (a *Client) GetSecurityGroup(params *GetSecurityGroupParams) (*GetSecurityG Get all security groups */ -func (a *Client) GetSecurityGroups(params *GetSecurityGroupsParams) (*GetSecurityGroupsOK, error) { +func (a *Client) GetSecurityGroups(params *GetSecurityGroupsParams, opts ...ClientOption) (*GetSecurityGroupsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSecurityGroupsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSecurityGroups", Method: "GET", PathPattern: "/iaas/api/security-groups", @@ -209,7 +229,12 @@ func (a *Client) GetSecurityGroups(params *GetSecurityGroupsParams) (*GetSecurit Reader: &GetSecurityGroupsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -223,18 +248,57 @@ func (a *Client) GetSecurityGroups(params *GetSecurityGroupsParams) (*GetSecurit panic(msg) } +/* + ReconfigureSecurityGroup reconfigures operation for security group + + Day-2 reconfigure operation for new security groups provisioned by vRA. This is not supported for 'existing' security groups +*/ +func (a *Client) ReconfigureSecurityGroup(params *ReconfigureSecurityGroupParams, opts ...ClientOption) (*ReconfigureSecurityGroupAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReconfigureSecurityGroupParams() + } + op := &runtime.ClientOperation{ + ID: "reconfigureSecurityGroup", + Method: "POST", + PathPattern: "/iaas/api/security-groups/{id}/operations/reconfigure", + ProducesMediaTypes: []string{"app/json", "application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReconfigureSecurityGroupReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReconfigureSecurityGroupAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reconfigureSecurityGroup: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateSecurityGroup updates security group Update security group. Only tag updates are supported. */ -func (a *Client) UpdateSecurityGroup(params *UpdateSecurityGroupParams) (*UpdateSecurityGroupOK, error) { +func (a *Client) UpdateSecurityGroup(params *UpdateSecurityGroupParams, opts ...ClientOption) (*UpdateSecurityGroupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateSecurityGroupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateSecurityGroup", Method: "PATCH", PathPattern: "/iaas/api/security-groups/{id}", @@ -245,7 +309,12 @@ func (a *Client) UpdateSecurityGroup(params *UpdateSecurityGroupParams) (*Update Reader: &UpdateSecurityGroupReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/security_group/update_security_group_parameters.go b/pkg/client/security_group/update_security_group_parameters.go index 0419bd28..dcbd9feb 100644 --- a/pkg/client/security_group/update_security_group_parameters.go +++ b/pkg/client/security_group/update_security_group_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateSecurityGroupParams creates a new UpdateSecurityGroupParams object -// with the default values initialized. +// NewUpdateSecurityGroupParams creates a new UpdateSecurityGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateSecurityGroupParams() *UpdateSecurityGroupParams { - var () return &UpdateSecurityGroupParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateSecurityGroupParamsWithTimeout creates a new UpdateSecurityGroupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateSecurityGroupParamsWithTimeout(timeout time.Duration) *UpdateSecurityGroupParams { - var () return &UpdateSecurityGroupParams{ - timeout: timeout, } } // NewUpdateSecurityGroupParamsWithContext creates a new UpdateSecurityGroupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateSecurityGroupParamsWithContext(ctx context.Context) *UpdateSecurityGroupParams { - var () return &UpdateSecurityGroupParams{ - Context: ctx, } } // NewUpdateSecurityGroupParamsWithHTTPClient creates a new UpdateSecurityGroupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateSecurityGroupParamsWithHTTPClient(client *http.Client) *UpdateSecurityGroupParams { - var () return &UpdateSecurityGroupParams{ HTTPClient: client, } } -/*UpdateSecurityGroupParams contains all the parameters to send to the API endpoint -for the update security group operation typically these are written to a http.Request +/* UpdateSecurityGroupParams contains all the parameters to send to the API endpoint + for the update security group operation. + + Typically these are written to a http.Request. */ type UpdateSecurityGroupParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - Update Security Group Specification + /* Body. + + Update Security Group Specification */ Body *models.UpdateSecurityGroupSpecification - /*ID - The ID of the security group. + /* ID. + + The ID of the security group. */ ID string @@ -83,6 +84,21 @@ type UpdateSecurityGroupParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSecurityGroupParams) WithDefaults() *UpdateSecurityGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update security group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSecurityGroupParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update security group params func (o *UpdateSecurityGroupParams) WithTimeout(timeout time.Duration) *UpdateSecurityGroupParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateSecurityGroupParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/security_group/update_security_group_responses.go b/pkg/client/security_group/update_security_group_responses.go index 64909623..f54e25f0 100644 --- a/pkg/client/security_group/update_security_group_responses.go +++ b/pkg/client/security_group/update_security_group_responses.go @@ -41,7 +41,6 @@ func (o *UpdateSecurityGroupReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateSecurityGroupOK() *UpdateSecurityGroupOK { return &UpdateSecurityGroupOK{} } -/*UpdateSecurityGroupOK handles this case with default header values. +/* UpdateSecurityGroupOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateSecurityGroupOK struct { func (o *UpdateSecurityGroupOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/security-groups/{id}][%d] updateSecurityGroupOK %+v", 200, o.Payload) } - func (o *UpdateSecurityGroupOK) GetPayload() *models.SecurityGroup { return o.Payload } @@ -85,19 +83,30 @@ func NewUpdateSecurityGroupForbidden() *UpdateSecurityGroupForbidden { return &UpdateSecurityGroupForbidden{} } -/*UpdateSecurityGroupForbidden handles this case with default header values. +/* UpdateSecurityGroupForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateSecurityGroupForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateSecurityGroupForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/security-groups/{id}][%d] updateSecurityGroupForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/security-groups/{id}][%d] updateSecurityGroupForbidden %+v", 403, o.Payload) +} +func (o *UpdateSecurityGroupForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateSecurityGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewUpdateSecurityGroupNotFound() *UpdateSecurityGroupNotFound { return &UpdateSecurityGroupNotFound{} } -/*UpdateSecurityGroupNotFound handles this case with default header values. +/* UpdateSecurityGroupNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type UpdateSecurityGroupNotFound struct { func (o *UpdateSecurityGroupNotFound) Error() string { return fmt.Sprintf("[PATCH /iaas/api/security-groups/{id}][%d] updateSecurityGroupNotFound %+v", 404, o.Payload) } - func (o *UpdateSecurityGroupNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/source_control_sync/get_sync_request_using_get_parameters.go b/pkg/client/source_control_sync/get_sync_request_using_get_parameters.go index d0d329de..b3be50ca 100644 --- a/pkg/client/source_control_sync/get_sync_request_using_get_parameters.go +++ b/pkg/client/source_control_sync/get_sync_request_using_get_parameters.go @@ -16,58 +16,60 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSyncRequestUsingGETParams creates a new GetSyncRequestUsingGETParams object -// with the default values initialized. +// NewGetSyncRequestUsingGETParams creates a new GetSyncRequestUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetSyncRequestUsingGETParams() *GetSyncRequestUsingGETParams { - var () return &GetSyncRequestUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetSyncRequestUsingGETParamsWithTimeout creates a new GetSyncRequestUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSyncRequestUsingGETParamsWithTimeout(timeout time.Duration) *GetSyncRequestUsingGETParams { - var () return &GetSyncRequestUsingGETParams{ - timeout: timeout, } } // NewGetSyncRequestUsingGETParamsWithContext creates a new GetSyncRequestUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSyncRequestUsingGETParamsWithContext(ctx context.Context) *GetSyncRequestUsingGETParams { - var () return &GetSyncRequestUsingGETParams{ - Context: ctx, } } // NewGetSyncRequestUsingGETParamsWithHTTPClient creates a new GetSyncRequestUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSyncRequestUsingGETParamsWithHTTPClient(client *http.Client) *GetSyncRequestUsingGETParams { - var () return &GetSyncRequestUsingGETParams{ HTTPClient: client, } } -/*GetSyncRequestUsingGETParams contains all the parameters to send to the API endpoint -for the get sync request using g e t operation typically these are written to a http.Request +/* GetSyncRequestUsingGETParams contains all the parameters to send to the API endpoint + for the get sync request using g e t operation. + + Typically these are written to a http.Request. */ type GetSyncRequestUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ID - ID of the sync request + /* ID. + + ID of the sync request + + Format: uuid */ ID strfmt.UUID @@ -76,6 +78,21 @@ type GetSyncRequestUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get sync request using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSyncRequestUsingGETParams) WithDefaults() *GetSyncRequestUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get sync request using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSyncRequestUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get sync request using get params func (o *GetSyncRequestUsingGETParams) WithTimeout(timeout time.Duration) *GetSyncRequestUsingGETParams { o.SetTimeout(timeout) @@ -143,16 +160,17 @@ func (o *GetSyncRequestUsingGETParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/source_control_sync/get_sync_request_using_get_responses.go b/pkg/client/source_control_sync/get_sync_request_using_get_responses.go index 985358c8..a244eeb8 100644 --- a/pkg/client/source_control_sync/get_sync_request_using_get_responses.go +++ b/pkg/client/source_control_sync/get_sync_request_using_get_responses.go @@ -35,7 +35,6 @@ func (o *GetSyncRequestUsingGETReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetSyncRequestUsingGETOK() *GetSyncRequestUsingGETOK { return &GetSyncRequestUsingGETOK{} } -/*GetSyncRequestUsingGETOK handles this case with default header values. +/* GetSyncRequestUsingGETOK describes a response with status code 200, with default header values. Sync request for id */ @@ -57,7 +56,6 @@ type GetSyncRequestUsingGETOK struct { func (o *GetSyncRequestUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/sourcecontrol/sync-requests/{id}][%d] getSyncRequestUsingGETOK %+v", 200, o.Payload) } - func (o *GetSyncRequestUsingGETOK) GetPayload() *models.SourceControlSyncRequest { return o.Payload } @@ -79,7 +77,7 @@ func NewGetSyncRequestUsingGETNotFound() *GetSyncRequestUsingGETNotFound { return &GetSyncRequestUsingGETNotFound{} } -/*GetSyncRequestUsingGETNotFound handles this case with default header values. +/* GetSyncRequestUsingGETNotFound describes a response with status code 404, with default header values. request not found */ @@ -90,7 +88,6 @@ type GetSyncRequestUsingGETNotFound struct { func (o *GetSyncRequestUsingGETNotFound) Error() string { return fmt.Sprintf("[GET /content/api/sourcecontrol/sync-requests/{id}][%d] getSyncRequestUsingGETNotFound %+v", 404, o.Payload) } - func (o *GetSyncRequestUsingGETNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/source_control_sync/schedule_sync_all_using_post_parameters.go b/pkg/client/source_control_sync/schedule_sync_all_using_post_parameters.go index 87dda8b7..41d68b4b 100644 --- a/pkg/client/source_control_sync/schedule_sync_all_using_post_parameters.go +++ b/pkg/client/source_control_sync/schedule_sync_all_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewScheduleSyncAllUsingPOSTParams creates a new ScheduleSyncAllUsingPOSTParams object -// with the default values initialized. +// NewScheduleSyncAllUsingPOSTParams creates a new ScheduleSyncAllUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewScheduleSyncAllUsingPOSTParams() *ScheduleSyncAllUsingPOSTParams { - var () return &ScheduleSyncAllUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewScheduleSyncAllUsingPOSTParamsWithTimeout creates a new ScheduleSyncAllUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewScheduleSyncAllUsingPOSTParamsWithTimeout(timeout time.Duration) *ScheduleSyncAllUsingPOSTParams { - var () return &ScheduleSyncAllUsingPOSTParams{ - timeout: timeout, } } // NewScheduleSyncAllUsingPOSTParamsWithContext creates a new ScheduleSyncAllUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewScheduleSyncAllUsingPOSTParamsWithContext(ctx context.Context) *ScheduleSyncAllUsingPOSTParams { - var () return &ScheduleSyncAllUsingPOSTParams{ - Context: ctx, } } // NewScheduleSyncAllUsingPOSTParamsWithHTTPClient creates a new ScheduleSyncAllUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewScheduleSyncAllUsingPOSTParamsWithHTTPClient(client *http.Client) *ScheduleSyncAllUsingPOSTParams { - var () return &ScheduleSyncAllUsingPOSTParams{ HTTPClient: client, } } -/*ScheduleSyncAllUsingPOSTParams contains all the parameters to send to the API endpoint -for the schedule sync all using p o s t operation typically these are written to a http.Request +/* ScheduleSyncAllUsingPOSTParams contains all the parameters to send to the API endpoint + for the schedule sync all using p o s t operation. + + Typically these are written to a http.Request. */ type ScheduleSyncAllUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*Request - request + /* Request. + + request */ Request *models.SourceControlSyncAllRequest @@ -78,6 +78,21 @@ type ScheduleSyncAllUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the schedule sync all using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleSyncAllUsingPOSTParams) WithDefaults() *ScheduleSyncAllUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the schedule sync all using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleSyncAllUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the schedule sync all using p o s t params func (o *ScheduleSyncAllUsingPOSTParams) WithTimeout(timeout time.Duration) *ScheduleSyncAllUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *ScheduleSyncAllUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/source_control_sync/schedule_sync_all_using_post_responses.go b/pkg/client/source_control_sync/schedule_sync_all_using_post_responses.go index da4665ae..61e854ed 100644 --- a/pkg/client/source_control_sync/schedule_sync_all_using_post_responses.go +++ b/pkg/client/source_control_sync/schedule_sync_all_using_post_responses.go @@ -29,7 +29,6 @@ func (o *ScheduleSyncAllUsingPOSTReader) ReadResponse(response runtime.ClientRes return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewScheduleSyncAllUsingPOSTAccepted() *ScheduleSyncAllUsingPOSTAccepted { return &ScheduleSyncAllUsingPOSTAccepted{} } -/*ScheduleSyncAllUsingPOSTAccepted handles this case with default header values. +/* ScheduleSyncAllUsingPOSTAccepted describes a response with status code 202, with default header values. Submitted sync requests */ @@ -51,7 +50,6 @@ type ScheduleSyncAllUsingPOSTAccepted struct { func (o *ScheduleSyncAllUsingPOSTAccepted) Error() string { return fmt.Sprintf("[POST /content/api/sourcecontrol/sync-all-requests][%d] scheduleSyncAllUsingPOSTAccepted %+v", 202, o.Payload) } - func (o *ScheduleSyncAllUsingPOSTAccepted) GetPayload() *models.SourceControlSyncRequests { return o.Payload } diff --git a/pkg/client/source_control_sync/schedule_sync_using_post_parameters.go b/pkg/client/source_control_sync/schedule_sync_using_post_parameters.go index 4fe2058a..330dd536 100644 --- a/pkg/client/source_control_sync/schedule_sync_using_post_parameters.go +++ b/pkg/client/source_control_sync/schedule_sync_using_post_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewScheduleSyncUsingPOSTParams creates a new ScheduleSyncUsingPOSTParams object -// with the default values initialized. +// NewScheduleSyncUsingPOSTParams creates a new ScheduleSyncUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewScheduleSyncUsingPOSTParams() *ScheduleSyncUsingPOSTParams { - var () return &ScheduleSyncUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewScheduleSyncUsingPOSTParamsWithTimeout creates a new ScheduleSyncUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewScheduleSyncUsingPOSTParamsWithTimeout(timeout time.Duration) *ScheduleSyncUsingPOSTParams { - var () return &ScheduleSyncUsingPOSTParams{ - timeout: timeout, } } // NewScheduleSyncUsingPOSTParamsWithContext creates a new ScheduleSyncUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewScheduleSyncUsingPOSTParamsWithContext(ctx context.Context) *ScheduleSyncUsingPOSTParams { - var () return &ScheduleSyncUsingPOSTParams{ - Context: ctx, } } // NewScheduleSyncUsingPOSTParamsWithHTTPClient creates a new ScheduleSyncUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewScheduleSyncUsingPOSTParamsWithHTTPClient(client *http.Client) *ScheduleSyncUsingPOSTParams { - var () return &ScheduleSyncUsingPOSTParams{ HTTPClient: client, } } -/*ScheduleSyncUsingPOSTParams contains all the parameters to send to the API endpoint -for the schedule sync using p o s t operation typically these are written to a http.Request +/* ScheduleSyncUsingPOSTParams contains all the parameters to send to the API endpoint + for the schedule sync using p o s t operation. + + Typically these are written to a http.Request. */ type ScheduleSyncUsingPOSTParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*Request - request + /* Request. + + request */ Request *models.SourceControlSyncRequest @@ -78,6 +78,21 @@ type ScheduleSyncUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the schedule sync using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleSyncUsingPOSTParams) WithDefaults() *ScheduleSyncUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the schedule sync using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleSyncUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the schedule sync using p o s t params func (o *ScheduleSyncUsingPOSTParams) WithTimeout(timeout time.Duration) *ScheduleSyncUsingPOSTParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *ScheduleSyncUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/source_control_sync/schedule_sync_using_post_responses.go b/pkg/client/source_control_sync/schedule_sync_using_post_responses.go index 3232ab02..2764b83c 100644 --- a/pkg/client/source_control_sync/schedule_sync_using_post_responses.go +++ b/pkg/client/source_control_sync/schedule_sync_using_post_responses.go @@ -35,7 +35,6 @@ func (o *ScheduleSyncUsingPOSTReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewScheduleSyncUsingPOSTAccepted() *ScheduleSyncUsingPOSTAccepted { return &ScheduleSyncUsingPOSTAccepted{} } -/*ScheduleSyncUsingPOSTAccepted handles this case with default header values. +/* ScheduleSyncUsingPOSTAccepted describes a response with status code 202, with default header values. Submitted sync requests */ @@ -57,7 +56,6 @@ type ScheduleSyncUsingPOSTAccepted struct { func (o *ScheduleSyncUsingPOSTAccepted) Error() string { return fmt.Sprintf("[POST /content/api/sourcecontrol/sync-requests][%d] scheduleSyncUsingPOSTAccepted %+v", 202, o.Payload) } - func (o *ScheduleSyncUsingPOSTAccepted) GetPayload() *models.SourceControlSyncRequest { return o.Payload } @@ -79,7 +77,7 @@ func NewScheduleSyncUsingPOSTNotFound() *ScheduleSyncUsingPOSTNotFound { return &ScheduleSyncUsingPOSTNotFound{} } -/*ScheduleSyncUsingPOSTNotFound handles this case with default header values. +/* ScheduleSyncUsingPOSTNotFound describes a response with status code 404, with default header values. source not found */ @@ -90,7 +88,6 @@ type ScheduleSyncUsingPOSTNotFound struct { func (o *ScheduleSyncUsingPOSTNotFound) Error() string { return fmt.Sprintf("[POST /content/api/sourcecontrol/sync-requests][%d] scheduleSyncUsingPOSTNotFound %+v", 404, o.Payload) } - func (o *ScheduleSyncUsingPOSTNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/source_control_sync/source_control_sync_client.go b/pkg/client/source_control_sync/source_control_sync_client.go index 424a1037..4f3268b7 100644 --- a/pkg/client/source_control_sync/source_control_sync_client.go +++ b/pkg/client/source_control_sync/source_control_sync_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams) (*GetSyncRequestUsingGETOK, error) + GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams, opts ...ClientOption) (*GetSyncRequestUsingGETOK, error) - ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams) (*ScheduleSyncAllUsingPOSTAccepted, error) + ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams, opts ...ClientOption) (*ScheduleSyncAllUsingPOSTAccepted, error) - ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams) (*ScheduleSyncUsingPOSTAccepted, error) + ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams, opts ...ClientOption) (*ScheduleSyncUsingPOSTAccepted, error) - SyncHistoryUsingGET(params *SyncHistoryUsingGETParams) (*SyncHistoryUsingGETOK, error) + SyncHistoryUsingGET(params *SyncHistoryUsingGETParams, opts ...ClientOption) (*SyncHistoryUsingGETOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* GetSyncRequestUsingGET gets a sync request by id */ -func (a *Client) GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams) (*GetSyncRequestUsingGETOK, error) { +func (a *Client) GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams, opts ...ClientOption) (*GetSyncRequestUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSyncRequestUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSyncRequestUsingGET", Method: "GET", PathPattern: "/content/api/sourcecontrol/sync-requests/{id}", @@ -58,7 +60,12 @@ func (a *Client) GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams) (* Reader: &GetSyncRequestUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -77,13 +84,12 @@ func (a *Client) GetSyncRequestUsingGET(params *GetSyncRequestUsingGETParams) (* Request sync for the sources belonging to the user's projects or specified projects */ -func (a *Client) ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams) (*ScheduleSyncAllUsingPOSTAccepted, error) { +func (a *Client) ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams, opts ...ClientOption) (*ScheduleSyncAllUsingPOSTAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewScheduleSyncAllUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "scheduleSyncAllUsingPOST", Method: "POST", PathPattern: "/content/api/sourcecontrol/sync-all-requests", @@ -94,7 +100,12 @@ func (a *Client) ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams Reader: &ScheduleSyncAllUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -113,13 +124,12 @@ func (a *Client) ScheduleSyncAllUsingPOST(params *ScheduleSyncAllUsingPOSTParams Request sync for a content source */ -func (a *Client) ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams) (*ScheduleSyncUsingPOSTAccepted, error) { +func (a *Client) ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams, opts ...ClientOption) (*ScheduleSyncUsingPOSTAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewScheduleSyncUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "scheduleSyncUsingPOST", Method: "POST", PathPattern: "/content/api/sourcecontrol/sync-requests", @@ -130,7 +140,12 @@ func (a *Client) ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams) (*Sc Reader: &ScheduleSyncUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -149,13 +164,12 @@ func (a *Client) ScheduleSyncUsingPOST(params *ScheduleSyncUsingPOSTParams) (*Sc Get history for files synced via source control sync */ -func (a *Client) SyncHistoryUsingGET(params *SyncHistoryUsingGETParams) (*SyncHistoryUsingGETOK, error) { +func (a *Client) SyncHistoryUsingGET(params *SyncHistoryUsingGETParams, opts ...ClientOption) (*SyncHistoryUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewSyncHistoryUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "syncHistoryUsingGET", Method: "GET", PathPattern: "/content/api/sourcecontrol/sync-history", @@ -166,7 +180,12 @@ func (a *Client) SyncHistoryUsingGET(params *SyncHistoryUsingGETParams) (*SyncHi Reader: &SyncHistoryUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/source_control_sync/sync_history_using_get_parameters.go b/pkg/client/source_control_sync/sync_history_using_get_parameters.go index 132d8730..ef9d1b74 100644 --- a/pkg/client/source_control_sync/sync_history_using_get_parameters.go +++ b/pkg/client/source_control_sync/sync_history_using_get_parameters.go @@ -17,88 +17,94 @@ import ( "github.com/go-openapi/swag" ) -// NewSyncHistoryUsingGETParams creates a new SyncHistoryUsingGETParams object -// with the default values initialized. +// NewSyncHistoryUsingGETParams creates a new SyncHistoryUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewSyncHistoryUsingGETParams() *SyncHistoryUsingGETParams { - var () return &SyncHistoryUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewSyncHistoryUsingGETParamsWithTimeout creates a new SyncHistoryUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewSyncHistoryUsingGETParamsWithTimeout(timeout time.Duration) *SyncHistoryUsingGETParams { - var () return &SyncHistoryUsingGETParams{ - timeout: timeout, } } // NewSyncHistoryUsingGETParamsWithContext creates a new SyncHistoryUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewSyncHistoryUsingGETParamsWithContext(ctx context.Context) *SyncHistoryUsingGETParams { - var () return &SyncHistoryUsingGETParams{ - Context: ctx, } } // NewSyncHistoryUsingGETParamsWithHTTPClient creates a new SyncHistoryUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewSyncHistoryUsingGETParamsWithHTTPClient(client *http.Client) *SyncHistoryUsingGETParams { - var () return &SyncHistoryUsingGETParams{ HTTPClient: client, } } -/*SyncHistoryUsingGETParams contains all the parameters to send to the API endpoint -for the sync history using g e t operation typically these are written to a http.Request +/* SyncHistoryUsingGETParams contains all the parameters to send to the API endpoint + for the sync history using g e t operation. + + Typically these are written to a http.Request. */ type SyncHistoryUsingGETParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information, please refer to /content/api/about */ APIVersion *string - /*ContentName - Search based on content name + /* ContentName. + + Search based on content name */ ContentName *string - /*ContentType - Search based on content type + /* ContentType. + + Search based on content type */ ContentType *string - /*IntegrationID - Search based on integration id + /* IntegrationID. + + Search based on integration id */ IntegrationID *string - /*ProjectIds - Search based on project ids + /* ProjectIds. + + Search based on project ids */ ProjectIds []string - /*RequestID - Search based on request Id + /* RequestID. + + Search based on request Id */ RequestID *string - /*SourceIds - Search based on content source ids + /* SourceIds. + + Search based on content source ids */ SourceIds []strfmt.UUID - /*Status - Search based on sync status + /* Status. + + Search based on sync status */ Status *string @@ -107,6 +113,21 @@ type SyncHistoryUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the sync history using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SyncHistoryUsingGETParams) WithDefaults() *SyncHistoryUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the sync history using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SyncHistoryUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the sync history using get params func (o *SyncHistoryUsingGETParams) WithTimeout(timeout time.Duration) *SyncHistoryUsingGETParams { o.SetTimeout(timeout) @@ -240,115 +261,124 @@ func (o *SyncHistoryUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if o.ContentName != nil { // query param contentName var qrContentName string + if o.ContentName != nil { qrContentName = *o.ContentName } qContentName := qrContentName if qContentName != "" { + if err := r.SetQueryParam("contentName", qContentName); err != nil { return err } } - } if o.ContentType != nil { // query param contentType var qrContentType string + if o.ContentType != nil { qrContentType = *o.ContentType } qContentType := qrContentType if qContentType != "" { + if err := r.SetQueryParam("contentType", qContentType); err != nil { return err } } - } if o.IntegrationID != nil { // query param integrationId var qrIntegrationID string + if o.IntegrationID != nil { qrIntegrationID = *o.IntegrationID } qIntegrationID := qrIntegrationID if qIntegrationID != "" { + if err := r.SetQueryParam("integrationId", qIntegrationID); err != nil { return err } } - } - valuesProjectIds := o.ProjectIds + if o.ProjectIds != nil { - joinedProjectIds := swag.JoinByFormat(valuesProjectIds, "multi") - // query array param projectIds - if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { - return err + // binding items for projectIds + joinedProjectIds := o.bindParamProjectIds(reg) + + // query array param projectIds + if err := r.SetQueryParam("projectIds", joinedProjectIds...); err != nil { + return err + } } if o.RequestID != nil { // query param requestId var qrRequestID string + if o.RequestID != nil { qrRequestID = *o.RequestID } qRequestID := qrRequestID if qRequestID != "" { + if err := r.SetQueryParam("requestId", qRequestID); err != nil { return err } } - } - var valuesSourceIds []string - for _, v := range o.SourceIds { - valuesSourceIds = append(valuesSourceIds, v.String()) - } + if o.SourceIds != nil { - joinedSourceIds := swag.JoinByFormat(valuesSourceIds, "multi") - // query array param sourceIds - if err := r.SetQueryParam("sourceIds", joinedSourceIds...); err != nil { - return err + // binding items for sourceIds + joinedSourceIds := o.bindParamSourceIds(reg) + + // query array param sourceIds + if err := r.SetQueryParam("sourceIds", joinedSourceIds...); 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 len(res) > 0 { @@ -356,3 +386,37 @@ func (o *SyncHistoryUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg } return nil } + +// bindParamSyncHistoryUsingGET binds the parameter projectIds +func (o *SyncHistoryUsingGETParams) bindParamProjectIds(formats strfmt.Registry) []string { + projectIdsIR := o.ProjectIds + + var projectIdsIC []string + for _, projectIdsIIR := range projectIdsIR { // explode []string + + projectIdsIIV := projectIdsIIR // string as string + projectIdsIC = append(projectIdsIC, projectIdsIIV) + } + + // items.CollectionFormat: "multi" + projectIdsIS := swag.JoinByFormat(projectIdsIC, "multi") + + return projectIdsIS +} + +// bindParamSyncHistoryUsingGET binds the parameter sourceIds +func (o *SyncHistoryUsingGETParams) bindParamSourceIds(formats strfmt.Registry) []string { + sourceIdsIR := o.SourceIds + + var sourceIdsIC []string + for _, sourceIdsIIR := range sourceIdsIR { // explode []strfmt.UUID + + sourceIdsIIV := sourceIdsIIR.String() // strfmt.UUID as string + sourceIdsIC = append(sourceIdsIC, sourceIdsIIV) + } + + // items.CollectionFormat: "multi" + sourceIdsIS := swag.JoinByFormat(sourceIdsIC, "multi") + + return sourceIdsIS +} diff --git a/pkg/client/source_control_sync/sync_history_using_get_responses.go b/pkg/client/source_control_sync/sync_history_using_get_responses.go index e6d84c89..875197ba 100644 --- a/pkg/client/source_control_sync/sync_history_using_get_responses.go +++ b/pkg/client/source_control_sync/sync_history_using_get_responses.go @@ -29,7 +29,6 @@ func (o *SyncHistoryUsingGETReader) ReadResponse(response runtime.ClientResponse return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewSyncHistoryUsingGETOK() *SyncHistoryUsingGETOK { return &SyncHistoryUsingGETOK{} } -/*SyncHistoryUsingGETOK handles this case with default header values. +/* SyncHistoryUsingGETOK describes a response with status code 200, with default header values. Sync history */ @@ -51,7 +50,6 @@ type SyncHistoryUsingGETOK struct { func (o *SyncHistoryUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/sourcecontrol/sync-history][%d] syncHistoryUsingGETOK %+v", 200, o.Payload) } - func (o *SyncHistoryUsingGETOK) GetPayload() *models.SourceControlSyncHistory { return o.Payload } diff --git a/pkg/client/storage_profile/create_aws_storage_profile_parameters.go b/pkg/client/storage_profile/create_aws_storage_profile_parameters.go index ed901f71..1c837708 100644 --- a/pkg/client/storage_profile/create_aws_storage_profile_parameters.go +++ b/pkg/client/storage_profile/create_aws_storage_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateAwsStorageProfileParams creates a new CreateAwsStorageProfileParams object -// with the default values initialized. +// NewCreateAwsStorageProfileParams creates a new CreateAwsStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateAwsStorageProfileParams() *CreateAwsStorageProfileParams { - var () return &CreateAwsStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAwsStorageProfileParamsWithTimeout creates a new CreateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAwsStorageProfileParamsWithTimeout(timeout time.Duration) *CreateAwsStorageProfileParams { - var () return &CreateAwsStorageProfileParams{ - timeout: timeout, } } // NewCreateAwsStorageProfileParamsWithContext creates a new CreateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAwsStorageProfileParamsWithContext(ctx context.Context) *CreateAwsStorageProfileParams { - var () return &CreateAwsStorageProfileParams{ - Context: ctx, } } // NewCreateAwsStorageProfileParamsWithHTTPClient creates a new CreateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAwsStorageProfileParamsWithHTTPClient(client *http.Client) *CreateAwsStorageProfileParams { - var () return &CreateAwsStorageProfileParams{ HTTPClient: client, } } -/*CreateAwsStorageProfileParams contains all the parameters to send to the API endpoint -for the create aws storage profile operation typically these are written to a http.Request +/* CreateAwsStorageProfileParams contains all the parameters to send to the API endpoint + for the create aws storage profile operation. + + Typically these are written to a http.Request. */ type CreateAwsStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileAwsSpecification instance + /* Body. + + StorageProfileAwsSpecification instance */ Body *models.StorageProfileAwsSpecification @@ -78,6 +78,21 @@ type CreateAwsStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsStorageProfileParams) WithDefaults() *CreateAwsStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create aws storage profile params func (o *CreateAwsStorageProfileParams) WithTimeout(timeout time.Duration) *CreateAwsStorageProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateAwsStorageProfileParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/create_aws_storage_profile_responses.go b/pkg/client/storage_profile/create_aws_storage_profile_responses.go index ca58c692..20a10c18 100644 --- a/pkg/client/storage_profile/create_aws_storage_profile_responses.go +++ b/pkg/client/storage_profile/create_aws_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateAwsStorageProfileReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateAwsStorageProfileCreated() *CreateAwsStorageProfileCreated { return &CreateAwsStorageProfileCreated{} } -/*CreateAwsStorageProfileCreated handles this case with default header values. +/* CreateAwsStorageProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateAwsStorageProfileCreated struct { func (o *CreateAwsStorageProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-aws][%d] createAwsStorageProfileCreated %+v", 201, o.Payload) } - func (o *CreateAwsStorageProfileCreated) GetPayload() *models.AwsStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateAwsStorageProfileBadRequest() *CreateAwsStorageProfileBadRequest { return &CreateAwsStorageProfileBadRequest{} } -/*CreateAwsStorageProfileBadRequest handles this case with default header values. +/* CreateAwsStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateAwsStorageProfileBadRequest struct { func (o *CreateAwsStorageProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-aws][%d] createAwsStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateAwsStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateAwsStorageProfileForbidden() *CreateAwsStorageProfileForbidden { return &CreateAwsStorageProfileForbidden{} } -/*CreateAwsStorageProfileForbidden handles this case with default header values. +/* CreateAwsStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateAwsStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateAwsStorageProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/storage-profiles-aws][%d] createAwsStorageProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/storage-profiles-aws][%d] createAwsStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateAwsStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateAwsStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/create_azure_storage_profile_parameters.go b/pkg/client/storage_profile/create_azure_storage_profile_parameters.go index e6b8b240..9491062f 100644 --- a/pkg/client/storage_profile/create_azure_storage_profile_parameters.go +++ b/pkg/client/storage_profile/create_azure_storage_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateAzureStorageProfileParams creates a new CreateAzureStorageProfileParams object -// with the default values initialized. +// NewCreateAzureStorageProfileParams creates a new CreateAzureStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateAzureStorageProfileParams() *CreateAzureStorageProfileParams { - var () return &CreateAzureStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAzureStorageProfileParamsWithTimeout creates a new CreateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAzureStorageProfileParamsWithTimeout(timeout time.Duration) *CreateAzureStorageProfileParams { - var () return &CreateAzureStorageProfileParams{ - timeout: timeout, } } // NewCreateAzureStorageProfileParamsWithContext creates a new CreateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAzureStorageProfileParamsWithContext(ctx context.Context) *CreateAzureStorageProfileParams { - var () return &CreateAzureStorageProfileParams{ - Context: ctx, } } // NewCreateAzureStorageProfileParamsWithHTTPClient creates a new CreateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAzureStorageProfileParamsWithHTTPClient(client *http.Client) *CreateAzureStorageProfileParams { - var () return &CreateAzureStorageProfileParams{ HTTPClient: client, } } -/*CreateAzureStorageProfileParams contains all the parameters to send to the API endpoint -for the create azure storage profile operation typically these are written to a http.Request +/* CreateAzureStorageProfileParams contains all the parameters to send to the API endpoint + for the create azure storage profile operation. + + Typically these are written to a http.Request. */ type CreateAzureStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileAzureSpecification instance + /* Body. + + StorageProfileAzureSpecification instance */ Body *models.StorageProfileAzureSpecification @@ -78,6 +78,21 @@ type CreateAzureStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureStorageProfileParams) WithDefaults() *CreateAzureStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create azure storage profile params func (o *CreateAzureStorageProfileParams) WithTimeout(timeout time.Duration) *CreateAzureStorageProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateAzureStorageProfileParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/create_azure_storage_profile_responses.go b/pkg/client/storage_profile/create_azure_storage_profile_responses.go index 2739c5be..11e2a06a 100644 --- a/pkg/client/storage_profile/create_azure_storage_profile_responses.go +++ b/pkg/client/storage_profile/create_azure_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateAzureStorageProfileReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateAzureStorageProfileCreated() *CreateAzureStorageProfileCreated { return &CreateAzureStorageProfileCreated{} } -/*CreateAzureStorageProfileCreated handles this case with default header values. +/* CreateAzureStorageProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateAzureStorageProfileCreated struct { func (o *CreateAzureStorageProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-azure][%d] createAzureStorageProfileCreated %+v", 201, o.Payload) } - func (o *CreateAzureStorageProfileCreated) GetPayload() *models.AzureStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateAzureStorageProfileBadRequest() *CreateAzureStorageProfileBadReque return &CreateAzureStorageProfileBadRequest{} } -/*CreateAzureStorageProfileBadRequest handles this case with default header values. +/* CreateAzureStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateAzureStorageProfileBadRequest struct { func (o *CreateAzureStorageProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-azure][%d] createAzureStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateAzureStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateAzureStorageProfileForbidden() *CreateAzureStorageProfileForbidden return &CreateAzureStorageProfileForbidden{} } -/*CreateAzureStorageProfileForbidden handles this case with default header values. +/* CreateAzureStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateAzureStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateAzureStorageProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/storage-profiles-azure][%d] createAzureStorageProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/storage-profiles-azure][%d] createAzureStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateAzureStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateAzureStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/create_storage_profile_parameters.go b/pkg/client/storage_profile/create_storage_profile_parameters.go index 5cdf4fe1..fb2fd104 100644 --- a/pkg/client/storage_profile/create_storage_profile_parameters.go +++ b/pkg/client/storage_profile/create_storage_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateStorageProfileParams creates a new CreateStorageProfileParams object -// with the default values initialized. +// NewCreateStorageProfileParams creates a new CreateStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateStorageProfileParams() *CreateStorageProfileParams { - var () return &CreateStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateStorageProfileParamsWithTimeout creates a new CreateStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateStorageProfileParamsWithTimeout(timeout time.Duration) *CreateStorageProfileParams { - var () return &CreateStorageProfileParams{ - timeout: timeout, } } // NewCreateStorageProfileParamsWithContext creates a new CreateStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateStorageProfileParamsWithContext(ctx context.Context) *CreateStorageProfileParams { - var () return &CreateStorageProfileParams{ - Context: ctx, } } // NewCreateStorageProfileParamsWithHTTPClient creates a new CreateStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateStorageProfileParamsWithHTTPClient(client *http.Client) *CreateStorageProfileParams { - var () return &CreateStorageProfileParams{ HTTPClient: client, } } -/*CreateStorageProfileParams contains all the parameters to send to the API endpoint -for the create storage profile operation typically these are written to a http.Request +/* CreateStorageProfileParams contains all the parameters to send to the API endpoint + for the create storage profile operation. + + Typically these are written to a http.Request. */ type CreateStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileSpecification instance + /* Body. + + StorageProfileSpecification instance */ Body *models.StorageProfileSpecification @@ -78,6 +78,21 @@ type CreateStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateStorageProfileParams) WithDefaults() *CreateStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create storage profile params func (o *CreateStorageProfileParams) WithTimeout(timeout time.Duration) *CreateStorageProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateStorageProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/create_storage_profile_responses.go b/pkg/client/storage_profile/create_storage_profile_responses.go index 4ebbf928..037178a6 100644 --- a/pkg/client/storage_profile/create_storage_profile_responses.go +++ b/pkg/client/storage_profile/create_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateStorageProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateStorageProfileCreated() *CreateStorageProfileCreated { return &CreateStorageProfileCreated{} } -/*CreateStorageProfileCreated handles this case with default header values. +/* CreateStorageProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateStorageProfileCreated struct { func (o *CreateStorageProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles][%d] createStorageProfileCreated %+v", 201, o.Payload) } - func (o *CreateStorageProfileCreated) GetPayload() *models.StorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateStorageProfileBadRequest() *CreateStorageProfileBadRequest { return &CreateStorageProfileBadRequest{} } -/*CreateStorageProfileBadRequest handles this case with default header values. +/* CreateStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateStorageProfileBadRequest struct { func (o *CreateStorageProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles][%d] createStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateStorageProfileForbidden() *CreateStorageProfileForbidden { return &CreateStorageProfileForbidden{} } -/*CreateStorageProfileForbidden handles this case with default header values. +/* CreateStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateStorageProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/storage-profiles][%d] createStorageProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/storage-profiles][%d] createStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/create_vsphere_storage_profile_parameters.go b/pkg/client/storage_profile/create_vsphere_storage_profile_parameters.go index 7b57d07e..4c23a253 100644 --- a/pkg/client/storage_profile/create_vsphere_storage_profile_parameters.go +++ b/pkg/client/storage_profile/create_vsphere_storage_profile_parameters.go @@ -18,58 +18,58 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateVSphereStorageProfileParams creates a new CreateVSphereStorageProfileParams object -// with the default values initialized. +// NewCreateVSphereStorageProfileParams creates a new CreateVSphereStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateVSphereStorageProfileParams() *CreateVSphereStorageProfileParams { - var () return &CreateVSphereStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewCreateVSphereStorageProfileParamsWithTimeout creates a new CreateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateVSphereStorageProfileParamsWithTimeout(timeout time.Duration) *CreateVSphereStorageProfileParams { - var () return &CreateVSphereStorageProfileParams{ - timeout: timeout, } } // NewCreateVSphereStorageProfileParamsWithContext creates a new CreateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateVSphereStorageProfileParamsWithContext(ctx context.Context) *CreateVSphereStorageProfileParams { - var () return &CreateVSphereStorageProfileParams{ - Context: ctx, } } // NewCreateVSphereStorageProfileParamsWithHTTPClient creates a new CreateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateVSphereStorageProfileParamsWithHTTPClient(client *http.Client) *CreateVSphereStorageProfileParams { - var () return &CreateVSphereStorageProfileParams{ HTTPClient: client, } } -/*CreateVSphereStorageProfileParams contains all the parameters to send to the API endpoint -for the create v sphere storage profile operation typically these are written to a http.Request +/* CreateVSphereStorageProfileParams contains all the parameters to send to the API endpoint + for the create v sphere storage profile operation. + + Typically these are written to a http.Request. */ type CreateVSphereStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileVsphereSpecification instance + /* Body. + + StorageProfileVsphereSpecification instance */ Body *models.StorageProfileVsphereSpecification @@ -78,6 +78,21 @@ type CreateVSphereStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVSphereStorageProfileParams) WithDefaults() *CreateVSphereStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateVSphereStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create v sphere storage profile params func (o *CreateVSphereStorageProfileParams) WithTimeout(timeout time.Duration) *CreateVSphereStorageProfileParams { o.SetTimeout(timeout) @@ -145,18 +160,18 @@ func (o *CreateVSphereStorageProfileParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/create_vsphere_storage_profile_responses.go b/pkg/client/storage_profile/create_vsphere_storage_profile_responses.go index 561868cc..069fe25e 100644 --- a/pkg/client/storage_profile/create_vsphere_storage_profile_responses.go +++ b/pkg/client/storage_profile/create_vsphere_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *CreateVSphereStorageProfileReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewCreateVSphereStorageProfileCreated() *CreateVSphereStorageProfileCreated return &CreateVSphereStorageProfileCreated{} } -/*CreateVSphereStorageProfileCreated handles this case with default header values. +/* CreateVSphereStorageProfileCreated describes a response with status code 201, with default header values. successful operation */ @@ -63,7 +62,6 @@ type CreateVSphereStorageProfileCreated struct { func (o *CreateVSphereStorageProfileCreated) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-vsphere][%d] createVSphereStorageProfileCreated %+v", 201, o.Payload) } - func (o *CreateVSphereStorageProfileCreated) GetPayload() *models.VsphereStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewCreateVSphereStorageProfileBadRequest() *CreateVSphereStorageProfileBadR return &CreateVSphereStorageProfileBadRequest{} } -/*CreateVSphereStorageProfileBadRequest handles this case with default header values. +/* CreateVSphereStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type CreateVSphereStorageProfileBadRequest struct { func (o *CreateVSphereStorageProfileBadRequest) Error() string { return fmt.Sprintf("[POST /iaas/api/storage-profiles-vsphere][%d] createVSphereStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *CreateVSphereStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewCreateVSphereStorageProfileForbidden() *CreateVSphereStorageProfileForbi return &CreateVSphereStorageProfileForbidden{} } -/*CreateVSphereStorageProfileForbidden handles this case with default header values. +/* CreateVSphereStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type CreateVSphereStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *CreateVSphereStorageProfileForbidden) Error() string { - return fmt.Sprintf("[POST /iaas/api/storage-profiles-vsphere][%d] createVSphereStorageProfileForbidden ", 403) + return fmt.Sprintf("[POST /iaas/api/storage-profiles-vsphere][%d] createVSphereStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *CreateVSphereStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *CreateVSphereStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/delete_aws_storage_profile_parameters.go b/pkg/client/storage_profile/delete_aws_storage_profile_parameters.go index 63e19aad..7641881c 100644 --- a/pkg/client/storage_profile/delete_aws_storage_profile_parameters.go +++ b/pkg/client/storage_profile/delete_aws_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAwsStorageProfileParams creates a new DeleteAwsStorageProfileParams object -// with the default values initialized. +// NewDeleteAwsStorageProfileParams creates a new DeleteAwsStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteAwsStorageProfileParams() *DeleteAwsStorageProfileParams { - var () return &DeleteAwsStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAwsStorageProfileParamsWithTimeout creates a new DeleteAwsStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAwsStorageProfileParamsWithTimeout(timeout time.Duration) *DeleteAwsStorageProfileParams { - var () return &DeleteAwsStorageProfileParams{ - timeout: timeout, } } // NewDeleteAwsStorageProfileParamsWithContext creates a new DeleteAwsStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAwsStorageProfileParamsWithContext(ctx context.Context) *DeleteAwsStorageProfileParams { - var () return &DeleteAwsStorageProfileParams{ - Context: ctx, } } // NewDeleteAwsStorageProfileParamsWithHTTPClient creates a new DeleteAwsStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAwsStorageProfileParamsWithHTTPClient(client *http.Client) *DeleteAwsStorageProfileParams { - var () return &DeleteAwsStorageProfileParams{ HTTPClient: client, } } -/*DeleteAwsStorageProfileParams contains all the parameters to send to the API endpoint -for the delete aws storage profile operation typically these are written to a http.Request +/* DeleteAwsStorageProfileParams contains all the parameters to send to the API endpoint + for the delete aws storage profile operation. + + Typically these are written to a http.Request. */ type DeleteAwsStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -76,6 +76,21 @@ type DeleteAwsStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAwsStorageProfileParams) WithDefaults() *DeleteAwsStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAwsStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete aws storage profile params func (o *DeleteAwsStorageProfileParams) WithTimeout(timeout time.Duration) *DeleteAwsStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteAwsStorageProfileParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/delete_aws_storage_profile_responses.go b/pkg/client/storage_profile/delete_aws_storage_profile_responses.go index 0f9b47ab..c0718d28 100644 --- a/pkg/client/storage_profile/delete_aws_storage_profile_responses.go +++ b/pkg/client/storage_profile/delete_aws_storage_profile_responses.go @@ -7,9 +7,12 @@ package storage_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteAwsStorageProfileReader is a Reader for the DeleteAwsStorageProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteAwsStorageProfileReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteAwsStorageProfileNoContent() *DeleteAwsStorageProfileNoContent { return &DeleteAwsStorageProfileNoContent{} } -/*DeleteAwsStorageProfileNoContent handles this case with default header values. +/* DeleteAwsStorageProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteAwsStorageProfileForbidden() *DeleteAwsStorageProfileForbidden { return &DeleteAwsStorageProfileForbidden{} } -/*DeleteAwsStorageProfileForbidden handles this case with default header values. +/* DeleteAwsStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteAwsStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteAwsStorageProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-aws/{id}][%d] deleteAwsStorageProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-aws/{id}][%d] deleteAwsStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteAwsStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteAwsStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/delete_azure_storage_profile_parameters.go b/pkg/client/storage_profile/delete_azure_storage_profile_parameters.go index 0be2da26..1546a94e 100644 --- a/pkg/client/storage_profile/delete_azure_storage_profile_parameters.go +++ b/pkg/client/storage_profile/delete_azure_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAzureStorageProfileParams creates a new DeleteAzureStorageProfileParams object -// with the default values initialized. +// NewDeleteAzureStorageProfileParams creates a new DeleteAzureStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteAzureStorageProfileParams() *DeleteAzureStorageProfileParams { - var () return &DeleteAzureStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAzureStorageProfileParamsWithTimeout creates a new DeleteAzureStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAzureStorageProfileParamsWithTimeout(timeout time.Duration) *DeleteAzureStorageProfileParams { - var () return &DeleteAzureStorageProfileParams{ - timeout: timeout, } } // NewDeleteAzureStorageProfileParamsWithContext creates a new DeleteAzureStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAzureStorageProfileParamsWithContext(ctx context.Context) *DeleteAzureStorageProfileParams { - var () return &DeleteAzureStorageProfileParams{ - Context: ctx, } } // NewDeleteAzureStorageProfileParamsWithHTTPClient creates a new DeleteAzureStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAzureStorageProfileParamsWithHTTPClient(client *http.Client) *DeleteAzureStorageProfileParams { - var () return &DeleteAzureStorageProfileParams{ HTTPClient: client, } } -/*DeleteAzureStorageProfileParams contains all the parameters to send to the API endpoint -for the delete azure storage profile operation typically these are written to a http.Request +/* DeleteAzureStorageProfileParams contains all the parameters to send to the API endpoint + for the delete azure storage profile operation. + + Typically these are written to a http.Request. */ type DeleteAzureStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -76,6 +76,21 @@ type DeleteAzureStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAzureStorageProfileParams) WithDefaults() *DeleteAzureStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAzureStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete azure storage profile params func (o *DeleteAzureStorageProfileParams) WithTimeout(timeout time.Duration) *DeleteAzureStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteAzureStorageProfileParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/delete_azure_storage_profile_responses.go b/pkg/client/storage_profile/delete_azure_storage_profile_responses.go index 0be5622d..239820f0 100644 --- a/pkg/client/storage_profile/delete_azure_storage_profile_responses.go +++ b/pkg/client/storage_profile/delete_azure_storage_profile_responses.go @@ -7,9 +7,12 @@ package storage_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteAzureStorageProfileReader is a Reader for the DeleteAzureStorageProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteAzureStorageProfileReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteAzureStorageProfileNoContent() *DeleteAzureStorageProfileNoContent return &DeleteAzureStorageProfileNoContent{} } -/*DeleteAzureStorageProfileNoContent handles this case with default header values. +/* DeleteAzureStorageProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteAzureStorageProfileForbidden() *DeleteAzureStorageProfileForbidden return &DeleteAzureStorageProfileForbidden{} } -/*DeleteAzureStorageProfileForbidden handles this case with default header values. +/* DeleteAzureStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteAzureStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteAzureStorageProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-azure/{id}][%d] deleteAzureStorageProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-azure/{id}][%d] deleteAzureStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteAzureStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteAzureStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/delete_storage_profile_parameters.go b/pkg/client/storage_profile/delete_storage_profile_parameters.go index f381f773..d766ac99 100644 --- a/pkg/client/storage_profile/delete_storage_profile_parameters.go +++ b/pkg/client/storage_profile/delete_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteStorageProfileParams creates a new DeleteStorageProfileParams object -// with the default values initialized. +// NewDeleteStorageProfileParams creates a new DeleteStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteStorageProfileParams() *DeleteStorageProfileParams { - var () return &DeleteStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteStorageProfileParamsWithTimeout creates a new DeleteStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteStorageProfileParamsWithTimeout(timeout time.Duration) *DeleteStorageProfileParams { - var () return &DeleteStorageProfileParams{ - timeout: timeout, } } // NewDeleteStorageProfileParamsWithContext creates a new DeleteStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteStorageProfileParamsWithContext(ctx context.Context) *DeleteStorageProfileParams { - var () return &DeleteStorageProfileParams{ - Context: ctx, } } // NewDeleteStorageProfileParamsWithHTTPClient creates a new DeleteStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteStorageProfileParamsWithHTTPClient(client *http.Client) *DeleteStorageProfileParams { - var () return &DeleteStorageProfileParams{ HTTPClient: client, } } -/*DeleteStorageProfileParams contains all the parameters to send to the API endpoint -for the delete storage profile operation typically these are written to a http.Request +/* DeleteStorageProfileParams contains all the parameters to send to the API endpoint + for the delete storage profile operation. + + Typically these are written to a http.Request. */ type DeleteStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -76,6 +76,21 @@ type DeleteStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStorageProfileParams) WithDefaults() *DeleteStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete storage profile params func (o *DeleteStorageProfileParams) WithTimeout(timeout time.Duration) *DeleteStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteStorageProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/delete_storage_profile_responses.go b/pkg/client/storage_profile/delete_storage_profile_responses.go index d98926b9..f12cf490 100644 --- a/pkg/client/storage_profile/delete_storage_profile_responses.go +++ b/pkg/client/storage_profile/delete_storage_profile_responses.go @@ -7,9 +7,12 @@ package storage_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteStorageProfileReader is a Reader for the DeleteStorageProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteStorageProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteStorageProfileNoContent() *DeleteStorageProfileNoContent { return &DeleteStorageProfileNoContent{} } -/*DeleteStorageProfileNoContent handles this case with default header values. +/* DeleteStorageProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteStorageProfileForbidden() *DeleteStorageProfileForbidden { return &DeleteStorageProfileForbidden{} } -/*DeleteStorageProfileForbidden handles this case with default header values. +/* DeleteStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteStorageProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/storage-profiles/{id}][%d] deleteStorageProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/storage-profiles/{id}][%d] deleteStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/delete_vsphere_storage_profile_parameters.go b/pkg/client/storage_profile/delete_vsphere_storage_profile_parameters.go index 82eee0c9..052573d4 100644 --- a/pkg/client/storage_profile/delete_vsphere_storage_profile_parameters.go +++ b/pkg/client/storage_profile/delete_vsphere_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteVSphereStorageProfileParams creates a new DeleteVSphereStorageProfileParams object -// with the default values initialized. +// NewDeleteVSphereStorageProfileParams creates a new DeleteVSphereStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteVSphereStorageProfileParams() *DeleteVSphereStorageProfileParams { - var () return &DeleteVSphereStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteVSphereStorageProfileParamsWithTimeout creates a new DeleteVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteVSphereStorageProfileParamsWithTimeout(timeout time.Duration) *DeleteVSphereStorageProfileParams { - var () return &DeleteVSphereStorageProfileParams{ - timeout: timeout, } } // NewDeleteVSphereStorageProfileParamsWithContext creates a new DeleteVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteVSphereStorageProfileParamsWithContext(ctx context.Context) *DeleteVSphereStorageProfileParams { - var () return &DeleteVSphereStorageProfileParams{ - Context: ctx, } } // NewDeleteVSphereStorageProfileParamsWithHTTPClient creates a new DeleteVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteVSphereStorageProfileParamsWithHTTPClient(client *http.Client) *DeleteVSphereStorageProfileParams { - var () return &DeleteVSphereStorageProfileParams{ HTTPClient: client, } } -/*DeleteVSphereStorageProfileParams contains all the parameters to send to the API endpoint -for the delete v sphere storage profile operation typically these are written to a http.Request +/* DeleteVSphereStorageProfileParams contains all the parameters to send to the API endpoint + for the delete v sphere storage profile operation. + + Typically these are written to a http.Request. */ type DeleteVSphereStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -76,6 +76,21 @@ type DeleteVSphereStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVSphereStorageProfileParams) WithDefaults() *DeleteVSphereStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteVSphereStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete v sphere storage profile params func (o *DeleteVSphereStorageProfileParams) WithTimeout(timeout time.Duration) *DeleteVSphereStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *DeleteVSphereStorageProfileParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/delete_vsphere_storage_profile_responses.go b/pkg/client/storage_profile/delete_vsphere_storage_profile_responses.go index e5179d86..90ebe813 100644 --- a/pkg/client/storage_profile/delete_vsphere_storage_profile_responses.go +++ b/pkg/client/storage_profile/delete_vsphere_storage_profile_responses.go @@ -7,9 +7,12 @@ package storage_profile import ( "fmt" + "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + + "github.com/vmware/vra-sdk-go/pkg/models" ) // DeleteVSphereStorageProfileReader is a Reader for the DeleteVSphereStorageProfile structure. @@ -32,7 +35,6 @@ func (o *DeleteVSphereStorageProfileReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -43,7 +45,7 @@ func NewDeleteVSphereStorageProfileNoContent() *DeleteVSphereStorageProfileNoCon return &DeleteVSphereStorageProfileNoContent{} } -/*DeleteVSphereStorageProfileNoContent handles this case with default header values. +/* DeleteVSphereStorageProfileNoContent describes a response with status code 204, with default header values. No Content */ @@ -64,18 +66,29 @@ func NewDeleteVSphereStorageProfileForbidden() *DeleteVSphereStorageProfileForbi return &DeleteVSphereStorageProfileForbidden{} } -/*DeleteVSphereStorageProfileForbidden handles this case with default header values. +/* DeleteVSphereStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type DeleteVSphereStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *DeleteVSphereStorageProfileForbidden) Error() string { - return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-vsphere/{id}][%d] deleteVSphereStorageProfileForbidden ", 403) + return fmt.Sprintf("[DELETE /iaas/api/storage-profiles-vsphere/{id}][%d] deleteVSphereStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *DeleteVSphereStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *DeleteVSphereStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/get_aws_storage_profile_parameters.go b/pkg/client/storage_profile/get_aws_storage_profile_parameters.go index 700eda25..00a4fa9f 100644 --- a/pkg/client/storage_profile/get_aws_storage_profile_parameters.go +++ b/pkg/client/storage_profile/get_aws_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAwsStorageProfileParams creates a new GetAwsStorageProfileParams object -// with the default values initialized. +// NewGetAwsStorageProfileParams creates a new GetAwsStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAwsStorageProfileParams() *GetAwsStorageProfileParams { - var () return &GetAwsStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetAwsStorageProfileParamsWithTimeout creates a new GetAwsStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAwsStorageProfileParamsWithTimeout(timeout time.Duration) *GetAwsStorageProfileParams { - var () return &GetAwsStorageProfileParams{ - timeout: timeout, } } // NewGetAwsStorageProfileParamsWithContext creates a new GetAwsStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAwsStorageProfileParamsWithContext(ctx context.Context) *GetAwsStorageProfileParams { - var () return &GetAwsStorageProfileParams{ - Context: ctx, } } // NewGetAwsStorageProfileParamsWithHTTPClient creates a new GetAwsStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAwsStorageProfileParamsWithHTTPClient(client *http.Client) *GetAwsStorageProfileParams { - var () return &GetAwsStorageProfileParams{ HTTPClient: client, } } -/*GetAwsStorageProfileParams contains all the parameters to send to the API endpoint -for the get aws storage profile operation typically these are written to a http.Request +/* GetAwsStorageProfileParams contains all the parameters to send to the API endpoint + for the get aws storage profile operation. + + Typically these are written to a http.Request. */ type GetAwsStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of storage profile. + /* ID. + + The ID of storage profile. */ ID string @@ -76,6 +76,21 @@ type GetAwsStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsStorageProfileParams) WithDefaults() *GetAwsStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get aws storage profile params func (o *GetAwsStorageProfileParams) WithTimeout(timeout time.Duration) *GetAwsStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetAwsStorageProfileParams) WriteToRequest(r runtime.ClientRequest, reg // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/get_aws_storage_profile_responses.go b/pkg/client/storage_profile/get_aws_storage_profile_responses.go index 26705821..905b436a 100644 --- a/pkg/client/storage_profile/get_aws_storage_profile_responses.go +++ b/pkg/client/storage_profile/get_aws_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetAwsStorageProfileReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetAwsStorageProfileOK() *GetAwsStorageProfileOK { return &GetAwsStorageProfileOK{} } -/*GetAwsStorageProfileOK handles this case with default header values. +/* GetAwsStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetAwsStorageProfileOK struct { func (o *GetAwsStorageProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws/{id}][%d] getAwsStorageProfileOK %+v", 200, o.Payload) } - func (o *GetAwsStorageProfileOK) GetPayload() *models.AwsStorageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetAwsStorageProfileForbidden() *GetAwsStorageProfileForbidden { return &GetAwsStorageProfileForbidden{} } -/*GetAwsStorageProfileForbidden handles this case with default header values. +/* GetAwsStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAwsStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAwsStorageProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws/{id}][%d] getAwsStorageProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws/{id}][%d] getAwsStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *GetAwsStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAwsStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetAwsStorageProfileNotFound() *GetAwsStorageProfileNotFound { return &GetAwsStorageProfileNotFound{} } -/*GetAwsStorageProfileNotFound handles this case with default header values. +/* GetAwsStorageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetAwsStorageProfileNotFound struct { func (o *GetAwsStorageProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws/{id}][%d] getAwsStorageProfileNotFound %+v", 404, o.Payload) } - func (o *GetAwsStorageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/storage_profile/get_aws_storage_profiles_parameters.go b/pkg/client/storage_profile/get_aws_storage_profiles_parameters.go index dfeef5e3..77ecb831 100644 --- a/pkg/client/storage_profile/get_aws_storage_profiles_parameters.go +++ b/pkg/client/storage_profile/get_aws_storage_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAwsStorageProfilesParams creates a new GetAwsStorageProfilesParams object -// with the default values initialized. +// NewGetAwsStorageProfilesParams creates a new GetAwsStorageProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAwsStorageProfilesParams() *GetAwsStorageProfilesParams { - var () return &GetAwsStorageProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetAwsStorageProfilesParamsWithTimeout creates a new GetAwsStorageProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAwsStorageProfilesParamsWithTimeout(timeout time.Duration) *GetAwsStorageProfilesParams { - var () return &GetAwsStorageProfilesParams{ - timeout: timeout, } } // NewGetAwsStorageProfilesParamsWithContext creates a new GetAwsStorageProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAwsStorageProfilesParamsWithContext(ctx context.Context) *GetAwsStorageProfilesParams { - var () return &GetAwsStorageProfilesParams{ - Context: ctx, } } // NewGetAwsStorageProfilesParamsWithHTTPClient creates a new GetAwsStorageProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAwsStorageProfilesParamsWithHTTPClient(client *http.Client) *GetAwsStorageProfilesParams { - var () return &GetAwsStorageProfilesParams{ HTTPClient: client, } } -/*GetAwsStorageProfilesParams contains all the parameters to send to the API endpoint -for the get aws storage profiles operation typically these are written to a http.Request +/* GetAwsStorageProfilesParams contains all the parameters to send to the API endpoint + for the get aws storage profiles operation. + + Typically these are written to a http.Request. */ type GetAwsStorageProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetAwsStorageProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get aws storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsStorageProfilesParams) WithDefaults() *GetAwsStorageProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsStorageProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get aws storage profiles params func (o *GetAwsStorageProfilesParams) WithTimeout(timeout time.Duration) *GetAwsStorageProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetAwsStorageProfilesParams) WriteToRequest(r runtime.ClientRequest, re // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/storage_profile/get_aws_storage_profiles_responses.go b/pkg/client/storage_profile/get_aws_storage_profiles_responses.go index d83e30ee..ddc73719 100644 --- a/pkg/client/storage_profile/get_aws_storage_profiles_responses.go +++ b/pkg/client/storage_profile/get_aws_storage_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetAwsStorageProfilesReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAwsStorageProfilesOK() *GetAwsStorageProfilesOK { return &GetAwsStorageProfilesOK{} } -/*GetAwsStorageProfilesOK handles this case with default header values. +/* GetAwsStorageProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetAwsStorageProfilesOK struct { func (o *GetAwsStorageProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws][%d] getAwsStorageProfilesOK %+v", 200, o.Payload) } - func (o *GetAwsStorageProfilesOK) GetPayload() *models.StorageProfileAwsResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetAwsStorageProfilesForbidden() *GetAwsStorageProfilesForbidden { return &GetAwsStorageProfilesForbidden{} } -/*GetAwsStorageProfilesForbidden handles this case with default header values. +/* GetAwsStorageProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAwsStorageProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAwsStorageProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws][%d] getAwsStorageProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-aws][%d] getAwsStorageProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetAwsStorageProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAwsStorageProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/get_azure_storage_profile_parameters.go b/pkg/client/storage_profile/get_azure_storage_profile_parameters.go index 1d35ce38..e42f703c 100644 --- a/pkg/client/storage_profile/get_azure_storage_profile_parameters.go +++ b/pkg/client/storage_profile/get_azure_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAzureStorageProfileParams creates a new GetAzureStorageProfileParams object -// with the default values initialized. +// NewGetAzureStorageProfileParams creates a new GetAzureStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAzureStorageProfileParams() *GetAzureStorageProfileParams { - var () return &GetAzureStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetAzureStorageProfileParamsWithTimeout creates a new GetAzureStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAzureStorageProfileParamsWithTimeout(timeout time.Duration) *GetAzureStorageProfileParams { - var () return &GetAzureStorageProfileParams{ - timeout: timeout, } } // NewGetAzureStorageProfileParamsWithContext creates a new GetAzureStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAzureStorageProfileParamsWithContext(ctx context.Context) *GetAzureStorageProfileParams { - var () return &GetAzureStorageProfileParams{ - Context: ctx, } } // NewGetAzureStorageProfileParamsWithHTTPClient creates a new GetAzureStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAzureStorageProfileParamsWithHTTPClient(client *http.Client) *GetAzureStorageProfileParams { - var () return &GetAzureStorageProfileParams{ HTTPClient: client, } } -/*GetAzureStorageProfileParams contains all the parameters to send to the API endpoint -for the get azure storage profile operation typically these are written to a http.Request +/* GetAzureStorageProfileParams contains all the parameters to send to the API endpoint + for the get azure storage profile operation. + + Typically these are written to a http.Request. */ type GetAzureStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of storage profile. + /* ID. + + The ID of storage profile. */ ID string @@ -76,6 +76,21 @@ type GetAzureStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureStorageProfileParams) WithDefaults() *GetAzureStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get azure storage profile params func (o *GetAzureStorageProfileParams) WithTimeout(timeout time.Duration) *GetAzureStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetAzureStorageProfileParams) WriteToRequest(r runtime.ClientRequest, r // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/get_azure_storage_profile_responses.go b/pkg/client/storage_profile/get_azure_storage_profile_responses.go index 2dbaf853..f607229b 100644 --- a/pkg/client/storage_profile/get_azure_storage_profile_responses.go +++ b/pkg/client/storage_profile/get_azure_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetAzureStorageProfileReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetAzureStorageProfileOK() *GetAzureStorageProfileOK { return &GetAzureStorageProfileOK{} } -/*GetAzureStorageProfileOK handles this case with default header values. +/* GetAzureStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetAzureStorageProfileOK struct { func (o *GetAzureStorageProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure/{id}][%d] getAzureStorageProfileOK %+v", 200, o.Payload) } - func (o *GetAzureStorageProfileOK) GetPayload() *models.AzureStorageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetAzureStorageProfileForbidden() *GetAzureStorageProfileForbidden { return &GetAzureStorageProfileForbidden{} } -/*GetAzureStorageProfileForbidden handles this case with default header values. +/* GetAzureStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAzureStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAzureStorageProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure/{id}][%d] getAzureStorageProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure/{id}][%d] getAzureStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *GetAzureStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAzureStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetAzureStorageProfileNotFound() *GetAzureStorageProfileNotFound { return &GetAzureStorageProfileNotFound{} } -/*GetAzureStorageProfileNotFound handles this case with default header values. +/* GetAzureStorageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetAzureStorageProfileNotFound struct { func (o *GetAzureStorageProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure/{id}][%d] getAzureStorageProfileNotFound %+v", 404, o.Payload) } - func (o *GetAzureStorageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/storage_profile/get_azure_storage_profiles_parameters.go b/pkg/client/storage_profile/get_azure_storage_profiles_parameters.go index 940c3b98..ce789054 100644 --- a/pkg/client/storage_profile/get_azure_storage_profiles_parameters.go +++ b/pkg/client/storage_profile/get_azure_storage_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAzureStorageProfilesParams creates a new GetAzureStorageProfilesParams object -// with the default values initialized. +// NewGetAzureStorageProfilesParams creates a new GetAzureStorageProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAzureStorageProfilesParams() *GetAzureStorageProfilesParams { - var () return &GetAzureStorageProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetAzureStorageProfilesParamsWithTimeout creates a new GetAzureStorageProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAzureStorageProfilesParamsWithTimeout(timeout time.Duration) *GetAzureStorageProfilesParams { - var () return &GetAzureStorageProfilesParams{ - timeout: timeout, } } // NewGetAzureStorageProfilesParamsWithContext creates a new GetAzureStorageProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAzureStorageProfilesParamsWithContext(ctx context.Context) *GetAzureStorageProfilesParams { - var () return &GetAzureStorageProfilesParams{ - Context: ctx, } } // NewGetAzureStorageProfilesParamsWithHTTPClient creates a new GetAzureStorageProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAzureStorageProfilesParamsWithHTTPClient(client *http.Client) *GetAzureStorageProfilesParams { - var () return &GetAzureStorageProfilesParams{ HTTPClient: client, } } -/*GetAzureStorageProfilesParams contains all the parameters to send to the API endpoint -for the get azure storage profiles operation typically these are written to a http.Request +/* GetAzureStorageProfilesParams contains all the parameters to send to the API endpoint + for the get azure storage profiles operation. + + Typically these are written to a http.Request. */ type GetAzureStorageProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetAzureStorageProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get azure storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureStorageProfilesParams) WithDefaults() *GetAzureStorageProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureStorageProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get azure storage profiles params func (o *GetAzureStorageProfilesParams) WithTimeout(timeout time.Duration) *GetAzureStorageProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetAzureStorageProfilesParams) WriteToRequest(r runtime.ClientRequest, // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/storage_profile/get_azure_storage_profiles_responses.go b/pkg/client/storage_profile/get_azure_storage_profiles_responses.go index b9125456..315f447a 100644 --- a/pkg/client/storage_profile/get_azure_storage_profiles_responses.go +++ b/pkg/client/storage_profile/get_azure_storage_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetAzureStorageProfilesReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetAzureStorageProfilesOK() *GetAzureStorageProfilesOK { return &GetAzureStorageProfilesOK{} } -/*GetAzureStorageProfilesOK handles this case with default header values. +/* GetAzureStorageProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetAzureStorageProfilesOK struct { func (o *GetAzureStorageProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure][%d] getAzureStorageProfilesOK %+v", 200, o.Payload) } - func (o *GetAzureStorageProfilesOK) GetPayload() *models.StorageProfileAzureResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetAzureStorageProfilesForbidden() *GetAzureStorageProfilesForbidden { return &GetAzureStorageProfilesForbidden{} } -/*GetAzureStorageProfilesForbidden handles this case with default header values. +/* GetAzureStorageProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetAzureStorageProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetAzureStorageProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure][%d] getAzureStorageProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-azure][%d] getAzureStorageProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetAzureStorageProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetAzureStorageProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/get_storage_profile_parameters.go b/pkg/client/storage_profile/get_storage_profile_parameters.go index fa09432c..c2eac14b 100644 --- a/pkg/client/storage_profile/get_storage_profile_parameters.go +++ b/pkg/client/storage_profile/get_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetStorageProfileParams creates a new GetStorageProfileParams object -// with the default values initialized. +// NewGetStorageProfileParams creates a new GetStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetStorageProfileParams() *GetStorageProfileParams { - var () return &GetStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetStorageProfileParamsWithTimeout creates a new GetStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetStorageProfileParamsWithTimeout(timeout time.Duration) *GetStorageProfileParams { - var () return &GetStorageProfileParams{ - timeout: timeout, } } // NewGetStorageProfileParamsWithContext creates a new GetStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetStorageProfileParamsWithContext(ctx context.Context) *GetStorageProfileParams { - var () return &GetStorageProfileParams{ - Context: ctx, } } // NewGetStorageProfileParamsWithHTTPClient creates a new GetStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetStorageProfileParamsWithHTTPClient(client *http.Client) *GetStorageProfileParams { - var () return &GetStorageProfileParams{ HTTPClient: client, } } -/*GetStorageProfileParams contains all the parameters to send to the API endpoint -for the get storage profile operation typically these are written to a http.Request +/* GetStorageProfileParams contains all the parameters to send to the API endpoint + for the get storage profile operation. + + Typically these are written to a http.Request. */ type GetStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of storage profile. + /* ID. + + The ID of storage profile. */ ID string @@ -76,6 +76,21 @@ type GetStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStorageProfileParams) WithDefaults() *GetStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get storage profile params func (o *GetStorageProfileParams) WithTimeout(timeout time.Duration) *GetStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetStorageProfileParams) WriteToRequest(r runtime.ClientRequest, reg st // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/get_storage_profile_responses.go b/pkg/client/storage_profile/get_storage_profile_responses.go index 0b84aa8c..70e296bd 100644 --- a/pkg/client/storage_profile/get_storage_profile_responses.go +++ b/pkg/client/storage_profile/get_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetStorageProfileReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetStorageProfileOK() *GetStorageProfileOK { return &GetStorageProfileOK{} } -/*GetStorageProfileOK handles this case with default header values. +/* GetStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetStorageProfileOK struct { func (o *GetStorageProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles/{id}][%d] getStorageProfileOK %+v", 200, o.Payload) } - func (o *GetStorageProfileOK) GetPayload() *models.StorageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetStorageProfileForbidden() *GetStorageProfileForbidden { return &GetStorageProfileForbidden{} } -/*GetStorageProfileForbidden handles this case with default header values. +/* GetStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetStorageProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles/{id}][%d] getStorageProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles/{id}][%d] getStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *GetStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetStorageProfileNotFound() *GetStorageProfileNotFound { return &GetStorageProfileNotFound{} } -/*GetStorageProfileNotFound handles this case with default header values. +/* GetStorageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetStorageProfileNotFound struct { func (o *GetStorageProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles/{id}][%d] getStorageProfileNotFound %+v", 404, o.Payload) } - func (o *GetStorageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/storage_profile/get_storage_profiles_parameters.go b/pkg/client/storage_profile/get_storage_profiles_parameters.go index eec80071..3dd3ff24 100644 --- a/pkg/client/storage_profile/get_storage_profiles_parameters.go +++ b/pkg/client/storage_profile/get_storage_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetStorageProfilesParams creates a new GetStorageProfilesParams object -// with the default values initialized. +// NewGetStorageProfilesParams creates a new GetStorageProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetStorageProfilesParams() *GetStorageProfilesParams { - var () return &GetStorageProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetStorageProfilesParamsWithTimeout creates a new GetStorageProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetStorageProfilesParamsWithTimeout(timeout time.Duration) *GetStorageProfilesParams { - var () return &GetStorageProfilesParams{ - timeout: timeout, } } // NewGetStorageProfilesParamsWithContext creates a new GetStorageProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetStorageProfilesParamsWithContext(ctx context.Context) *GetStorageProfilesParams { - var () return &GetStorageProfilesParams{ - Context: ctx, } } // NewGetStorageProfilesParamsWithHTTPClient creates a new GetStorageProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetStorageProfilesParamsWithHTTPClient(client *http.Client) *GetStorageProfilesParams { - var () return &GetStorageProfilesParams{ HTTPClient: client, } } -/*GetStorageProfilesParams contains all the parameters to send to the API endpoint -for the get storage profiles operation typically these are written to a http.Request +/* GetStorageProfilesParams contains all the parameters to send to the API endpoint + for the get storage profiles operation. + + Typically these are written to a http.Request. */ type GetStorageProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetStorageProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStorageProfilesParams) WithDefaults() *GetStorageProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStorageProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get storage profiles params func (o *GetStorageProfilesParams) WithTimeout(timeout time.Duration) *GetStorageProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetStorageProfilesParams) WriteToRequest(r runtime.ClientRequest, reg s // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/storage_profile/get_storage_profiles_responses.go b/pkg/client/storage_profile/get_storage_profiles_responses.go index 8a04dca4..fd3cb661 100644 --- a/pkg/client/storage_profile/get_storage_profiles_responses.go +++ b/pkg/client/storage_profile/get_storage_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetStorageProfilesReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetStorageProfilesOK() *GetStorageProfilesOK { return &GetStorageProfilesOK{} } -/*GetStorageProfilesOK handles this case with default header values. +/* GetStorageProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetStorageProfilesOK struct { func (o *GetStorageProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles][%d] getStorageProfilesOK %+v", 200, o.Payload) } - func (o *GetStorageProfilesOK) GetPayload() *models.StorageProfileResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetStorageProfilesForbidden() *GetStorageProfilesForbidden { return &GetStorageProfilesForbidden{} } -/*GetStorageProfilesForbidden handles this case with default header values. +/* GetStorageProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetStorageProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetStorageProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles][%d] getStorageProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles][%d] getStorageProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetStorageProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetStorageProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/get_vsphere_storage_profile_parameters.go b/pkg/client/storage_profile/get_vsphere_storage_profile_parameters.go index 95251edd..ddce5cc5 100644 --- a/pkg/client/storage_profile/get_vsphere_storage_profile_parameters.go +++ b/pkg/client/storage_profile/get_vsphere_storage_profile_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVSphereStorageProfileParams creates a new GetVSphereStorageProfileParams object -// with the default values initialized. +// NewGetVSphereStorageProfileParams creates a new GetVSphereStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVSphereStorageProfileParams() *GetVSphereStorageProfileParams { - var () return &GetVSphereStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewGetVSphereStorageProfileParamsWithTimeout creates a new GetVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVSphereStorageProfileParamsWithTimeout(timeout time.Duration) *GetVSphereStorageProfileParams { - var () return &GetVSphereStorageProfileParams{ - timeout: timeout, } } // NewGetVSphereStorageProfileParamsWithContext creates a new GetVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVSphereStorageProfileParamsWithContext(ctx context.Context) *GetVSphereStorageProfileParams { - var () return &GetVSphereStorageProfileParams{ - Context: ctx, } } // NewGetVSphereStorageProfileParamsWithHTTPClient creates a new GetVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVSphereStorageProfileParamsWithHTTPClient(client *http.Client) *GetVSphereStorageProfileParams { - var () return &GetVSphereStorageProfileParams{ HTTPClient: client, } } -/*GetVSphereStorageProfileParams contains all the parameters to send to the API endpoint -for the get v sphere storage profile operation typically these are written to a http.Request +/* GetVSphereStorageProfileParams contains all the parameters to send to the API endpoint + for the get v sphere storage profile operation. + + Typically these are written to a http.Request. */ type GetVSphereStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*ID - The ID of storage profile. + /* ID. + + The ID of storage profile. */ ID string @@ -76,6 +76,21 @@ type GetVSphereStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereStorageProfileParams) WithDefaults() *GetVSphereStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get v sphere storage profile params func (o *GetVSphereStorageProfileParams) WithTimeout(timeout time.Duration) *GetVSphereStorageProfileParams { o.SetTimeout(timeout) @@ -143,16 +158,17 @@ func (o *GetVSphereStorageProfileParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } // path param id diff --git a/pkg/client/storage_profile/get_vsphere_storage_profile_responses.go b/pkg/client/storage_profile/get_vsphere_storage_profile_responses.go index d65d849d..2234d4b1 100644 --- a/pkg/client/storage_profile/get_vsphere_storage_profile_responses.go +++ b/pkg/client/storage_profile/get_vsphere_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *GetVSphereStorageProfileReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewGetVSphereStorageProfileOK() *GetVSphereStorageProfileOK { return &GetVSphereStorageProfileOK{} } -/*GetVSphereStorageProfileOK handles this case with default header values. +/* GetVSphereStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type GetVSphereStorageProfileOK struct { func (o *GetVSphereStorageProfileOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere/{id}][%d] getVSphereStorageProfileOK %+v", 200, o.Payload) } - func (o *GetVSphereStorageProfileOK) GetPayload() *models.VsphereStorageProfile { return o.Payload } @@ -85,19 +83,30 @@ func NewGetVSphereStorageProfileForbidden() *GetVSphereStorageProfileForbidden { return &GetVSphereStorageProfileForbidden{} } -/*GetVSphereStorageProfileForbidden handles this case with default header values. +/* GetVSphereStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVSphereStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVSphereStorageProfileForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere/{id}][%d] getVSphereStorageProfileForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere/{id}][%d] getVSphereStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *GetVSphereStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVSphereStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } @@ -106,7 +115,7 @@ func NewGetVSphereStorageProfileNotFound() *GetVSphereStorageProfileNotFound { return &GetVSphereStorageProfileNotFound{} } -/*GetVSphereStorageProfileNotFound handles this case with default header values. +/* GetVSphereStorageProfileNotFound describes a response with status code 404, with default header values. Not Found */ @@ -117,7 +126,6 @@ type GetVSphereStorageProfileNotFound struct { func (o *GetVSphereStorageProfileNotFound) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere/{id}][%d] getVSphereStorageProfileNotFound %+v", 404, o.Payload) } - func (o *GetVSphereStorageProfileNotFound) GetPayload() *models.Error { return o.Payload } diff --git a/pkg/client/storage_profile/get_vsphere_storage_profiles_parameters.go b/pkg/client/storage_profile/get_vsphere_storage_profiles_parameters.go index 6d100dce..250de53a 100644 --- a/pkg/client/storage_profile/get_vsphere_storage_profiles_parameters.go +++ b/pkg/client/storage_profile/get_vsphere_storage_profiles_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVSphereStorageProfilesParams creates a new GetVSphereStorageProfilesParams object -// with the default values initialized. +// NewGetVSphereStorageProfilesParams creates a new GetVSphereStorageProfilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVSphereStorageProfilesParams() *GetVSphereStorageProfilesParams { - var () return &GetVSphereStorageProfilesParams{ - timeout: cr.DefaultTimeout, } } // NewGetVSphereStorageProfilesParamsWithTimeout creates a new GetVSphereStorageProfilesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVSphereStorageProfilesParamsWithTimeout(timeout time.Duration) *GetVSphereStorageProfilesParams { - var () return &GetVSphereStorageProfilesParams{ - timeout: timeout, } } // NewGetVSphereStorageProfilesParamsWithContext creates a new GetVSphereStorageProfilesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVSphereStorageProfilesParamsWithContext(ctx context.Context) *GetVSphereStorageProfilesParams { - var () return &GetVSphereStorageProfilesParams{ - Context: ctx, } } // NewGetVSphereStorageProfilesParamsWithHTTPClient creates a new GetVSphereStorageProfilesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVSphereStorageProfilesParamsWithHTTPClient(client *http.Client) *GetVSphereStorageProfilesParams { - var () return &GetVSphereStorageProfilesParams{ HTTPClient: client, } } -/*GetVSphereStorageProfilesParams contains all the parameters to send to the API endpoint -for the get v sphere storage profiles operation typically these are written to a http.Request +/* GetVSphereStorageProfilesParams contains all the parameters to send to the API endpoint + for the get v sphere storage profiles operation. + + Typically these are written to a http.Request. */ type GetVSphereStorageProfilesParams struct { - /*DollarFilter - Add a filter to return limited results + /* DollarFilter. + Add a filter to return limited results */ DollarFilter *string - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string @@ -76,6 +76,21 @@ type GetVSphereStorageProfilesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get v sphere storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereStorageProfilesParams) WithDefaults() *GetVSphereStorageProfilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v sphere storage profiles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVSphereStorageProfilesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get v sphere storage profiles params func (o *GetVSphereStorageProfilesParams) WithTimeout(timeout time.Duration) *GetVSphereStorageProfilesParams { o.SetTimeout(timeout) @@ -143,32 +158,34 @@ func (o *GetVSphereStorageProfilesParams) WriteToRequest(r runtime.ClientRequest // query param $filter var qrDollarFilter string + if o.DollarFilter != nil { qrDollarFilter = *o.DollarFilter } qDollarFilter := qrDollarFilter if qDollarFilter != "" { + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { return err } } - } if o.APIVersion != nil { // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } if len(res) > 0 { diff --git a/pkg/client/storage_profile/get_vsphere_storage_profiles_responses.go b/pkg/client/storage_profile/get_vsphere_storage_profiles_responses.go index bbf91676..22a8ace6 100644 --- a/pkg/client/storage_profile/get_vsphere_storage_profiles_responses.go +++ b/pkg/client/storage_profile/get_vsphere_storage_profiles_responses.go @@ -35,7 +35,6 @@ func (o *GetVSphereStorageProfilesReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetVSphereStorageProfilesOK() *GetVSphereStorageProfilesOK { return &GetVSphereStorageProfilesOK{} } -/*GetVSphereStorageProfilesOK handles this case with default header values. +/* GetVSphereStorageProfilesOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetVSphereStorageProfilesOK struct { func (o *GetVSphereStorageProfilesOK) Error() string { return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere][%d] getVSphereStorageProfilesOK %+v", 200, o.Payload) } - func (o *GetVSphereStorageProfilesOK) GetPayload() *models.StorageProfileVsphereResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetVSphereStorageProfilesForbidden() *GetVSphereStorageProfilesForbidden return &GetVSphereStorageProfilesForbidden{} } -/*GetVSphereStorageProfilesForbidden handles this case with default header values. +/* GetVSphereStorageProfilesForbidden describes a response with status code 403, with default header values. Forbidden */ type GetVSphereStorageProfilesForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetVSphereStorageProfilesForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere][%d] getVSphereStorageProfilesForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/storage-profiles-vsphere][%d] getVSphereStorageProfilesForbidden %+v", 403, o.Payload) +} +func (o *GetVSphereStorageProfilesForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetVSphereStorageProfilesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/replace_storage_profile_parameters.go b/pkg/client/storage_profile/replace_storage_profile_parameters.go index 712fa32c..4e68b4b3 100644 --- a/pkg/client/storage_profile/replace_storage_profile_parameters.go +++ b/pkg/client/storage_profile/replace_storage_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewReplaceStorageProfileParams creates a new ReplaceStorageProfileParams object -// with the default values initialized. +// NewReplaceStorageProfileParams creates a new ReplaceStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewReplaceStorageProfileParams() *ReplaceStorageProfileParams { - var () return &ReplaceStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewReplaceStorageProfileParamsWithTimeout creates a new ReplaceStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewReplaceStorageProfileParamsWithTimeout(timeout time.Duration) *ReplaceStorageProfileParams { - var () return &ReplaceStorageProfileParams{ - timeout: timeout, } } // NewReplaceStorageProfileParamsWithContext creates a new ReplaceStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewReplaceStorageProfileParamsWithContext(ctx context.Context) *ReplaceStorageProfileParams { - var () return &ReplaceStorageProfileParams{ - Context: ctx, } } // NewReplaceStorageProfileParamsWithHTTPClient creates a new ReplaceStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewReplaceStorageProfileParamsWithHTTPClient(client *http.Client) *ReplaceStorageProfileParams { - var () return &ReplaceStorageProfileParams{ HTTPClient: client, } } -/*ReplaceStorageProfileParams contains all the parameters to send to the API endpoint -for the replace storage profile operation typically these are written to a http.Request +/* ReplaceStorageProfileParams contains all the parameters to send to the API endpoint + for the replace storage profile operation. + + Typically these are written to a http.Request. */ type ReplaceStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileSpecification + /* Body. + + StorageProfileSpecification */ Body *models.StorageProfileSpecification - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -83,6 +84,21 @@ type ReplaceStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the replace storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceStorageProfileParams) WithDefaults() *ReplaceStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the replace storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the replace storage profile params func (o *ReplaceStorageProfileParams) WithTimeout(timeout time.Duration) *ReplaceStorageProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *ReplaceStorageProfileParams) WriteToRequest(r runtime.ClientRequest, re // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/replace_storage_profile_responses.go b/pkg/client/storage_profile/replace_storage_profile_responses.go index 61f340a8..1a35ef70 100644 --- a/pkg/client/storage_profile/replace_storage_profile_responses.go +++ b/pkg/client/storage_profile/replace_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *ReplaceStorageProfileReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewReplaceStorageProfileOK() *ReplaceStorageProfileOK { return &ReplaceStorageProfileOK{} } -/*ReplaceStorageProfileOK handles this case with default header values. +/* ReplaceStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type ReplaceStorageProfileOK struct { func (o *ReplaceStorageProfileOK) Error() string { return fmt.Sprintf("[PUT /iaas/api/storage-profiles/{id}][%d] replaceStorageProfileOK %+v", 200, o.Payload) } - func (o *ReplaceStorageProfileOK) GetPayload() *models.StorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewReplaceStorageProfileBadRequest() *ReplaceStorageProfileBadRequest { return &ReplaceStorageProfileBadRequest{} } -/*ReplaceStorageProfileBadRequest handles this case with default header values. +/* ReplaceStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type ReplaceStorageProfileBadRequest struct { func (o *ReplaceStorageProfileBadRequest) Error() string { return fmt.Sprintf("[PUT /iaas/api/storage-profiles/{id}][%d] replaceStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *ReplaceStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewReplaceStorageProfileForbidden() *ReplaceStorageProfileForbidden { return &ReplaceStorageProfileForbidden{} } -/*ReplaceStorageProfileForbidden handles this case with default header values. +/* ReplaceStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type ReplaceStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *ReplaceStorageProfileForbidden) Error() string { - return fmt.Sprintf("[PUT /iaas/api/storage-profiles/{id}][%d] replaceStorageProfileForbidden ", 403) + return fmt.Sprintf("[PUT /iaas/api/storage-profiles/{id}][%d] replaceStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *ReplaceStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *ReplaceStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/storage_profile_client.go b/pkg/client/storage_profile/storage_profile_client.go index ffa43804..58f80826 100644 --- a/pkg/client/storage_profile/storage_profile_client.go +++ b/pkg/client/storage_profile/storage_profile_client.go @@ -25,47 +25,50 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateAwsStorageProfile(params *CreateAwsStorageProfileParams) (*CreateAwsStorageProfileCreated, error) + CreateAwsStorageProfile(params *CreateAwsStorageProfileParams, opts ...ClientOption) (*CreateAwsStorageProfileCreated, error) - CreateAzureStorageProfile(params *CreateAzureStorageProfileParams) (*CreateAzureStorageProfileCreated, error) + CreateAzureStorageProfile(params *CreateAzureStorageProfileParams, opts ...ClientOption) (*CreateAzureStorageProfileCreated, error) - CreateStorageProfile(params *CreateStorageProfileParams) (*CreateStorageProfileCreated, error) + CreateStorageProfile(params *CreateStorageProfileParams, opts ...ClientOption) (*CreateStorageProfileCreated, error) - CreateVSphereStorageProfile(params *CreateVSphereStorageProfileParams) (*CreateVSphereStorageProfileCreated, error) + CreateVSphereStorageProfile(params *CreateVSphereStorageProfileParams, opts ...ClientOption) (*CreateVSphereStorageProfileCreated, error) - DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams) (*DeleteAwsStorageProfileNoContent, error) + DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams, opts ...ClientOption) (*DeleteAwsStorageProfileNoContent, error) - DeleteAzureStorageProfile(params *DeleteAzureStorageProfileParams) (*DeleteAzureStorageProfileNoContent, error) + DeleteAzureStorageProfile(params *DeleteAzureStorageProfileParams, opts ...ClientOption) (*DeleteAzureStorageProfileNoContent, error) - DeleteStorageProfile(params *DeleteStorageProfileParams) (*DeleteStorageProfileNoContent, error) + DeleteStorageProfile(params *DeleteStorageProfileParams, opts ...ClientOption) (*DeleteStorageProfileNoContent, error) - DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfileParams) (*DeleteVSphereStorageProfileNoContent, error) + DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfileParams, opts ...ClientOption) (*DeleteVSphereStorageProfileNoContent, error) - GetAwsStorageProfile(params *GetAwsStorageProfileParams) (*GetAwsStorageProfileOK, error) + GetAwsStorageProfile(params *GetAwsStorageProfileParams, opts ...ClientOption) (*GetAwsStorageProfileOK, error) - GetAwsStorageProfiles(params *GetAwsStorageProfilesParams) (*GetAwsStorageProfilesOK, error) + GetAwsStorageProfiles(params *GetAwsStorageProfilesParams, opts ...ClientOption) (*GetAwsStorageProfilesOK, error) - GetAzureStorageProfile(params *GetAzureStorageProfileParams) (*GetAzureStorageProfileOK, error) + GetAzureStorageProfile(params *GetAzureStorageProfileParams, opts ...ClientOption) (*GetAzureStorageProfileOK, error) - GetAzureStorageProfiles(params *GetAzureStorageProfilesParams) (*GetAzureStorageProfilesOK, error) + GetAzureStorageProfiles(params *GetAzureStorageProfilesParams, opts ...ClientOption) (*GetAzureStorageProfilesOK, error) - GetStorageProfile(params *GetStorageProfileParams) (*GetStorageProfileOK, error) + GetStorageProfile(params *GetStorageProfileParams, opts ...ClientOption) (*GetStorageProfileOK, error) - GetStorageProfiles(params *GetStorageProfilesParams) (*GetStorageProfilesOK, error) + GetStorageProfiles(params *GetStorageProfilesParams, opts ...ClientOption) (*GetStorageProfilesOK, error) - GetVSphereStorageProfile(params *GetVSphereStorageProfileParams) (*GetVSphereStorageProfileOK, error) + GetVSphereStorageProfile(params *GetVSphereStorageProfileParams, opts ...ClientOption) (*GetVSphereStorageProfileOK, error) - GetVSphereStorageProfiles(params *GetVSphereStorageProfilesParams) (*GetVSphereStorageProfilesOK, error) + GetVSphereStorageProfiles(params *GetVSphereStorageProfilesParams, opts ...ClientOption) (*GetVSphereStorageProfilesOK, error) - ReplaceStorageProfile(params *ReplaceStorageProfileParams) (*ReplaceStorageProfileOK, error) + ReplaceStorageProfile(params *ReplaceStorageProfileParams, opts ...ClientOption) (*ReplaceStorageProfileOK, error) - UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams) (*UpdateAwsStorageProfileOK, error) + UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams, opts ...ClientOption) (*UpdateAwsStorageProfileOK, error) - UpdateAzureStorageProfile(params *UpdateAzureStorageProfileParams) (*UpdateAzureStorageProfileOK, error) + UpdateAzureStorageProfile(params *UpdateAzureStorageProfileParams, opts ...ClientOption) (*UpdateAzureStorageProfileOK, error) - UpdateVSphereStorageProfile(params *UpdateVSphereStorageProfileParams) (*UpdateVSphereStorageProfileOK, error) + UpdateVSphereStorageProfile(params *UpdateVSphereStorageProfileParams, opts ...ClientOption) (*UpdateVSphereStorageProfileOK, error) SetTransport(transport runtime.ClientTransport) } @@ -75,13 +78,12 @@ type ClientService interface { Create AWS storage profile */ -func (a *Client) CreateAwsStorageProfile(params *CreateAwsStorageProfileParams) (*CreateAwsStorageProfileCreated, error) { +func (a *Client) CreateAwsStorageProfile(params *CreateAwsStorageProfileParams, opts ...ClientOption) (*CreateAwsStorageProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAwsStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createAwsStorageProfile", Method: "POST", PathPattern: "/iaas/api/storage-profiles-aws", @@ -92,7 +94,12 @@ func (a *Client) CreateAwsStorageProfile(params *CreateAwsStorageProfileParams) Reader: &CreateAwsStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -111,13 +118,12 @@ func (a *Client) CreateAwsStorageProfile(params *CreateAwsStorageProfileParams) Create Azure storage profile */ -func (a *Client) CreateAzureStorageProfile(params *CreateAzureStorageProfileParams) (*CreateAzureStorageProfileCreated, error) { +func (a *Client) CreateAzureStorageProfile(params *CreateAzureStorageProfileParams, opts ...ClientOption) (*CreateAzureStorageProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAzureStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createAzureStorageProfile", Method: "POST", PathPattern: "/iaas/api/storage-profiles-azure", @@ -128,7 +134,12 @@ func (a *Client) CreateAzureStorageProfile(params *CreateAzureStorageProfilePara Reader: &CreateAzureStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -147,13 +158,12 @@ func (a *Client) CreateAzureStorageProfile(params *CreateAzureStorageProfilePara Create storage profile */ -func (a *Client) CreateStorageProfile(params *CreateStorageProfileParams) (*CreateStorageProfileCreated, error) { +func (a *Client) CreateStorageProfile(params *CreateStorageProfileParams, opts ...ClientOption) (*CreateStorageProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createStorageProfile", Method: "POST", PathPattern: "/iaas/api/storage-profiles", @@ -164,7 +174,12 @@ func (a *Client) CreateStorageProfile(params *CreateStorageProfileParams) (*Crea Reader: &CreateStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -183,13 +198,12 @@ func (a *Client) CreateStorageProfile(params *CreateStorageProfileParams) (*Crea Create vSphere storage profile */ -func (a *Client) CreateVSphereStorageProfile(params *CreateVSphereStorageProfileParams) (*CreateVSphereStorageProfileCreated, error) { +func (a *Client) CreateVSphereStorageProfile(params *CreateVSphereStorageProfileParams, opts ...ClientOption) (*CreateVSphereStorageProfileCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateVSphereStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createVSphereStorageProfile", Method: "POST", PathPattern: "/iaas/api/storage-profiles-vsphere", @@ -200,7 +214,12 @@ func (a *Client) CreateVSphereStorageProfile(params *CreateVSphereStorageProfile Reader: &CreateVSphereStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -219,13 +238,12 @@ func (a *Client) CreateVSphereStorageProfile(params *CreateVSphereStorageProfile Delete AWS storage profile with a given id */ -func (a *Client) DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams) (*DeleteAwsStorageProfileNoContent, error) { +func (a *Client) DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams, opts ...ClientOption) (*DeleteAwsStorageProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAwsStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAwsStorageProfile", Method: "DELETE", PathPattern: "/iaas/api/storage-profiles-aws/{id}", @@ -236,7 +254,12 @@ func (a *Client) DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams) Reader: &DeleteAwsStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -255,13 +278,12 @@ func (a *Client) DeleteAwsStorageProfile(params *DeleteAwsStorageProfileParams) Delete Azure storage profile with a given id */ -func (a *Client) DeleteAzureStorageProfile(params *DeleteAzureStorageProfileParams) (*DeleteAzureStorageProfileNoContent, error) { +func (a *Client) DeleteAzureStorageProfile(params *DeleteAzureStorageProfileParams, opts ...ClientOption) (*DeleteAzureStorageProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAzureStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAzureStorageProfile", Method: "DELETE", PathPattern: "/iaas/api/storage-profiles-azure/{id}", @@ -272,7 +294,12 @@ func (a *Client) DeleteAzureStorageProfile(params *DeleteAzureStorageProfilePara Reader: &DeleteAzureStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -291,13 +318,12 @@ func (a *Client) DeleteAzureStorageProfile(params *DeleteAzureStorageProfilePara Delete storage profile with a given id */ -func (a *Client) DeleteStorageProfile(params *DeleteStorageProfileParams) (*DeleteStorageProfileNoContent, error) { +func (a *Client) DeleteStorageProfile(params *DeleteStorageProfileParams, opts ...ClientOption) (*DeleteStorageProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteStorageProfile", Method: "DELETE", PathPattern: "/iaas/api/storage-profiles/{id}", @@ -308,7 +334,12 @@ func (a *Client) DeleteStorageProfile(params *DeleteStorageProfileParams) (*Dele Reader: &DeleteStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -327,13 +358,12 @@ func (a *Client) DeleteStorageProfile(params *DeleteStorageProfileParams) (*Dele Delete vSphere storage profile with a given id */ -func (a *Client) DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfileParams) (*DeleteVSphereStorageProfileNoContent, error) { +func (a *Client) DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfileParams, opts ...ClientOption) (*DeleteVSphereStorageProfileNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteVSphereStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteVSphereStorageProfile", Method: "DELETE", PathPattern: "/iaas/api/storage-profiles-vsphere/{id}", @@ -344,7 +374,12 @@ func (a *Client) DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfile Reader: &DeleteVSphereStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -363,13 +398,12 @@ func (a *Client) DeleteVSphereStorageProfile(params *DeleteVSphereStorageProfile Get AWS storage profile with a given id */ -func (a *Client) GetAwsStorageProfile(params *GetAwsStorageProfileParams) (*GetAwsStorageProfileOK, error) { +func (a *Client) GetAwsStorageProfile(params *GetAwsStorageProfileParams, opts ...ClientOption) (*GetAwsStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAwsStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAwsStorageProfile", Method: "GET", PathPattern: "/iaas/api/storage-profiles-aws/{id}", @@ -380,7 +414,12 @@ func (a *Client) GetAwsStorageProfile(params *GetAwsStorageProfileParams) (*GetA Reader: &GetAwsStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -399,13 +438,12 @@ func (a *Client) GetAwsStorageProfile(params *GetAwsStorageProfileParams) (*GetA Get all AWS storage profiles */ -func (a *Client) GetAwsStorageProfiles(params *GetAwsStorageProfilesParams) (*GetAwsStorageProfilesOK, error) { +func (a *Client) GetAwsStorageProfiles(params *GetAwsStorageProfilesParams, opts ...ClientOption) (*GetAwsStorageProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAwsStorageProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAwsStorageProfiles", Method: "GET", PathPattern: "/iaas/api/storage-profiles-aws", @@ -416,7 +454,12 @@ func (a *Client) GetAwsStorageProfiles(params *GetAwsStorageProfilesParams) (*Ge Reader: &GetAwsStorageProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -435,13 +478,12 @@ func (a *Client) GetAwsStorageProfiles(params *GetAwsStorageProfilesParams) (*Ge Get Azure storage profile with a given id */ -func (a *Client) GetAzureStorageProfile(params *GetAzureStorageProfileParams) (*GetAzureStorageProfileOK, error) { +func (a *Client) GetAzureStorageProfile(params *GetAzureStorageProfileParams, opts ...ClientOption) (*GetAzureStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAzureStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAzureStorageProfile", Method: "GET", PathPattern: "/iaas/api/storage-profiles-azure/{id}", @@ -452,7 +494,12 @@ func (a *Client) GetAzureStorageProfile(params *GetAzureStorageProfileParams) (* Reader: &GetAzureStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -471,13 +518,12 @@ func (a *Client) GetAzureStorageProfile(params *GetAzureStorageProfileParams) (* Get all Azure storage profiles */ -func (a *Client) GetAzureStorageProfiles(params *GetAzureStorageProfilesParams) (*GetAzureStorageProfilesOK, error) { +func (a *Client) GetAzureStorageProfiles(params *GetAzureStorageProfilesParams, opts ...ClientOption) (*GetAzureStorageProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAzureStorageProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAzureStorageProfiles", Method: "GET", PathPattern: "/iaas/api/storage-profiles-azure", @@ -488,7 +534,12 @@ func (a *Client) GetAzureStorageProfiles(params *GetAzureStorageProfilesParams) Reader: &GetAzureStorageProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -507,13 +558,12 @@ func (a *Client) GetAzureStorageProfiles(params *GetAzureStorageProfilesParams) Get storage profile with a given id */ -func (a *Client) GetStorageProfile(params *GetStorageProfileParams) (*GetStorageProfileOK, error) { +func (a *Client) GetStorageProfile(params *GetStorageProfileParams, opts ...ClientOption) (*GetStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getStorageProfile", Method: "GET", PathPattern: "/iaas/api/storage-profiles/{id}", @@ -524,7 +574,12 @@ func (a *Client) GetStorageProfile(params *GetStorageProfileParams) (*GetStorage Reader: &GetStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -543,13 +598,12 @@ func (a *Client) GetStorageProfile(params *GetStorageProfileParams) (*GetStorage Get all storage profiles */ -func (a *Client) GetStorageProfiles(params *GetStorageProfilesParams) (*GetStorageProfilesOK, error) { +func (a *Client) GetStorageProfiles(params *GetStorageProfilesParams, opts ...ClientOption) (*GetStorageProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetStorageProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getStorageProfiles", Method: "GET", PathPattern: "/iaas/api/storage-profiles", @@ -560,7 +614,12 @@ func (a *Client) GetStorageProfiles(params *GetStorageProfilesParams) (*GetStora Reader: &GetStorageProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -579,13 +638,12 @@ func (a *Client) GetStorageProfiles(params *GetStorageProfilesParams) (*GetStora Get vSphere storage profile with a given id */ -func (a *Client) GetVSphereStorageProfile(params *GetVSphereStorageProfileParams) (*GetVSphereStorageProfileOK, error) { +func (a *Client) GetVSphereStorageProfile(params *GetVSphereStorageProfileParams, opts ...ClientOption) (*GetVSphereStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVSphereStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVSphereStorageProfile", Method: "GET", PathPattern: "/iaas/api/storage-profiles-vsphere/{id}", @@ -596,7 +654,12 @@ func (a *Client) GetVSphereStorageProfile(params *GetVSphereStorageProfileParams Reader: &GetVSphereStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -615,13 +678,12 @@ func (a *Client) GetVSphereStorageProfile(params *GetVSphereStorageProfileParams Get all vSphere storage profiles */ -func (a *Client) GetVSphereStorageProfiles(params *GetVSphereStorageProfilesParams) (*GetVSphereStorageProfilesOK, error) { +func (a *Client) GetVSphereStorageProfiles(params *GetVSphereStorageProfilesParams, opts ...ClientOption) (*GetVSphereStorageProfilesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVSphereStorageProfilesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVSphereStorageProfiles", Method: "GET", PathPattern: "/iaas/api/storage-profiles-vsphere", @@ -632,7 +694,12 @@ func (a *Client) GetVSphereStorageProfiles(params *GetVSphereStorageProfilesPara Reader: &GetVSphereStorageProfilesReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -651,13 +718,12 @@ func (a *Client) GetVSphereStorageProfiles(params *GetVSphereStorageProfilesPara Replace storage profile with a given id */ -func (a *Client) ReplaceStorageProfile(params *ReplaceStorageProfileParams) (*ReplaceStorageProfileOK, error) { +func (a *Client) ReplaceStorageProfile(params *ReplaceStorageProfileParams, opts ...ClientOption) (*ReplaceStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewReplaceStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "replaceStorageProfile", Method: "PUT", PathPattern: "/iaas/api/storage-profiles/{id}", @@ -668,7 +734,12 @@ func (a *Client) ReplaceStorageProfile(params *ReplaceStorageProfileParams) (*Re Reader: &ReplaceStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -687,13 +758,12 @@ func (a *Client) ReplaceStorageProfile(params *ReplaceStorageProfileParams) (*Re Update AWS storage profile */ -func (a *Client) UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams) (*UpdateAwsStorageProfileOK, error) { +func (a *Client) UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams, opts ...ClientOption) (*UpdateAwsStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAwsStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateAwsStorageProfile", Method: "PATCH", PathPattern: "/iaas/api/storage-profiles-aws/{id}", @@ -704,7 +774,12 @@ func (a *Client) UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams) Reader: &UpdateAwsStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -723,13 +798,12 @@ func (a *Client) UpdateAwsStorageProfile(params *UpdateAwsStorageProfileParams) Update Azure storage profile */ -func (a *Client) UpdateAzureStorageProfile(params *UpdateAzureStorageProfileParams) (*UpdateAzureStorageProfileOK, error) { +func (a *Client) UpdateAzureStorageProfile(params *UpdateAzureStorageProfileParams, opts ...ClientOption) (*UpdateAzureStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAzureStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateAzureStorageProfile", Method: "PATCH", PathPattern: "/iaas/api/storage-profiles-azure/{id}", @@ -740,7 +814,12 @@ func (a *Client) UpdateAzureStorageProfile(params *UpdateAzureStorageProfilePara Reader: &UpdateAzureStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -759,13 +838,12 @@ func (a *Client) UpdateAzureStorageProfile(params *UpdateAzureStorageProfilePara Update vSphere storage profile */ -func (a *Client) UpdateVSphereStorageProfile(params *UpdateVSphereStorageProfileParams) (*UpdateVSphereStorageProfileOK, error) { +func (a *Client) UpdateVSphereStorageProfile(params *UpdateVSphereStorageProfileParams, opts ...ClientOption) (*UpdateVSphereStorageProfileOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateVSphereStorageProfileParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateVSphereStorageProfile", Method: "PATCH", PathPattern: "/iaas/api/storage-profiles-vsphere/{id}", @@ -776,7 +854,12 @@ func (a *Client) UpdateVSphereStorageProfile(params *UpdateVSphereStorageProfile Reader: &UpdateVSphereStorageProfileReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/storage_profile/update_aws_storage_profile_parameters.go b/pkg/client/storage_profile/update_aws_storage_profile_parameters.go index 2bbe604e..212652bc 100644 --- a/pkg/client/storage_profile/update_aws_storage_profile_parameters.go +++ b/pkg/client/storage_profile/update_aws_storage_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateAwsStorageProfileParams creates a new UpdateAwsStorageProfileParams object -// with the default values initialized. +// NewUpdateAwsStorageProfileParams creates a new UpdateAwsStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateAwsStorageProfileParams() *UpdateAwsStorageProfileParams { - var () return &UpdateAwsStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAwsStorageProfileParamsWithTimeout creates a new UpdateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAwsStorageProfileParamsWithTimeout(timeout time.Duration) *UpdateAwsStorageProfileParams { - var () return &UpdateAwsStorageProfileParams{ - timeout: timeout, } } // NewUpdateAwsStorageProfileParamsWithContext creates a new UpdateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAwsStorageProfileParamsWithContext(ctx context.Context) *UpdateAwsStorageProfileParams { - var () return &UpdateAwsStorageProfileParams{ - Context: ctx, } } // NewUpdateAwsStorageProfileParamsWithHTTPClient creates a new UpdateAwsStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAwsStorageProfileParamsWithHTTPClient(client *http.Client) *UpdateAwsStorageProfileParams { - var () return &UpdateAwsStorageProfileParams{ HTTPClient: client, } } -/*UpdateAwsStorageProfileParams contains all the parameters to send to the API endpoint -for the update aws storage profile operation typically these are written to a http.Request +/* UpdateAwsStorageProfileParams contains all the parameters to send to the API endpoint + for the update aws storage profile operation. + + Typically these are written to a http.Request. */ type UpdateAwsStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileAwsSpecification + /* Body. + + StorageProfileAwsSpecification */ Body *models.StorageProfileAwsSpecification - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -83,6 +84,21 @@ type UpdateAwsStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsStorageProfileParams) WithDefaults() *UpdateAwsStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update aws storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update aws storage profile params func (o *UpdateAwsStorageProfileParams) WithTimeout(timeout time.Duration) *UpdateAwsStorageProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateAwsStorageProfileParams) WriteToRequest(r runtime.ClientRequest, // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/update_aws_storage_profile_responses.go b/pkg/client/storage_profile/update_aws_storage_profile_responses.go index 31ee9011..0561a7af 100644 --- a/pkg/client/storage_profile/update_aws_storage_profile_responses.go +++ b/pkg/client/storage_profile/update_aws_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateAwsStorageProfileReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateAwsStorageProfileOK() *UpdateAwsStorageProfileOK { return &UpdateAwsStorageProfileOK{} } -/*UpdateAwsStorageProfileOK handles this case with default header values. +/* UpdateAwsStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateAwsStorageProfileOK struct { func (o *UpdateAwsStorageProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-aws/{id}][%d] updateAwsStorageProfileOK %+v", 200, o.Payload) } - func (o *UpdateAwsStorageProfileOK) GetPayload() *models.AwsStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateAwsStorageProfileBadRequest() *UpdateAwsStorageProfileBadRequest { return &UpdateAwsStorageProfileBadRequest{} } -/*UpdateAwsStorageProfileBadRequest handles this case with default header values. +/* UpdateAwsStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateAwsStorageProfileBadRequest struct { func (o *UpdateAwsStorageProfileBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-aws/{id}][%d] updateAwsStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *UpdateAwsStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateAwsStorageProfileForbidden() *UpdateAwsStorageProfileForbidden { return &UpdateAwsStorageProfileForbidden{} } -/*UpdateAwsStorageProfileForbidden handles this case with default header values. +/* UpdateAwsStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateAwsStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateAwsStorageProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-aws/{id}][%d] updateAwsStorageProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-aws/{id}][%d] updateAwsStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateAwsStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateAwsStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/update_azure_storage_profile_parameters.go b/pkg/client/storage_profile/update_azure_storage_profile_parameters.go index c5149df5..ceab8bcd 100644 --- a/pkg/client/storage_profile/update_azure_storage_profile_parameters.go +++ b/pkg/client/storage_profile/update_azure_storage_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateAzureStorageProfileParams creates a new UpdateAzureStorageProfileParams object -// with the default values initialized. +// NewUpdateAzureStorageProfileParams creates a new UpdateAzureStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateAzureStorageProfileParams() *UpdateAzureStorageProfileParams { - var () return &UpdateAzureStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAzureStorageProfileParamsWithTimeout creates a new UpdateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAzureStorageProfileParamsWithTimeout(timeout time.Duration) *UpdateAzureStorageProfileParams { - var () return &UpdateAzureStorageProfileParams{ - timeout: timeout, } } // NewUpdateAzureStorageProfileParamsWithContext creates a new UpdateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAzureStorageProfileParamsWithContext(ctx context.Context) *UpdateAzureStorageProfileParams { - var () return &UpdateAzureStorageProfileParams{ - Context: ctx, } } // NewUpdateAzureStorageProfileParamsWithHTTPClient creates a new UpdateAzureStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAzureStorageProfileParamsWithHTTPClient(client *http.Client) *UpdateAzureStorageProfileParams { - var () return &UpdateAzureStorageProfileParams{ HTTPClient: client, } } -/*UpdateAzureStorageProfileParams contains all the parameters to send to the API endpoint -for the update azure storage profile operation typically these are written to a http.Request +/* UpdateAzureStorageProfileParams contains all the parameters to send to the API endpoint + for the update azure storage profile operation. + + Typically these are written to a http.Request. */ type UpdateAzureStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileAzureSpecification instance + /* Body. + + StorageProfileAzureSpecification instance */ Body *models.StorageProfileAzureSpecification - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -83,6 +84,21 @@ type UpdateAzureStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureStorageProfileParams) WithDefaults() *UpdateAzureStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update azure storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update azure storage profile params func (o *UpdateAzureStorageProfileParams) WithTimeout(timeout time.Duration) *UpdateAzureStorageProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateAzureStorageProfileParams) WriteToRequest(r runtime.ClientRequest // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/update_azure_storage_profile_responses.go b/pkg/client/storage_profile/update_azure_storage_profile_responses.go index daa0d7e9..20a736d4 100644 --- a/pkg/client/storage_profile/update_azure_storage_profile_responses.go +++ b/pkg/client/storage_profile/update_azure_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateAzureStorageProfileReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateAzureStorageProfileOK() *UpdateAzureStorageProfileOK { return &UpdateAzureStorageProfileOK{} } -/*UpdateAzureStorageProfileOK handles this case with default header values. +/* UpdateAzureStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateAzureStorageProfileOK struct { func (o *UpdateAzureStorageProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-azure/{id}][%d] updateAzureStorageProfileOK %+v", 200, o.Payload) } - func (o *UpdateAzureStorageProfileOK) GetPayload() *models.AzureStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateAzureStorageProfileBadRequest() *UpdateAzureStorageProfileBadReque return &UpdateAzureStorageProfileBadRequest{} } -/*UpdateAzureStorageProfileBadRequest handles this case with default header values. +/* UpdateAzureStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateAzureStorageProfileBadRequest struct { func (o *UpdateAzureStorageProfileBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-azure/{id}][%d] updateAzureStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *UpdateAzureStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateAzureStorageProfileForbidden() *UpdateAzureStorageProfileForbidden return &UpdateAzureStorageProfileForbidden{} } -/*UpdateAzureStorageProfileForbidden handles this case with default header values. +/* UpdateAzureStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateAzureStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateAzureStorageProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-azure/{id}][%d] updateAzureStorageProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-azure/{id}][%d] updateAzureStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateAzureStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateAzureStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/storage_profile/update_vsphere_storage_profile_parameters.go b/pkg/client/storage_profile/update_vsphere_storage_profile_parameters.go index 40e52dbb..b2990f9a 100644 --- a/pkg/client/storage_profile/update_vsphere_storage_profile_parameters.go +++ b/pkg/client/storage_profile/update_vsphere_storage_profile_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewUpdateVSphereStorageProfileParams creates a new UpdateVSphereStorageProfileParams object -// with the default values initialized. +// NewUpdateVSphereStorageProfileParams creates a new UpdateVSphereStorageProfileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateVSphereStorageProfileParams() *UpdateVSphereStorageProfileParams { - var () return &UpdateVSphereStorageProfileParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateVSphereStorageProfileParamsWithTimeout creates a new UpdateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateVSphereStorageProfileParamsWithTimeout(timeout time.Duration) *UpdateVSphereStorageProfileParams { - var () return &UpdateVSphereStorageProfileParams{ - timeout: timeout, } } // NewUpdateVSphereStorageProfileParamsWithContext creates a new UpdateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateVSphereStorageProfileParamsWithContext(ctx context.Context) *UpdateVSphereStorageProfileParams { - var () return &UpdateVSphereStorageProfileParams{ - Context: ctx, } } // NewUpdateVSphereStorageProfileParamsWithHTTPClient creates a new UpdateVSphereStorageProfileParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateVSphereStorageProfileParamsWithHTTPClient(client *http.Client) *UpdateVSphereStorageProfileParams { - var () return &UpdateVSphereStorageProfileParams{ HTTPClient: client, } } -/*UpdateVSphereStorageProfileParams contains all the parameters to send to the API endpoint -for the update v sphere storage profile operation typically these are written to a http.Request +/* UpdateVSphereStorageProfileParams contains all the parameters to send to the API endpoint + for the update v sphere storage profile operation. + + Typically these are written to a http.Request. */ type UpdateVSphereStorageProfileParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion *string - /*Body - StorageProfileVsphereSpecification instance + /* Body. + + StorageProfileVsphereSpecification instance */ Body *models.StorageProfileVsphereSpecification - /*ID - The ID of the storage profile. + /* ID. + + The ID of the storage profile. */ ID string @@ -83,6 +84,21 @@ type UpdateVSphereStorageProfileParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVSphereStorageProfileParams) WithDefaults() *UpdateVSphereStorageProfileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update v sphere storage profile params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVSphereStorageProfileParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update v sphere storage profile params func (o *UpdateVSphereStorageProfileParams) WithTimeout(timeout time.Duration) *UpdateVSphereStorageProfileParams { o.SetTimeout(timeout) @@ -161,18 +177,18 @@ func (o *UpdateVSphereStorageProfileParams) WriteToRequest(r runtime.ClientReque // query param apiVersion var qrAPIVersion string + if o.APIVersion != nil { qrAPIVersion = *o.APIVersion } qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/pkg/client/storage_profile/update_vsphere_storage_profile_responses.go b/pkg/client/storage_profile/update_vsphere_storage_profile_responses.go index 0609d943..13426597 100644 --- a/pkg/client/storage_profile/update_vsphere_storage_profile_responses.go +++ b/pkg/client/storage_profile/update_vsphere_storage_profile_responses.go @@ -41,7 +41,6 @@ func (o *UpdateVSphereStorageProfileReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -52,7 +51,7 @@ func NewUpdateVSphereStorageProfileOK() *UpdateVSphereStorageProfileOK { return &UpdateVSphereStorageProfileOK{} } -/*UpdateVSphereStorageProfileOK handles this case with default header values. +/* UpdateVSphereStorageProfileOK describes a response with status code 200, with default header values. successful operation */ @@ -63,7 +62,6 @@ type UpdateVSphereStorageProfileOK struct { func (o *UpdateVSphereStorageProfileOK) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-vsphere/{id}][%d] updateVSphereStorageProfileOK %+v", 200, o.Payload) } - func (o *UpdateVSphereStorageProfileOK) GetPayload() *models.VsphereStorageProfile { return o.Payload } @@ -85,7 +83,7 @@ func NewUpdateVSphereStorageProfileBadRequest() *UpdateVSphereStorageProfileBadR return &UpdateVSphereStorageProfileBadRequest{} } -/*UpdateVSphereStorageProfileBadRequest handles this case with default header values. +/* UpdateVSphereStorageProfileBadRequest describes a response with status code 400, with default header values. Invalid Request - bad data */ @@ -96,7 +94,6 @@ type UpdateVSphereStorageProfileBadRequest struct { func (o *UpdateVSphereStorageProfileBadRequest) Error() string { return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-vsphere/{id}][%d] updateVSphereStorageProfileBadRequest %+v", 400, o.Payload) } - func (o *UpdateVSphereStorageProfileBadRequest) GetPayload() *models.Error { return o.Payload } @@ -118,18 +115,29 @@ func NewUpdateVSphereStorageProfileForbidden() *UpdateVSphereStorageProfileForbi return &UpdateVSphereStorageProfileForbidden{} } -/*UpdateVSphereStorageProfileForbidden handles this case with default header values. +/* UpdateVSphereStorageProfileForbidden describes a response with status code 403, with default header values. Forbidden */ type UpdateVSphereStorageProfileForbidden struct { + Payload *models.ServiceErrorResponse } func (o *UpdateVSphereStorageProfileForbidden) Error() string { - return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-vsphere/{id}][%d] updateVSphereStorageProfileForbidden ", 403) + return fmt.Sprintf("[PATCH /iaas/api/storage-profiles-vsphere/{id}][%d] updateVSphereStorageProfileForbidden %+v", 403, o.Payload) +} +func (o *UpdateVSphereStorageProfileForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *UpdateVSphereStorageProfileForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/tags/get_tags_parameters.go b/pkg/client/tags/get_tags_parameters.go index 7984f19d..52fe71b7 100644 --- a/pkg/client/tags/get_tags_parameters.go +++ b/pkg/client/tags/get_tags_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetTagsParams creates a new GetTagsParams object -// with the default values initialized. +// NewGetTagsParams creates a new GetTagsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetTagsParams() *GetTagsParams { - var () return &GetTagsParams{ - timeout: cr.DefaultTimeout, } } // NewGetTagsParamsWithTimeout creates a new GetTagsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetTagsParamsWithTimeout(timeout time.Duration) *GetTagsParams { - var () return &GetTagsParams{ - timeout: timeout, } } // NewGetTagsParamsWithContext creates a new GetTagsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetTagsParamsWithContext(ctx context.Context) *GetTagsParams { - var () return &GetTagsParams{ - Context: ctx, } } // NewGetTagsParamsWithHTTPClient creates a new GetTagsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetTagsParamsWithHTTPClient(client *http.Client) *GetTagsParams { - var () return &GetTagsParams{ HTTPClient: client, } } -/*GetTagsParams contains all the parameters to send to the API endpoint -for the get tags operation typically these are written to a http.Request +/* GetTagsParams contains all the parameters to send to the API endpoint + for the get tags operation. + + Typically these are written to a http.Request. */ type GetTagsParams struct { - /*APIVersion - The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about + /* APIVersion. + The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about */ APIVersion string @@ -71,6 +70,21 @@ type GetTagsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTagsParams) WithDefaults() *GetTagsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTagsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get tags params func (o *GetTagsParams) WithTimeout(timeout time.Duration) *GetTagsParams { o.SetTimeout(timeout) @@ -127,6 +141,7 @@ func (o *GetTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis qrAPIVersion := o.APIVersion qAPIVersion := qrAPIVersion if qAPIVersion != "" { + if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil { return err } diff --git a/pkg/client/tags/get_tags_responses.go b/pkg/client/tags/get_tags_responses.go index bd38a954..82e324c1 100644 --- a/pkg/client/tags/get_tags_responses.go +++ b/pkg/client/tags/get_tags_responses.go @@ -35,7 +35,6 @@ func (o *GetTagsReader) ReadResponse(response runtime.ClientResponse, consumer r return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -46,7 +45,7 @@ func NewGetTagsOK() *GetTagsOK { return &GetTagsOK{} } -/*GetTagsOK handles this case with default header values. +/* GetTagsOK describes a response with status code 200, with default header values. successful operation */ @@ -57,7 +56,6 @@ type GetTagsOK struct { func (o *GetTagsOK) Error() string { return fmt.Sprintf("[GET /iaas/api/tags][%d] getTagsOK %+v", 200, o.Payload) } - func (o *GetTagsOK) GetPayload() *models.TagResult { return o.Payload } @@ -79,18 +77,29 @@ func NewGetTagsForbidden() *GetTagsForbidden { return &GetTagsForbidden{} } -/*GetTagsForbidden handles this case with default header values. +/* GetTagsForbidden describes a response with status code 403, with default header values. Forbidden */ type GetTagsForbidden struct { + Payload *models.ServiceErrorResponse } func (o *GetTagsForbidden) Error() string { - return fmt.Sprintf("[GET /iaas/api/tags][%d] getTagsForbidden ", 403) + return fmt.Sprintf("[GET /iaas/api/tags][%d] getTagsForbidden %+v", 403, o.Payload) +} +func (o *GetTagsForbidden) GetPayload() *models.ServiceErrorResponse { + return o.Payload } func (o *GetTagsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.ServiceErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + return nil } diff --git a/pkg/client/tags/tags_client.go b/pkg/client/tags/tags_client.go index 1457a5bc..b829bdfa 100644 --- a/pkg/client/tags/tags_client.go +++ b/pkg/client/tags/tags_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetTags(params *GetTagsParams) (*GetTagsOK, error) + GetTags(params *GetTagsParams, opts ...ClientOption) (*GetTagsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Get all tags */ -func (a *Client) GetTags(params *GetTagsParams) (*GetTagsOK, error) { +func (a *Client) GetTags(params *GetTagsParams, opts ...ClientOption) (*GetTagsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetTagsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getTags", Method: "GET", PathPattern: "/iaas/api/tags", @@ -54,7 +56,12 @@ func (a *Client) GetTags(params *GetTagsParams) (*GetTagsOK, error) { Reader: &GetTagsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/vcf/create_service_credentials_using_post_parameters.go b/pkg/client/vcf/create_service_credentials_using_post_parameters.go index fe964120..cf321216 100644 --- a/pkg/client/vcf/create_service_credentials_using_post_parameters.go +++ b/pkg/client/vcf/create_service_credentials_using_post_parameters.go @@ -18,63 +18,64 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewCreateServiceCredentialsUsingPOSTParams creates a new CreateServiceCredentialsUsingPOSTParams object -// with the default values initialized. +// NewCreateServiceCredentialsUsingPOSTParams creates a new CreateServiceCredentialsUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateServiceCredentialsUsingPOSTParams() *CreateServiceCredentialsUsingPOSTParams { - var () return &CreateServiceCredentialsUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewCreateServiceCredentialsUsingPOSTParamsWithTimeout creates a new CreateServiceCredentialsUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateServiceCredentialsUsingPOSTParamsWithTimeout(timeout time.Duration) *CreateServiceCredentialsUsingPOSTParams { - var () return &CreateServiceCredentialsUsingPOSTParams{ - timeout: timeout, } } // NewCreateServiceCredentialsUsingPOSTParamsWithContext creates a new CreateServiceCredentialsUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateServiceCredentialsUsingPOSTParamsWithContext(ctx context.Context) *CreateServiceCredentialsUsingPOSTParams { - var () return &CreateServiceCredentialsUsingPOSTParams{ - Context: ctx, } } // NewCreateServiceCredentialsUsingPOSTParamsWithHTTPClient creates a new CreateServiceCredentialsUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateServiceCredentialsUsingPOSTParamsWithHTTPClient(client *http.Client) *CreateServiceCredentialsUsingPOSTParams { - var () return &CreateServiceCredentialsUsingPOSTParams{ HTTPClient: client, } } -/*CreateServiceCredentialsUsingPOSTParams contains all the parameters to send to the API endpoint -for the create service credentials using p o s t operation typically these are written to a http.Request +/* CreateServiceCredentialsUsingPOSTParams contains all the parameters to send to the API endpoint + for the create service credentials using p o s t operation. + + Typically these are written to a http.Request. */ type CreateServiceCredentialsUsingPOSTParams struct { - /*DomainID - domainId + /* DomainID. + domainId */ DomainID string - /*IntegrationID - integrationId + /* IntegrationID. + + integrationId */ IntegrationID string - /*Request - request + /* Request. + + request */ Request *models.VcfCredentialRequests @@ -83,6 +84,21 @@ type CreateServiceCredentialsUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create service credentials using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceCredentialsUsingPOSTParams) WithDefaults() *CreateServiceCredentialsUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service credentials using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceCredentialsUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create service credentials using p o s t params func (o *CreateServiceCredentialsUsingPOSTParams) WithTimeout(timeout time.Duration) *CreateServiceCredentialsUsingPOSTParams { o.SetTimeout(timeout) @@ -166,7 +182,6 @@ func (o *CreateServiceCredentialsUsingPOSTParams) WriteToRequest(r runtime.Clien if err := r.SetPathParam("integrationId", o.IntegrationID); err != nil { return err } - if o.Request != nil { if err := r.SetBodyParam(o.Request); err != nil { return err diff --git a/pkg/client/vcf/create_service_credentials_using_post_responses.go b/pkg/client/vcf/create_service_credentials_using_post_responses.go index dba043a9..044f293b 100644 --- a/pkg/client/vcf/create_service_credentials_using_post_responses.go +++ b/pkg/client/vcf/create_service_credentials_using_post_responses.go @@ -47,7 +47,6 @@ func (o *CreateServiceCredentialsUsingPOSTReader) ReadResponse(response runtime. return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewCreateServiceCredentialsUsingPOSTOK() *CreateServiceCredentialsUsingPOST return &CreateServiceCredentialsUsingPOSTOK{} } -/*CreateServiceCredentialsUsingPOSTOK handles this case with default header values. +/* CreateServiceCredentialsUsingPOSTOK describes a response with status code 200, with default header values. Create Service credentials */ @@ -69,7 +68,6 @@ type CreateServiceCredentialsUsingPOSTOK struct { func (o *CreateServiceCredentialsUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /content/api/vcf/{integrationId}/domain/{domainId}/service-accounts][%d] createServiceCredentialsUsingPOSTOK %+v", 200, o.Payload) } - func (o *CreateServiceCredentialsUsingPOSTOK) GetPayload() *models.VcfServiceCredentialCreationResponse { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateServiceCredentialsUsingPOSTBadRequest() *CreateServiceCredentialsU return &CreateServiceCredentialsUsingPOSTBadRequest{} } -/*CreateServiceCredentialsUsingPOSTBadRequest handles this case with default header values. +/* CreateServiceCredentialsUsingPOSTBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type CreateServiceCredentialsUsingPOSTBadRequest struct { func (o *CreateServiceCredentialsUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /content/api/vcf/{integrationId}/domain/{domainId}/service-accounts][%d] createServiceCredentialsUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *CreateServiceCredentialsUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateServiceCredentialsUsingPOSTUnauthorized() *CreateServiceCredential return &CreateServiceCredentialsUsingPOSTUnauthorized{} } -/*CreateServiceCredentialsUsingPOSTUnauthorized handles this case with default header values. +/* CreateServiceCredentialsUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewCreateServiceCredentialsUsingPOSTForbidden() *CreateServiceCredentialsUs return &CreateServiceCredentialsUsingPOSTForbidden{} } -/*CreateServiceCredentialsUsingPOSTForbidden handles this case with default header values. +/* CreateServiceCredentialsUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/vcf/delete_service_account_using_delete_parameters.go b/pkg/client/vcf/delete_service_account_using_delete_parameters.go index d2c037d6..c051f82e 100644 --- a/pkg/client/vcf/delete_service_account_using_delete_parameters.go +++ b/pkg/client/vcf/delete_service_account_using_delete_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteServiceAccountUsingDELETEParams creates a new DeleteServiceAccountUsingDELETEParams object -// with the default values initialized. +// NewDeleteServiceAccountUsingDELETEParams creates a new DeleteServiceAccountUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteServiceAccountUsingDELETEParams() *DeleteServiceAccountUsingDELETEParams { - var () return &DeleteServiceAccountUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteServiceAccountUsingDELETEParamsWithTimeout creates a new DeleteServiceAccountUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteServiceAccountUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteServiceAccountUsingDELETEParams { - var () return &DeleteServiceAccountUsingDELETEParams{ - timeout: timeout, } } // NewDeleteServiceAccountUsingDELETEParamsWithContext creates a new DeleteServiceAccountUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteServiceAccountUsingDELETEParamsWithContext(ctx context.Context) *DeleteServiceAccountUsingDELETEParams { - var () return &DeleteServiceAccountUsingDELETEParams{ - Context: ctx, } } // NewDeleteServiceAccountUsingDELETEParamsWithHTTPClient creates a new DeleteServiceAccountUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteServiceAccountUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteServiceAccountUsingDELETEParams { - var () return &DeleteServiceAccountUsingDELETEParams{ HTTPClient: client, } } -/*DeleteServiceAccountUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete service account using d e l e t e operation typically these are written to a http.Request +/* DeleteServiceAccountUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete service account using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteServiceAccountUsingDELETEParams struct { - /*DomainID - domainId + /* DomainID. + domainId */ DomainID string - /*IntegrationID - integrationId + /* IntegrationID. + + integrationId */ IntegrationID string @@ -76,6 +76,21 @@ type DeleteServiceAccountUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete service account using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceAccountUsingDELETEParams) WithDefaults() *DeleteServiceAccountUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete service account using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceAccountUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete service account using d e l e t e params func (o *DeleteServiceAccountUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteServiceAccountUsingDELETEParams { o.SetTimeout(timeout) diff --git a/pkg/client/vcf/delete_service_account_using_delete_responses.go b/pkg/client/vcf/delete_service_account_using_delete_responses.go index e156dd79..191d2195 100644 --- a/pkg/client/vcf/delete_service_account_using_delete_responses.go +++ b/pkg/client/vcf/delete_service_account_using_delete_responses.go @@ -26,7 +26,6 @@ func (o *DeleteServiceAccountUsingDELETEReader) ReadResponse(response runtime.Cl return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -37,7 +36,7 @@ func NewDeleteServiceAccountUsingDELETENoContent() *DeleteServiceAccountUsingDEL return &DeleteServiceAccountUsingDELETENoContent{} } -/*DeleteServiceAccountUsingDELETENoContent handles this case with default header values. +/* DeleteServiceAccountUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ diff --git a/pkg/client/vcf/delete_service_credential_using_delete_parameters.go b/pkg/client/vcf/delete_service_credential_using_delete_parameters.go index 5abaee34..d8bb8a4b 100644 --- a/pkg/client/vcf/delete_service_credential_using_delete_parameters.go +++ b/pkg/client/vcf/delete_service_credential_using_delete_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteServiceCredentialUsingDELETEParams creates a new DeleteServiceCredentialUsingDELETEParams object -// with the default values initialized. +// NewDeleteServiceCredentialUsingDELETEParams creates a new DeleteServiceCredentialUsingDELETEParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteServiceCredentialUsingDELETEParams() *DeleteServiceCredentialUsingDELETEParams { - var () return &DeleteServiceCredentialUsingDELETEParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteServiceCredentialUsingDELETEParamsWithTimeout creates a new DeleteServiceCredentialUsingDELETEParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteServiceCredentialUsingDELETEParamsWithTimeout(timeout time.Duration) *DeleteServiceCredentialUsingDELETEParams { - var () return &DeleteServiceCredentialUsingDELETEParams{ - timeout: timeout, } } // NewDeleteServiceCredentialUsingDELETEParamsWithContext creates a new DeleteServiceCredentialUsingDELETEParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteServiceCredentialUsingDELETEParamsWithContext(ctx context.Context) *DeleteServiceCredentialUsingDELETEParams { - var () return &DeleteServiceCredentialUsingDELETEParams{ - Context: ctx, } } // NewDeleteServiceCredentialUsingDELETEParamsWithHTTPClient creates a new DeleteServiceCredentialUsingDELETEParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteServiceCredentialUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteServiceCredentialUsingDELETEParams { - var () return &DeleteServiceCredentialUsingDELETEParams{ HTTPClient: client, } } -/*DeleteServiceCredentialUsingDELETEParams contains all the parameters to send to the API endpoint -for the delete service credential using d e l e t e operation typically these are written to a http.Request +/* DeleteServiceCredentialUsingDELETEParams contains all the parameters to send to the API endpoint + for the delete service credential using d e l e t e operation. + + Typically these are written to a http.Request. */ type DeleteServiceCredentialUsingDELETEParams struct { - /*DomainID - domainId + /* DomainID. + domainId */ DomainID string - /*ID - id + /* ID. + + id */ ID string - /*IntegrationID - integrationId + /* IntegrationID. + + integrationId */ IntegrationID string @@ -81,6 +82,21 @@ type DeleteServiceCredentialUsingDELETEParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete service credential using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceCredentialUsingDELETEParams) WithDefaults() *DeleteServiceCredentialUsingDELETEParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete service credential using d e l e t e params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceCredentialUsingDELETEParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete service credential using d e l e t e params func (o *DeleteServiceCredentialUsingDELETEParams) WithTimeout(timeout time.Duration) *DeleteServiceCredentialUsingDELETEParams { o.SetTimeout(timeout) diff --git a/pkg/client/vcf/delete_service_credential_using_delete_responses.go b/pkg/client/vcf/delete_service_credential_using_delete_responses.go index 8b94e5a8..364100c8 100644 --- a/pkg/client/vcf/delete_service_credential_using_delete_responses.go +++ b/pkg/client/vcf/delete_service_credential_using_delete_responses.go @@ -26,7 +26,6 @@ func (o *DeleteServiceCredentialUsingDELETEReader) ReadResponse(response runtime return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -37,7 +36,7 @@ func NewDeleteServiceCredentialUsingDELETENoContent() *DeleteServiceCredentialUs return &DeleteServiceCredentialUsingDELETENoContent{} } -/*DeleteServiceCredentialUsingDELETENoContent handles this case with default header values. +/* DeleteServiceCredentialUsingDELETENoContent describes a response with status code 204, with default header values. No Content */ diff --git a/pkg/client/vcf/enumerate_domains_using_post_parameters.go b/pkg/client/vcf/enumerate_domains_using_post_parameters.go index 6d9f727e..090329d3 100644 --- a/pkg/client/vcf/enumerate_domains_using_post_parameters.go +++ b/pkg/client/vcf/enumerate_domains_using_post_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/vmware/vra-sdk-go/pkg/models" ) -// NewEnumerateDomainsUsingPOSTParams creates a new EnumerateDomainsUsingPOSTParams object -// with the default values initialized. +// NewEnumerateDomainsUsingPOSTParams creates a new EnumerateDomainsUsingPOSTParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewEnumerateDomainsUsingPOSTParams() *EnumerateDomainsUsingPOSTParams { - var () return &EnumerateDomainsUsingPOSTParams{ - timeout: cr.DefaultTimeout, } } // NewEnumerateDomainsUsingPOSTParamsWithTimeout creates a new EnumerateDomainsUsingPOSTParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnumerateDomainsUsingPOSTParamsWithTimeout(timeout time.Duration) *EnumerateDomainsUsingPOSTParams { - var () return &EnumerateDomainsUsingPOSTParams{ - timeout: timeout, } } // NewEnumerateDomainsUsingPOSTParamsWithContext creates a new EnumerateDomainsUsingPOSTParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnumerateDomainsUsingPOSTParamsWithContext(ctx context.Context) *EnumerateDomainsUsingPOSTParams { - var () return &EnumerateDomainsUsingPOSTParams{ - Context: ctx, } } // NewEnumerateDomainsUsingPOSTParamsWithHTTPClient creates a new EnumerateDomainsUsingPOSTParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnumerateDomainsUsingPOSTParamsWithHTTPClient(client *http.Client) *EnumerateDomainsUsingPOSTParams { - var () return &EnumerateDomainsUsingPOSTParams{ HTTPClient: client, } } -/*EnumerateDomainsUsingPOSTParams contains all the parameters to send to the API endpoint -for the enumerate domains using p o s t operation typically these are written to a http.Request +/* EnumerateDomainsUsingPOSTParams contains all the parameters to send to the API endpoint + for the enumerate domains using p o s t operation. + + Typically these are written to a http.Request. */ type EnumerateDomainsUsingPOSTParams struct { - /*Input - input + /* Input. + input */ Input *models.PhotonModelEndpointConfigRequest @@ -73,6 +72,21 @@ type EnumerateDomainsUsingPOSTParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the enumerate domains using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateDomainsUsingPOSTParams) WithDefaults() *EnumerateDomainsUsingPOSTParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enumerate domains using p o s t params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnumerateDomainsUsingPOSTParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the enumerate domains using p o s t params func (o *EnumerateDomainsUsingPOSTParams) WithTimeout(timeout time.Duration) *EnumerateDomainsUsingPOSTParams { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *EnumerateDomainsUsingPOSTParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.Input != nil { if err := r.SetBodyParam(o.Input); err != nil { return err diff --git a/pkg/client/vcf/enumerate_domains_using_post_responses.go b/pkg/client/vcf/enumerate_domains_using_post_responses.go index 1cfcb43f..98fe1982 100644 --- a/pkg/client/vcf/enumerate_domains_using_post_responses.go +++ b/pkg/client/vcf/enumerate_domains_using_post_responses.go @@ -47,7 +47,6 @@ func (o *EnumerateDomainsUsingPOSTReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewEnumerateDomainsUsingPOSTOK() *EnumerateDomainsUsingPOSTOK { return &EnumerateDomainsUsingPOSTOK{} } -/*EnumerateDomainsUsingPOSTOK handles this case with default header values. +/* EnumerateDomainsUsingPOSTOK describes a response with status code 200, with default header values. Get domains of the vCF endpoint */ @@ -69,7 +68,6 @@ type EnumerateDomainsUsingPOSTOK struct { func (o *EnumerateDomainsUsingPOSTOK) Error() string { return fmt.Sprintf("[POST /content/api/vcf/domains-enumeration][%d] enumerateDomainsUsingPOSTOK %+v", 200, o.Payload) } - func (o *EnumerateDomainsUsingPOSTOK) GetPayload() *models.VcfDomains { return o.Payload } @@ -91,7 +89,7 @@ func NewEnumerateDomainsUsingPOSTBadRequest() *EnumerateDomainsUsingPOSTBadReque return &EnumerateDomainsUsingPOSTBadRequest{} } -/*EnumerateDomainsUsingPOSTBadRequest handles this case with default header values. +/* EnumerateDomainsUsingPOSTBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type EnumerateDomainsUsingPOSTBadRequest struct { func (o *EnumerateDomainsUsingPOSTBadRequest) Error() string { return fmt.Sprintf("[POST /content/api/vcf/domains-enumeration][%d] enumerateDomainsUsingPOSTBadRequest %+v", 400, o.Payload) } - func (o *EnumerateDomainsUsingPOSTBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewEnumerateDomainsUsingPOSTUnauthorized() *EnumerateDomainsUsingPOSTUnauth return &EnumerateDomainsUsingPOSTUnauthorized{} } -/*EnumerateDomainsUsingPOSTUnauthorized handles this case with default header values. +/* EnumerateDomainsUsingPOSTUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewEnumerateDomainsUsingPOSTForbidden() *EnumerateDomainsUsingPOSTForbidden return &EnumerateDomainsUsingPOSTForbidden{} } -/*EnumerateDomainsUsingPOSTForbidden handles this case with default header values. +/* EnumerateDomainsUsingPOSTForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/vcf/get_domain_using_get_parameters.go b/pkg/client/vcf/get_domain_using_get_parameters.go index 3760e51f..3df8191b 100644 --- a/pkg/client/vcf/get_domain_using_get_parameters.go +++ b/pkg/client/vcf/get_domain_using_get_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDomainUsingGETParams creates a new GetDomainUsingGETParams object -// with the default values initialized. +// NewGetDomainUsingGETParams creates a new GetDomainUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDomainUsingGETParams() *GetDomainUsingGETParams { - var () return &GetDomainUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDomainUsingGETParamsWithTimeout creates a new GetDomainUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDomainUsingGETParamsWithTimeout(timeout time.Duration) *GetDomainUsingGETParams { - var () return &GetDomainUsingGETParams{ - timeout: timeout, } } // NewGetDomainUsingGETParamsWithContext creates a new GetDomainUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDomainUsingGETParamsWithContext(ctx context.Context) *GetDomainUsingGETParams { - var () return &GetDomainUsingGETParams{ - Context: ctx, } } // NewGetDomainUsingGETParamsWithHTTPClient creates a new GetDomainUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDomainUsingGETParamsWithHTTPClient(client *http.Client) *GetDomainUsingGETParams { - var () return &GetDomainUsingGETParams{ HTTPClient: client, } } -/*GetDomainUsingGETParams contains all the parameters to send to the API endpoint -for the get domain using g e t operation typically these are written to a http.Request +/* GetDomainUsingGETParams contains all the parameters to send to the API endpoint + for the get domain using g e t operation. + + Typically these are written to a http.Request. */ type GetDomainUsingGETParams struct { - /*DomainID - domainId + /* DomainID. + domainId */ DomainID string - /*IntegrationID - integrationId + /* IntegrationID. + + integrationId */ IntegrationID string @@ -76,6 +76,21 @@ type GetDomainUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get domain using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainUsingGETParams) WithDefaults() *GetDomainUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get domain using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get domain using get params func (o *GetDomainUsingGETParams) WithTimeout(timeout time.Duration) *GetDomainUsingGETParams { o.SetTimeout(timeout) diff --git a/pkg/client/vcf/get_domain_using_get_responses.go b/pkg/client/vcf/get_domain_using_get_responses.go index 1e250d5c..dadc82b6 100644 --- a/pkg/client/vcf/get_domain_using_get_responses.go +++ b/pkg/client/vcf/get_domain_using_get_responses.go @@ -47,7 +47,6 @@ func (o *GetDomainUsingGETReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetDomainUsingGETOK() *GetDomainUsingGETOK { return &GetDomainUsingGETOK{} } -/*GetDomainUsingGETOK handles this case with default header values. +/* GetDomainUsingGETOK describes a response with status code 200, with default header values. Get domain detail */ @@ -69,7 +68,6 @@ type GetDomainUsingGETOK struct { func (o *GetDomainUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/vcf/{integrationId}/domain/{domainId}][%d] getDomainUsingGETOK %+v", 200, o.Payload) } - func (o *GetDomainUsingGETOK) GetPayload() *models.VcfDomain { return o.Payload } @@ -91,7 +89,7 @@ func NewGetDomainUsingGETBadRequest() *GetDomainUsingGETBadRequest { return &GetDomainUsingGETBadRequest{} } -/*GetDomainUsingGETBadRequest handles this case with default header values. +/* GetDomainUsingGETBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type GetDomainUsingGETBadRequest struct { func (o *GetDomainUsingGETBadRequest) Error() string { return fmt.Sprintf("[GET /content/api/vcf/{integrationId}/domain/{domainId}][%d] getDomainUsingGETBadRequest %+v", 400, o.Payload) } - func (o *GetDomainUsingGETBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewGetDomainUsingGETUnauthorized() *GetDomainUsingGETUnauthorized { return &GetDomainUsingGETUnauthorized{} } -/*GetDomainUsingGETUnauthorized handles this case with default header values. +/* GetDomainUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewGetDomainUsingGETForbidden() *GetDomainUsingGETForbidden { return &GetDomainUsingGETForbidden{} } -/*GetDomainUsingGETForbidden handles this case with default header values. +/* GetDomainUsingGETForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/vcf/get_domains_using_get_parameters.go b/pkg/client/vcf/get_domains_using_get_parameters.go index 3e1eab10..70c58d5d 100644 --- a/pkg/client/vcf/get_domains_using_get_parameters.go +++ b/pkg/client/vcf/get_domains_using_get_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetDomainsUsingGETParams creates a new GetDomainsUsingGETParams object -// with the default values initialized. +// NewGetDomainsUsingGETParams creates a new GetDomainsUsingGETParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetDomainsUsingGETParams() *GetDomainsUsingGETParams { - var () return &GetDomainsUsingGETParams{ - timeout: cr.DefaultTimeout, } } // NewGetDomainsUsingGETParamsWithTimeout creates a new GetDomainsUsingGETParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetDomainsUsingGETParamsWithTimeout(timeout time.Duration) *GetDomainsUsingGETParams { - var () return &GetDomainsUsingGETParams{ - timeout: timeout, } } // NewGetDomainsUsingGETParamsWithContext creates a new GetDomainsUsingGETParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetDomainsUsingGETParamsWithContext(ctx context.Context) *GetDomainsUsingGETParams { - var () return &GetDomainsUsingGETParams{ - Context: ctx, } } // NewGetDomainsUsingGETParamsWithHTTPClient creates a new GetDomainsUsingGETParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetDomainsUsingGETParamsWithHTTPClient(client *http.Client) *GetDomainsUsingGETParams { - var () return &GetDomainsUsingGETParams{ HTTPClient: client, } } -/*GetDomainsUsingGETParams contains all the parameters to send to the API endpoint -for the get domains using g e t operation typically these are written to a http.Request +/* GetDomainsUsingGETParams contains all the parameters to send to the API endpoint + for the get domains using g e t operation. + + Typically these are written to a http.Request. */ type GetDomainsUsingGETParams struct { - /*IntegrationID - integrationId + /* IntegrationID. + integrationId */ IntegrationID string @@ -71,6 +70,21 @@ type GetDomainsUsingGETParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get domains using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainsUsingGETParams) WithDefaults() *GetDomainsUsingGETParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get domains using get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainsUsingGETParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get domains using get params func (o *GetDomainsUsingGETParams) WithTimeout(timeout time.Duration) *GetDomainsUsingGETParams { o.SetTimeout(timeout) diff --git a/pkg/client/vcf/get_domains_using_get_responses.go b/pkg/client/vcf/get_domains_using_get_responses.go index 35511679..f1eae68f 100644 --- a/pkg/client/vcf/get_domains_using_get_responses.go +++ b/pkg/client/vcf/get_domains_using_get_responses.go @@ -47,7 +47,6 @@ func (o *GetDomainsUsingGETReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -58,7 +57,7 @@ func NewGetDomainsUsingGETOK() *GetDomainsUsingGETOK { return &GetDomainsUsingGETOK{} } -/*GetDomainsUsingGETOK handles this case with default header values. +/* GetDomainsUsingGETOK describes a response with status code 200, with default header values. Get domains of the vCF endpoint */ @@ -69,7 +68,6 @@ type GetDomainsUsingGETOK struct { func (o *GetDomainsUsingGETOK) Error() string { return fmt.Sprintf("[GET /content/api/vcf/{integrationId}/domains][%d] getDomainsUsingGETOK %+v", 200, o.Payload) } - func (o *GetDomainsUsingGETOK) GetPayload() *models.VcfDomain { return o.Payload } @@ -91,7 +89,7 @@ func NewGetDomainsUsingGETBadRequest() *GetDomainsUsingGETBadRequest { return &GetDomainsUsingGETBadRequest{} } -/*GetDomainsUsingGETBadRequest handles this case with default header values. +/* GetDomainsUsingGETBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -102,7 +100,6 @@ type GetDomainsUsingGETBadRequest struct { func (o *GetDomainsUsingGETBadRequest) Error() string { return fmt.Sprintf("[GET /content/api/vcf/{integrationId}/domains][%d] getDomainsUsingGETBadRequest %+v", 400, o.Payload) } - func (o *GetDomainsUsingGETBadRequest) GetPayload() *models.Error { return o.Payload } @@ -124,7 +121,7 @@ func NewGetDomainsUsingGETUnauthorized() *GetDomainsUsingGETUnauthorized { return &GetDomainsUsingGETUnauthorized{} } -/*GetDomainsUsingGETUnauthorized handles this case with default header values. +/* GetDomainsUsingGETUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -145,7 +142,7 @@ func NewGetDomainsUsingGETForbidden() *GetDomainsUsingGETForbidden { return &GetDomainsUsingGETForbidden{} } -/*GetDomainsUsingGETForbidden handles this case with default header values. +/* GetDomainsUsingGETForbidden describes a response with status code 403, with default header values. Forbidden */ diff --git a/pkg/client/vcf/patch_service_account_using_patch_parameters.go b/pkg/client/vcf/patch_service_account_using_patch_parameters.go index 1fcad3b0..94a7c543 100644 --- a/pkg/client/vcf/patch_service_account_using_patch_parameters.go +++ b/pkg/client/vcf/patch_service_account_using_patch_parameters.go @@ -16,63 +16,64 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPatchServiceAccountUsingPATCHParams creates a new PatchServiceAccountUsingPATCHParams object -// with the default values initialized. +// NewPatchServiceAccountUsingPATCHParams creates a new PatchServiceAccountUsingPATCHParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPatchServiceAccountUsingPATCHParams() *PatchServiceAccountUsingPATCHParams { - var () return &PatchServiceAccountUsingPATCHParams{ - timeout: cr.DefaultTimeout, } } // NewPatchServiceAccountUsingPATCHParamsWithTimeout creates a new PatchServiceAccountUsingPATCHParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchServiceAccountUsingPATCHParamsWithTimeout(timeout time.Duration) *PatchServiceAccountUsingPATCHParams { - var () return &PatchServiceAccountUsingPATCHParams{ - timeout: timeout, } } // NewPatchServiceAccountUsingPATCHParamsWithContext creates a new PatchServiceAccountUsingPATCHParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchServiceAccountUsingPATCHParamsWithContext(ctx context.Context) *PatchServiceAccountUsingPATCHParams { - var () return &PatchServiceAccountUsingPATCHParams{ - Context: ctx, } } // NewPatchServiceAccountUsingPATCHParamsWithHTTPClient creates a new PatchServiceAccountUsingPATCHParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchServiceAccountUsingPATCHParamsWithHTTPClient(client *http.Client) *PatchServiceAccountUsingPATCHParams { - var () return &PatchServiceAccountUsingPATCHParams{ HTTPClient: client, } } -/*PatchServiceAccountUsingPATCHParams contains all the parameters to send to the API endpoint -for the patch service account using p a t c h operation typically these are written to a http.Request +/* PatchServiceAccountUsingPATCHParams contains all the parameters to send to the API endpoint + for the patch service account using p a t c h operation. + + Typically these are written to a http.Request. */ type PatchServiceAccountUsingPATCHParams struct { - /*DomainID - domainId + /* DomainID. + domainId */ DomainID string - /*IntegrationID - integrationId + /* IntegrationID. + + integrationId */ IntegrationID string - /*PatchRequest - patchRequest + /* PatchRequest. + + patchRequest */ PatchRequest map[string]string @@ -81,6 +82,21 @@ type PatchServiceAccountUsingPATCHParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the patch service account using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchServiceAccountUsingPATCHParams) WithDefaults() *PatchServiceAccountUsingPATCHParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch service account using p a t c h params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchServiceAccountUsingPATCHParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the patch service account using p a t c h params func (o *PatchServiceAccountUsingPATCHParams) WithTimeout(timeout time.Duration) *PatchServiceAccountUsingPATCHParams { o.SetTimeout(timeout) @@ -164,7 +180,6 @@ func (o *PatchServiceAccountUsingPATCHParams) WriteToRequest(r runtime.ClientReq if err := r.SetPathParam("integrationId", o.IntegrationID); err != nil { return err } - if o.PatchRequest != nil { if err := r.SetBodyParam(o.PatchRequest); err != nil { return err diff --git a/pkg/client/vcf/patch_service_account_using_patch_responses.go b/pkg/client/vcf/patch_service_account_using_patch_responses.go index db0a4855..06f78d0b 100644 --- a/pkg/client/vcf/patch_service_account_using_patch_responses.go +++ b/pkg/client/vcf/patch_service_account_using_patch_responses.go @@ -29,7 +29,6 @@ func (o *PatchServiceAccountUsingPATCHReader) ReadResponse(response runtime.Clie return nil, err } return result, nil - default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -40,7 +39,7 @@ func NewPatchServiceAccountUsingPATCHOK() *PatchServiceAccountUsingPATCHOK { return &PatchServiceAccountUsingPATCHOK{} } -/*PatchServiceAccountUsingPATCHOK handles this case with default header values. +/* PatchServiceAccountUsingPATCHOK describes a response with status code 200, with default header values. OK */ @@ -51,7 +50,6 @@ type PatchServiceAccountUsingPATCHOK struct { func (o *PatchServiceAccountUsingPATCHOK) Error() string { return fmt.Sprintf("[PATCH /content/api/vcf/{integrationId}/domain/{domainId}/service-accounts][%d] patchServiceAccountUsingPATCHOK %+v", 200, o.Payload) } - func (o *PatchServiceAccountUsingPATCHOK) GetPayload() []*models.VcfServiceCredential { return o.Payload } diff --git a/pkg/client/vcf/vcf_client.go b/pkg/client/vcf/vcf_client.go index 406020ac..8be6b244 100644 --- a/pkg/client/vcf/vcf_client.go +++ b/pkg/client/vcf/vcf_client.go @@ -25,21 +25,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateServiceCredentialsUsingPOST(params *CreateServiceCredentialsUsingPOSTParams) (*CreateServiceCredentialsUsingPOSTOK, error) + CreateServiceCredentialsUsingPOST(params *CreateServiceCredentialsUsingPOSTParams, opts ...ClientOption) (*CreateServiceCredentialsUsingPOSTOK, error) - DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsingDELETEParams) (*DeleteServiceAccountUsingDELETENoContent, error) + DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsingDELETEParams, opts ...ClientOption) (*DeleteServiceAccountUsingDELETENoContent, error) - DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredentialUsingDELETEParams) (*DeleteServiceCredentialUsingDELETENoContent, error) + DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredentialUsingDELETEParams, opts ...ClientOption) (*DeleteServiceCredentialUsingDELETENoContent, error) - EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTParams) (*EnumerateDomainsUsingPOSTOK, error) + EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTParams, opts ...ClientOption) (*EnumerateDomainsUsingPOSTOK, error) - GetDomainUsingGET(params *GetDomainUsingGETParams) (*GetDomainUsingGETOK, error) + GetDomainUsingGET(params *GetDomainUsingGETParams, opts ...ClientOption) (*GetDomainUsingGETOK, error) - GetDomainsUsingGET(params *GetDomainsUsingGETParams) (*GetDomainsUsingGETOK, error) + GetDomainsUsingGET(params *GetDomainsUsingGETParams, opts ...ClientOption) (*GetDomainsUsingGETOK, error) - PatchServiceAccountUsingPATCH(params *PatchServiceAccountUsingPATCHParams) (*PatchServiceAccountUsingPATCHOK, error) + PatchServiceAccountUsingPATCH(params *PatchServiceAccountUsingPATCHParams, opts ...ClientOption) (*PatchServiceAccountUsingPATCHOK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +50,12 @@ type ClientService interface { /* CreateServiceCredentialsUsingPOST creates service credentials */ -func (a *Client) CreateServiceCredentialsUsingPOST(params *CreateServiceCredentialsUsingPOSTParams) (*CreateServiceCredentialsUsingPOSTOK, error) { +func (a *Client) CreateServiceCredentialsUsingPOST(params *CreateServiceCredentialsUsingPOSTParams, opts ...ClientOption) (*CreateServiceCredentialsUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateServiceCredentialsUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createServiceCredentialsUsingPOST", Method: "POST", PathPattern: "/content/api/vcf/{integrationId}/domain/{domainId}/service-accounts", @@ -64,7 +66,12 @@ func (a *Client) CreateServiceCredentialsUsingPOST(params *CreateServiceCredenti Reader: &CreateServiceCredentialsUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -81,13 +88,12 @@ func (a *Client) CreateServiceCredentialsUsingPOST(params *CreateServiceCredenti /* DeleteServiceAccountUsingDELETE deletes a service account */ -func (a *Client) DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsingDELETEParams) (*DeleteServiceAccountUsingDELETENoContent, error) { +func (a *Client) DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsingDELETEParams, opts ...ClientOption) (*DeleteServiceAccountUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteServiceAccountUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteServiceAccountUsingDELETE", Method: "DELETE", PathPattern: "/content/api/vcf/{integrationId}/domain/{domainId}/service-accounts", @@ -98,7 +104,12 @@ func (a *Client) DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsi Reader: &DeleteServiceAccountUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,13 +126,12 @@ func (a *Client) DeleteServiceAccountUsingDELETE(params *DeleteServiceAccountUsi /* DeleteServiceCredentialUsingDELETE deletes a service credential */ -func (a *Client) DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredentialUsingDELETEParams) (*DeleteServiceCredentialUsingDELETENoContent, error) { +func (a *Client) DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredentialUsingDELETEParams, opts ...ClientOption) (*DeleteServiceCredentialUsingDELETENoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteServiceCredentialUsingDELETEParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteServiceCredentialUsingDELETE", Method: "DELETE", PathPattern: "/content/api/vcf/{integrationId}/domain/{domainId}/service-accounts/{id}", @@ -132,7 +142,12 @@ func (a *Client) DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredent Reader: &DeleteServiceCredentialUsingDELETEReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -149,13 +164,12 @@ func (a *Client) DeleteServiceCredentialUsingDELETE(params *DeleteServiceCredent /* EnumerateDomainsUsingPOST enumerates domains */ -func (a *Client) EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTParams) (*EnumerateDomainsUsingPOSTOK, error) { +func (a *Client) EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTParams, opts ...ClientOption) (*EnumerateDomainsUsingPOSTOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnumerateDomainsUsingPOSTParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enumerateDomainsUsingPOST", Method: "POST", PathPattern: "/content/api/vcf/domains-enumeration", @@ -166,7 +180,12 @@ func (a *Client) EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTPara Reader: &EnumerateDomainsUsingPOSTReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -183,13 +202,12 @@ func (a *Client) EnumerateDomainsUsingPOST(params *EnumerateDomainsUsingPOSTPara /* GetDomainUsingGET gets domain details */ -func (a *Client) GetDomainUsingGET(params *GetDomainUsingGETParams) (*GetDomainUsingGETOK, error) { +func (a *Client) GetDomainUsingGET(params *GetDomainUsingGETParams, opts ...ClientOption) (*GetDomainUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDomainUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDomainUsingGET", Method: "GET", PathPattern: "/content/api/vcf/{integrationId}/domain/{domainId}", @@ -200,7 +218,12 @@ func (a *Client) GetDomainUsingGET(params *GetDomainUsingGETParams) (*GetDomainU Reader: &GetDomainUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -217,13 +240,12 @@ func (a *Client) GetDomainUsingGET(params *GetDomainUsingGETParams) (*GetDomainU /* GetDomainsUsingGET gets domains */ -func (a *Client) GetDomainsUsingGET(params *GetDomainsUsingGETParams) (*GetDomainsUsingGETOK, error) { +func (a *Client) GetDomainsUsingGET(params *GetDomainsUsingGETParams, opts ...ClientOption) (*GetDomainsUsingGETOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetDomainsUsingGETParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getDomainsUsingGET", Method: "GET", PathPattern: "/content/api/vcf/{integrationId}/domains", @@ -234,7 +256,12 @@ func (a *Client) GetDomainsUsingGET(params *GetDomainsUsingGETParams) (*GetDomai Reader: &GetDomainsUsingGETReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -251,13 +278,12 @@ func (a *Client) GetDomainsUsingGET(params *GetDomainsUsingGETParams) (*GetDomai /* PatchServiceAccountUsingPATCH patches service account */ -func (a *Client) PatchServiceAccountUsingPATCH(params *PatchServiceAccountUsingPATCHParams) (*PatchServiceAccountUsingPATCHOK, error) { +func (a *Client) PatchServiceAccountUsingPATCH(params *PatchServiceAccountUsingPATCHParams, opts ...ClientOption) (*PatchServiceAccountUsingPATCHOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchServiceAccountUsingPATCHParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchServiceAccountUsingPATCH", Method: "PATCH", PathPattern: "/content/api/vcf/{integrationId}/domain/{domainId}/service-accounts", @@ -268,7 +294,12 @@ func (a *Client) PatchServiceAccountUsingPATCH(params *PatchServiceAccountUsingP Reader: &PatchServiceAccountUsingPATCHReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/pkg/client/vra_client.go b/pkg/client/vra_client.go index 98b55a7e..4eaaa389 100644 --- a/pkg/client/vra_client.go +++ b/pkg/client/vra_client.go @@ -23,6 +23,7 @@ import ( "github.com/vmware/vra-sdk-go/pkg/client/cloud_account" "github.com/vmware/vra-sdk-go/pkg/client/compute" "github.com/vmware/vra-sdk-go/pkg/client/compute_gateway" + "github.com/vmware/vra-sdk-go/pkg/client/compute_nat" "github.com/vmware/vra-sdk-go/pkg/client/content_source" "github.com/vmware/vra-sdk-go/pkg/client/data_collector" "github.com/vmware/vra-sdk-go/pkg/client/deployment" @@ -72,7 +73,7 @@ var Default = NewHTTPClient(nil) const ( // DefaultHost is the default Host // found in Meta (info) section of spec file - DefaultHost string = "api.mgmt.cloud.vmware.com" + DefaultHost string = "cava-r-90-055.eng.vmware.com" // DefaultBasePath is the default BasePath // found in Meta (info) section of spec file DefaultBasePath string = "/" @@ -121,6 +122,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Multicloud cli.CloudAccount = cloud_account.New(transport, formats) cli.Compute = compute.New(transport, formats) cli.ComputeGateway = compute_gateway.New(transport, formats) + cli.ComputeNat = compute_nat.New(transport, formats) cli.ContentSource = content_source.New(transport, formats) cli.DataCollector = data_collector.New(transport, formats) cli.Deployment = deployment.New(transport, formats) @@ -232,6 +234,8 @@ type MulticloudIaaS struct { ComputeGateway compute_gateway.ClientService + ComputeNat compute_nat.ClientService + ContentSource content_source.ClientService DataCollector data_collector.ClientService @@ -333,6 +337,7 @@ func (c *MulticloudIaaS) SetTransport(transport runtime.ClientTransport) { c.CloudAccount.SetTransport(transport) c.Compute.SetTransport(transport) c.ComputeGateway.SetTransport(transport) + c.ComputeNat.SetTransport(transport) c.ContentSource.SetTransport(transport) c.DataCollector.SetTransport(transport) c.Deployment.SetTransport(transport) diff --git a/pkg/models/admin_catalog_item_patch.go b/pkg/models/admin_catalog_item_patch.go index 99bfc3db..f4e3569e 100644 --- a/pkg/models/admin_catalog_item_patch.go +++ b/pkg/models/admin_catalog_item_patch.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -43,7 +45,6 @@ func (m *AdminCatalogItemPatch) Validate(formats strfmt.Registry) error { } func (m *AdminCatalogItemPatch) validateBulkRequestLimit(formats strfmt.Registry) error { - if swag.IsZero(m.BulkRequestLimit) { // not required return nil } @@ -59,6 +60,11 @@ func (m *AdminCatalogItemPatch) validateBulkRequestLimit(formats strfmt.Registry return nil } +// ContextValidate validates this admin catalog item patch based on context it is used +func (m *AdminCatalogItemPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AdminCatalogItemPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/api_description.go b/pkg/models/api_description.go index b36792f4..87c9eb32 100644 --- a/pkg/models/api_description.go +++ b/pkg/models/api_description.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -61,7 +63,6 @@ func (m *APIDescription) validateAPIVersion(formats strfmt.Registry) error { } func (m *APIDescription) validateDeprecationPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.DeprecationPolicy) { // not required return nil } @@ -87,6 +88,34 @@ func (m *APIDescription) validateDocumentationLink(formats strfmt.Registry) erro return nil } +// ContextValidate validate this Api description based on the context it is used +func (m *APIDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeprecationPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDescription) contextValidateDeprecationPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.DeprecationPolicy != nil { + if err := m.DeprecationPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deprecationPolicy") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *APIDescription) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/auth_response.go b/pkg/models/auth_response.go index 0b6c034f..61ffc3d5 100644 --- a/pkg/models/auth_response.go +++ b/pkg/models/auth_response.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,6 +24,7 @@ type AuthResponse struct { Token *string `json:"token"` // Type of the token. + // Example: Bearer // Required: true TokenType *string `json:"tokenType"` } @@ -62,6 +65,11 @@ func (m *AuthResponse) validateTokenType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this auth response based on context it is used +func (m *AuthResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AuthResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/aws_storage_profile.go b/pkg/models/aws_storage_profile.go index a50157b0..0f83614d 100644 --- a/pkg/models/aws_storage_profile.go +++ b/pkg/models/aws_storage_profile.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,53 +25,69 @@ type AwsStorageProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this storage profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Indicates whether this storage profile is default or not.. + // Example: false // Required: true DefaultItem *bool `json:"defaultItem"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // Indicates the type of storage device. + // Example: ebs / instance-store DeviceType string `json:"deviceType,omitempty"` // The id of the region for which this profile is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Indicates maximum I/O operations per second in range(1-20,000). + // Example: 2000 Iops string `json:"iops,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Indicates whether this storage profile supports encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // Indicates the type of volume associated with type of storage device. + // Example: gp2 / io1 / sc1 / st1 / standard VolumeType string `json:"volumeType,omitempty"` } @@ -102,6 +119,10 @@ func (m *AwsStorageProfile) Validate(formats strfmt.Registry) error { func (m *AwsStorageProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -137,7 +158,6 @@ func (m *AwsStorageProfile) validateID(formats strfmt.Registry) error { } func (m *AwsStorageProfile) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -161,6 +181,61 @@ func (m *AwsStorageProfile) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this aws storage profile based on the context it is used +func (m *AwsStorageProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AwsStorageProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *AwsStorageProfile) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *AwsStorageProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/azure_storage_profile.go b/pkg/models/azure_storage_profile.go index caf58135..f4f0fd12 100644 --- a/pkg/models/azure_storage_profile.go +++ b/pkg/models/azure_storage_profile.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,53 +25,73 @@ type AzureStorageProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this storage profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Indicates the caching mechanism for additional disk. + // Example: None / ReadOnly / ReadWrite DataDiskCaching string `json:"dataDiskCaching,omitempty"` // Indicates if a storage profile contains default storage properties. + // Example: false // Required: true DefaultItem *bool `json:"defaultItem"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` + // Indicates the id of disk encryption set. + // Example: /subscriptions/b8ef63/resourceGroups/DiskEncryptionSets/providers/Microsoft.Compute/diskEncryptionSets/MyDES + DiskEncryptionSetID string `json:"diskEncryptionSetId,omitempty"` + // Indicates the performance tier for the storage type. Premium disks are SSD backed and Standard disks are HDD backed. + // Example: Standard_LRS / Premium_LRS DiskType string `json:"diskType,omitempty"` // The id of the region for which this profile is defined + // Example: uswest ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Indicates the caching mechanism for OS disk. Default policy for OS disks is Read/Write. + // Example: None / ReadOnly / ReadWrite OsDiskCaching string `json:"osDiskCaching,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Indicates whether this storage profile should support encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -102,6 +123,10 @@ func (m *AzureStorageProfile) Validate(formats strfmt.Registry) error { func (m *AzureStorageProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -137,7 +162,6 @@ func (m *AzureStorageProfile) validateID(formats strfmt.Registry) error { } func (m *AzureStorageProfile) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -161,6 +185,61 @@ func (m *AzureStorageProfile) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this azure storage profile based on the context it is used +func (m *AzureStorageProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AzureStorageProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *AzureStorageProfile) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *AzureStorageProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/block_device.go b/pkg/models/block_device.go index 77ae1db0..490ce87a 100644 --- a/pkg/models/block_device.go +++ b/pkg/models/block_device.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -25,71 +26,91 @@ type BlockDevice struct { Links map[string]Href `json:"_links"` // Capacity of the block device in GB. + // Example: 10 // Required: true CapacityInGB *int32 `json:"capacityInGB"` // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Indicates whether the block device survives a delete action. + // Example: true Persistent bool `json:"persistent,omitempty"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // Status of the block device + // Example: ATTACHED // Required: true // Enum: [DETACHED ATTACHED AVAILABLE] Status *string `json:"status"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Type of the block device + // Example: HDD // Enum: [SSD HDD CDROM FLOPPY] Type string `json:"type,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -141,6 +162,10 @@ func (m *BlockDevice) Validate(formats strfmt.Registry) error { func (m *BlockDevice) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -167,7 +192,6 @@ func (m *BlockDevice) validateCapacityInGB(formats strfmt.Registry) error { } func (m *BlockDevice) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -253,7 +277,6 @@ func (m *BlockDevice) validateStatus(formats strfmt.Registry) error { } func (m *BlockDevice) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -313,7 +336,6 @@ func (m *BlockDevice) validateTypeEnum(path, location string, value string) erro } func (m *BlockDevice) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -326,6 +348,61 @@ func (m *BlockDevice) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this block device based on the context it is used +func (m *BlockDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlockDevice) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *BlockDevice) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlockDevice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/block_device_result.go b/pkg/models/block_device_result.go index 83df738c..39783f9e 100644 --- a/pkg/models/block_device_result.go +++ b/pkg/models/block_device_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // BlockDeviceResult State object representing a query result of block device. @@ -23,10 +25,12 @@ type BlockDeviceResult struct { Content []*BlockDevice `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *BlockDeviceResult) Validate(formats strfmt.Registry) error { } func (m *BlockDeviceResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *BlockDeviceResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this block device result based on the context it is used +func (m *BlockDeviceResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlockDeviceResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*BlockDevice(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BlockDeviceResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *BlockDeviceResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlockDeviceResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/block_device_specification.go b/pkg/models/block_device_specification.go index 690f4e4f..8d207174 100644 --- a/pkg/models/block_device_specification.go +++ b/pkg/models/block_device_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,25 +21,30 @@ import ( type BlockDeviceSpecification struct { // Capacity of the block device in GB. + // Example: 78 // Required: true CapacityInGB *int32 `json:"capacityInGB"` // Constraints that are used to drive placement policies for the block device that is produced from this specification. Constraint expressions are matched against tags on existing placement targets. + // Example: [ { \"mandatory\" : \"true\", \"expression\": \"environment\":\"prod\"}, {\"mandatory\" : \"false\", \"floor\": \"3rd\"} ] Constraints []*Constraint `json:"constraints"` - // Additional custom properties that may be used to extend the block device. + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // Content of a disk, base64 encoded. + // Example: dGVzdA DiskContentBase64 string `json:"diskContentBase64,omitempty"` // Indicates whether the block device should be encrypted or not. + // Example: true Encrypted bool `json:"encrypted,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -46,16 +52,20 @@ type BlockDeviceSpecification struct { Name *string `json:"name"` // Indicates whether the block device survives a delete action. + // Example: true Persistent bool `json:"persistent,omitempty"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` // Reference to URI using which the block device has to be created. + // Example: ami-0d4cfd66 SourceReference string `json:"sourceReference,omitempty"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"location\", \"value\": \"SOF\" } ] Tags []*Tag `json:"tags"` } @@ -99,7 +109,6 @@ func (m *BlockDeviceSpecification) validateCapacityInGB(formats strfmt.Registry) } func (m *BlockDeviceSpecification) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -142,7 +151,6 @@ func (m *BlockDeviceSpecification) validateProjectID(formats strfmt.Registry) er } func (m *BlockDeviceSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -166,6 +174,60 @@ func (m *BlockDeviceSpecification) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this block device specification based on the context it is used +func (m *BlockDeviceSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlockDeviceSpecification) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Constraints); i++ { + + if m.Constraints[i] != nil { + if err := m.Constraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BlockDeviceSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlockDeviceSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint.go b/pkg/models/blueprint.go index 7387b994..7de7e647 100644 --- a/pkg/models/blueprint.go +++ b/pkg/models/blueprint.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -152,7 +153,6 @@ func (m *Blueprint) Validate(formats strfmt.Registry) error { } func (m *Blueprint) validateContentSourceSyncAt(formats strfmt.Registry) error { - if swag.IsZero(m.ContentSourceSyncAt) { // not required return nil } @@ -194,7 +194,6 @@ func (m *Blueprint) validateContentSourceSyncStatusEnum(path, location string, v } func (m *Blueprint) validateContentSourceSyncStatus(formats strfmt.Registry) error { - if swag.IsZero(m.ContentSourceSyncStatus) { // not required return nil } @@ -208,7 +207,6 @@ func (m *Blueprint) validateContentSourceSyncStatus(formats strfmt.Registry) err } func (m *Blueprint) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -253,7 +251,6 @@ func (m *Blueprint) validateStatusEnum(path, location string, value string) erro } func (m *Blueprint) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -267,7 +264,6 @@ func (m *Blueprint) validateStatus(formats strfmt.Registry) error { } func (m *Blueprint) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -280,7 +276,6 @@ func (m *Blueprint) validateUpdatedAt(formats strfmt.Registry) error { } func (m *Blueprint) validateValidationMessages(formats strfmt.Registry) error { - if swag.IsZero(m.ValidationMessages) { // not required return nil } @@ -304,6 +299,276 @@ func (m *Blueprint) validateValidationMessages(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint based on the context it is used +func (m *Blueprint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContentSourceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentSourcePath(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentSourceSyncAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentSourceSyncMessages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentSourceSyncStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentSourceType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSelfLink(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalReleasedVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValid(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValidationMessages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Blueprint) contextValidateContentSourceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourceId", "body", string(m.ContentSourceID)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateContentSourcePath(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourcePath", "body", string(m.ContentSourcePath)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateContentSourceSyncAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourceSyncAt", "body", strfmt.DateTime(m.ContentSourceSyncAt)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateContentSourceSyncMessages(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourceSyncMessages", "body", []string(m.ContentSourceSyncMessages)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateContentSourceSyncStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourceSyncStatus", "body", string(m.ContentSourceSyncStatus)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateContentSourceType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentSourceType", "body", string(m.ContentSourceType)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateProjectName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectName", "body", string(m.ProjectName)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateSelfLink(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "selfLink", "body", string(m.SelfLink)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateTotalReleasedVersions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalReleasedVersions", "body", int32(m.TotalReleasedVersions)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateTotalVersions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalVersions", "body", int32(m.TotalVersions)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateValid(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "valid", "body", m.Valid); err != nil { + return err + } + + return nil +} + +func (m *Blueprint) contextValidateValidationMessages(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "validationMessages", "body", []*BlueprintValidationMessage(m.ValidationMessages)); err != nil { + return err + } + + for i := 0; i < len(m.ValidationMessages); i++ { + + if m.ValidationMessages[i] != nil { + if err := m.ValidationMessages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validationMessages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Blueprint) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_about.go b/pkg/models/blueprint_about.go index 8824c1d3..6cd91580 100644 --- a/pkg/models/blueprint_about.go +++ b/pkg/models/blueprint_about.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // BlueprintAbout BlueprintAbout @@ -42,7 +44,6 @@ func (m *BlueprintAbout) Validate(formats strfmt.Registry) error { } func (m *BlueprintAbout) validateSupportedApis(formats strfmt.Registry) error { - if swag.IsZero(m.SupportedApis) { // not required return nil } @@ -66,6 +67,55 @@ func (m *BlueprintAbout) validateSupportedApis(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint about based on the context it is used +func (m *BlueprintAbout) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLatestAPIVersion(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupportedApis(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintAbout) contextValidateLatestAPIVersion(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "latestApiVersion", "body", string(m.LatestAPIVersion)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintAbout) contextValidateSupportedApis(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "supportedApis", "body", []*SupportedAPI(m.SupportedApis)); err != nil { + return err + } + + for i := 0; i < len(m.SupportedApis); i++ { + + if m.SupportedApis[i] != nil { + if err := m.SupportedApis[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("supportedApis" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintAbout) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_content_source.go b/pkg/models/blueprint_content_source.go index 50632760..eb52adea 100644 --- a/pkg/models/blueprint_content_source.go +++ b/pkg/models/blueprint_content_source.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -59,7 +61,6 @@ func (m *BlueprintContentSource) Validate(formats strfmt.Registry) error { } func (m *BlueprintContentSource) validateConfig(formats strfmt.Registry) error { - if swag.IsZero(m.Config) { // not required return nil } @@ -76,6 +77,34 @@ func (m *BlueprintContentSource) validateConfig(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint content source based on the context it is used +func (m *BlueprintContentSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintContentSource) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.Config != nil { + if err := m.Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintContentSource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_content_source_config.go b/pkg/models/blueprint_content_source_config.go index 181b3b7c..efb0e208 100644 --- a/pkg/models/blueprint_content_source_config.go +++ b/pkg/models/blueprint_content_source_config.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -36,6 +38,11 @@ func (m *BlueprintContentSourceConfig) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this blueprint content source config based on context it is used +func (m *BlueprintContentSourceConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *BlueprintContentSourceConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_execution.go b/pkg/models/blueprint_execution.go index 3071d5c9..1eb40a2d 100644 --- a/pkg/models/blueprint_execution.go +++ b/pkg/models/blueprint_execution.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -99,7 +100,6 @@ func (m *BlueprintExecution) validateStatusEnum(path, location string, value str } func (m *BlueprintExecution) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -113,7 +113,6 @@ func (m *BlueprintExecution) validateStatus(formats strfmt.Registry) error { } func (m *BlueprintExecution) validateTasks(formats strfmt.Registry) error { - if swag.IsZero(m.Tasks) { // not required return nil } @@ -137,6 +136,68 @@ func (m *BlueprintExecution) validateTasks(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint execution based on the context it is used +func (m *BlueprintExecution) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFailureMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTasks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintExecution) contextValidateFailureMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "failureMessage", "body", string(m.FailureMessage)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintExecution) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintExecution) contextValidateTasks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tasks", "body", []*BlueprintTaskExecution(m.Tasks)); err != nil { + return err + } + + for i := 0; i < len(m.Tasks); i++ { + + if m.Tasks[i] != nil { + if err := m.Tasks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintExecution) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_plan.go b/pkg/models/blueprint_plan.go index e15ad3b2..bc455452 100644 --- a/pkg/models/blueprint_plan.go +++ b/pkg/models/blueprint_plan.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // BlueprintPlan BlueprintPlan @@ -46,7 +48,6 @@ func (m *BlueprintPlan) Validate(formats strfmt.Registry) error { } func (m *BlueprintPlan) validateTasks(formats strfmt.Registry) error { - if swag.IsZero(m.Tasks) { // not required return nil } @@ -70,6 +71,42 @@ func (m *BlueprintPlan) validateTasks(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint plan based on the context it is used +func (m *BlueprintPlan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTasks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintPlan) contextValidateTasks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tasks", "body", []*BlueprintPlanTask(m.Tasks)); err != nil { + return err + } + + for i := 0; i < len(m.Tasks); i++ { + + if m.Tasks[i] != nil { + if err := m.Tasks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintPlan) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_plan_resource.go b/pkg/models/blueprint_plan_resource.go index 18cb2760..a4b6659c 100644 --- a/pkg/models/blueprint_plan_resource.go +++ b/pkg/models/blueprint_plan_resource.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -105,7 +106,6 @@ func (m *BlueprintPlanResource) validateResourceReasonEnum(path, location string } func (m *BlueprintPlanResource) validateResourceReason(formats strfmt.Registry) error { - if swag.IsZero(m.ResourceReason) { // not required return nil } @@ -118,6 +118,81 @@ func (m *BlueprintPlanResource) validateResourceReason(formats strfmt.Registry) return nil } +// ContextValidate validate this blueprint plan resource based on the context it is used +func (m *BlueprintPlanResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDependsOnResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskNames(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintPlanResource) contextValidateDependsOnResources(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dependsOnResources", "body", []string(m.DependsOnResources)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanResource) contextValidateResourceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceName", "body", string(m.ResourceName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanResource) contextValidateResourceReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceReason", "body", string(m.ResourceReason)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanResource) contextValidateResourceType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceType", "body", string(m.ResourceType)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanResource) contextValidateTaskNames(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "taskNames", "body", []string(m.TaskNames)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintPlanResource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_plan_task.go b/pkg/models/blueprint_plan_task.go index 4ecf474c..54ab3e10 100644 --- a/pkg/models/blueprint_plan_task.go +++ b/pkg/models/blueprint_plan_task.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -101,7 +102,6 @@ func (m *BlueprintPlanTask) validateResourceReasonEnum(path, location string, va } func (m *BlueprintPlanTask) validateResourceReason(formats strfmt.Registry) error { - if swag.IsZero(m.ResourceReason) { // not required return nil } @@ -114,6 +114,81 @@ func (m *BlueprintPlanTask) validateResourceReason(formats strfmt.Registry) erro return nil } +// ContextValidate validate this blueprint plan task based on the context it is used +func (m *BlueprintPlanTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDependsOnTasks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintPlanTask) contextValidateDependsOnTasks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dependsOnTasks", "body", []string(m.DependsOnTasks)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanTask) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "name", "body", string(m.Name)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanTask) contextValidateResourceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceName", "body", string(m.ResourceName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanTask) contextValidateResourceReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceReason", "body", string(m.ResourceReason)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintPlanTask) contextValidateResourceType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceType", "body", string(m.ResourceType)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintPlanTask) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_request.go b/pkg/models/blueprint_request.go index 5d4ccad7..87a6eb14 100644 --- a/pkg/models/blueprint_request.go +++ b/pkg/models/blueprint_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -160,7 +161,6 @@ func (m *BlueprintRequest) Validate(formats strfmt.Registry) error { } func (m *BlueprintRequest) validateBlueprintID(formats strfmt.Registry) error { - if swag.IsZero(m.BlueprintID) { // not required return nil } @@ -173,7 +173,6 @@ func (m *BlueprintRequest) validateBlueprintID(formats strfmt.Registry) error { } func (m *BlueprintRequest) validateCancelRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CancelRequestedAt) { // not required return nil } @@ -186,7 +185,6 @@ func (m *BlueprintRequest) validateCancelRequestedAt(formats strfmt.Registry) er } func (m *BlueprintRequest) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -237,7 +235,6 @@ func (m *BlueprintRequest) validateStatusEnum(path, location string, value strin } func (m *BlueprintRequest) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -251,7 +248,6 @@ func (m *BlueprintRequest) validateStatus(formats strfmt.Registry) error { } func (m *BlueprintRequest) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -264,7 +260,6 @@ func (m *BlueprintRequest) validateUpdatedAt(formats strfmt.Registry) error { } func (m *BlueprintRequest) validateValidationMessages(formats strfmt.Registry) error { - if swag.IsZero(m.ValidationMessages) { // not required return nil } @@ -288,6 +283,224 @@ func (m *BlueprintRequest) validateValidationMessages(formats strfmt.Registry) e return nil } +// ContextValidate validate this blueprint request based on the context it is used +func (m *BlueprintRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCancelRequestedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCancelRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFailureMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFlowExecutionID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFlowID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestTrackerID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValidationMessages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintRequest) contextValidateCancelRequestedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "cancelRequestedAt", "body", strfmt.DateTime(m.CancelRequestedAt)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateCancelRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "cancelRequestedBy", "body", string(m.CancelRequestedBy)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateFailureMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "failureMessage", "body", string(m.FailureMessage)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateFlowExecutionID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "flowExecutionId", "body", string(m.FlowExecutionID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateFlowID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "flowId", "body", string(m.FlowID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateProjectName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectName", "body", string(m.ProjectName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateRequestTrackerID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestTrackerId", "body", string(m.RequestTrackerID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintRequest) contextValidateValidationMessages(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "validationMessages", "body", []*BlueprintValidationMessage(m.ValidationMessages)); err != nil { + return err + } + + for i := 0; i < len(m.ValidationMessages); i++ { + + if m.ValidationMessages[i] != nil { + if err := m.ValidationMessages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validationMessages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_resources_plan.go b/pkg/models/blueprint_resources_plan.go index 3cf64822..4a42b268 100644 --- a/pkg/models/blueprint_resources_plan.go +++ b/pkg/models/blueprint_resources_plan.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // BlueprintResourcesPlan BlueprintResourcesPlan @@ -38,7 +40,6 @@ func (m *BlueprintResourcesPlan) Validate(formats strfmt.Registry) error { } func (m *BlueprintResourcesPlan) validateResources(formats strfmt.Registry) error { - if swag.IsZero(m.Resources) { // not required return nil } @@ -62,6 +63,42 @@ func (m *BlueprintResourcesPlan) validateResources(formats strfmt.Registry) erro return nil } +// ContextValidate validate this blueprint resources plan based on the context it is used +func (m *BlueprintResourcesPlan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintResourcesPlan) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resources", "body", []*BlueprintPlanResource(m.Resources)); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintResourcesPlan) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_task_execution.go b/pkg/models/blueprint_task_execution.go index 7da9f558..1df67c71 100644 --- a/pkg/models/blueprint_task_execution.go +++ b/pkg/models/blueprint_task_execution.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -106,7 +107,6 @@ func (m *BlueprintTaskExecution) validateStatusEnum(path, location string, value } func (m *BlueprintTaskExecution) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -119,6 +119,94 @@ func (m *BlueprintTaskExecution) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint task execution based on the context it is used +func (m *BlueprintTaskExecution) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDependsOnTasks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFailureMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintTaskExecution) contextValidateDependsOnTasks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dependsOnTasks", "body", []string(m.DependsOnTasks)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintTaskExecution) contextValidateFailureMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "failureMessage", "body", string(m.FailureMessage)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintTaskExecution) contextValidateResourceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceName", "body", string(m.ResourceName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintTaskExecution) contextValidateResourceType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceType", "body", string(m.ResourceType)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintTaskExecution) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintTaskExecution) contextValidateTaskName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "taskName", "body", string(m.TaskName)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintTaskExecution) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_validation_message.go b/pkg/models/blueprint_validation_message.go index 260b0fe6..2e310a6a 100644 --- a/pkg/models/blueprint_validation_message.go +++ b/pkg/models/blueprint_validation_message.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -88,7 +89,6 @@ func (m *BlueprintValidationMessage) validateTypeEnum(path, location string, val } func (m *BlueprintValidationMessage) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -101,6 +101,77 @@ func (m *BlueprintValidationMessage) validateType(formats strfmt.Registry) error return nil } +// ContextValidate validate this blueprint validation message based on the context it is used +func (m *BlueprintValidationMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePath(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintValidationMessage) contextValidateMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "message", "body", string(m.Message)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintValidationMessage) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *BlueprintValidationMessage) contextValidatePath(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "path", "body", string(m.Path)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintValidationMessage) contextValidateResourceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceName", "body", string(m.ResourceName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintValidationMessage) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "type", "body", string(m.Type)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintValidationMessage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_validation_request.go b/pkg/models/blueprint_validation_request.go index 564b0e6c..f49f4a75 100644 --- a/pkg/models/blueprint_validation_request.go +++ b/pkg/models/blueprint_validation_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -46,7 +48,6 @@ func (m *BlueprintValidationRequest) Validate(formats strfmt.Registry) error { } func (m *BlueprintValidationRequest) validateBlueprintID(formats strfmt.Registry) error { - if swag.IsZero(m.BlueprintID) { // not required return nil } @@ -58,6 +59,11 @@ func (m *BlueprintValidationRequest) validateBlueprintID(formats strfmt.Registry return nil } +// ContextValidate validates this blueprint validation request based on context it is used +func (m *BlueprintValidationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *BlueprintValidationRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_validation_response.go b/pkg/models/blueprint_validation_response.go index 31da7f07..1cc06647 100644 --- a/pkg/models/blueprint_validation_response.go +++ b/pkg/models/blueprint_validation_response.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // BlueprintValidationResponse BlueprintValidationResponse @@ -42,7 +44,6 @@ func (m *BlueprintValidationResponse) Validate(formats strfmt.Registry) error { } func (m *BlueprintValidationResponse) validateValidationMessages(formats strfmt.Registry) error { - if swag.IsZero(m.ValidationMessages) { // not required return nil } @@ -66,6 +67,55 @@ func (m *BlueprintValidationResponse) validateValidationMessages(formats strfmt. return nil } +// ContextValidate validate this blueprint validation response based on the context it is used +func (m *BlueprintValidationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateValid(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValidationMessages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintValidationResponse) contextValidateValid(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "valid", "body", m.Valid); err != nil { + return err + } + + return nil +} + +func (m *BlueprintValidationResponse) contextValidateValidationMessages(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "validationMessages", "body", []*BlueprintValidationMessage(m.ValidationMessages)); err != nil { + return err + } + + for i := 0; i < len(m.ValidationMessages); i++ { + + if m.ValidationMessages[i] != nil { + if err := m.ValidationMessages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validationMessages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintValidationResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_version.go b/pkg/models/blueprint_version.go index b86dc0bf..312a5df8 100644 --- a/pkg/models/blueprint_version.go +++ b/pkg/models/blueprint_version.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -117,7 +118,6 @@ func (m *BlueprintVersion) Validate(formats strfmt.Registry) error { } func (m *BlueprintVersion) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -162,7 +162,6 @@ func (m *BlueprintVersion) validateStatusEnum(path, location string, value strin } func (m *BlueprintVersion) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -176,7 +175,6 @@ func (m *BlueprintVersion) validateStatus(formats strfmt.Registry) error { } func (m *BlueprintVersion) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -188,6 +186,237 @@ func (m *BlueprintVersion) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this blueprint version based on the context it is used +func (m *BlueprintVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBlueprintID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDescription(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSelfLink(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValid(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersion(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersionChangeLog(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersionDescription(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BlueprintVersion) contextValidateBlueprintID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "blueprintId", "body", string(m.BlueprintID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", string(m.Content)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateDescription(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "description", "body", string(m.Description)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "name", "body", string(m.Name)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateProjectName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectName", "body", string(m.ProjectName)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateSelfLink(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "selfLink", "body", string(m.SelfLink)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateValid(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "valid", "body", m.Valid); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateVersion(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "version", "body", string(m.Version)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateVersionChangeLog(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "versionChangeLog", "body", string(m.VersionChangeLog)); err != nil { + return err + } + + return nil +} + +func (m *BlueprintVersion) contextValidateVersionDescription(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "versionDescription", "body", string(m.VersionDescription)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BlueprintVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/blueprint_version_request.go b/pkg/models/blueprint_version_request.go index 0cf746c0..f5c57ea5 100644 --- a/pkg/models/blueprint_version_request.go +++ b/pkg/models/blueprint_version_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -54,6 +56,11 @@ func (m *BlueprintVersionRequest) validateVersion(formats strfmt.Registry) error return nil } +// ContextValidate validates this blueprint version request based on context it is used +func (m *BlueprintVersionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *BlueprintVersionRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item.go b/pkg/models/catalog_item.go index ac12a559..6721b9b1 100644 --- a/pkg/models/catalog_item.go +++ b/pkg/models/catalog_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -132,7 +133,6 @@ func (m *CatalogItem) Validate(formats strfmt.Registry) error { } func (m *CatalogItem) validateBulkRequestLimit(formats strfmt.Registry) error { - if swag.IsZero(m.BulkRequestLimit) { // not required return nil } @@ -149,7 +149,6 @@ func (m *CatalogItem) validateBulkRequestLimit(formats strfmt.Registry) error { } func (m *CatalogItem) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -162,7 +161,6 @@ func (m *CatalogItem) validateCreatedAt(formats strfmt.Registry) error { } func (m *CatalogItem) validateIconID(formats strfmt.Registry) error { - if swag.IsZero(m.IconID) { // not required return nil } @@ -188,7 +186,6 @@ func (m *CatalogItem) validateID(formats strfmt.Registry) error { } func (m *CatalogItem) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -219,7 +216,6 @@ func (m *CatalogItem) validateProjectIds(formats strfmt.Registry) error { } func (m *CatalogItem) validateProjects(formats strfmt.Registry) error { - if swag.IsZero(m.Projects) { // not required return nil } @@ -244,7 +240,6 @@ func (m *CatalogItem) validateProjects(formats strfmt.Registry) error { } func (m *CatalogItem) validateSourceID(formats strfmt.Registry) error { - if swag.IsZero(m.SourceID) { // not required return nil } @@ -274,6 +269,56 @@ func (m *CatalogItem) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this catalog item based on the context it is used +func (m *CatalogItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateProjects(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CatalogItem) contextValidateProjects(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Projects); i++ { + + if m.Projects[i] != nil { + if err := m.Projects[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("projects" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CatalogItem) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CatalogItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_request.go b/pkg/models/catalog_item_request.go index c82d2ccb..5d0168a5 100644 --- a/pkg/models/catalog_item_request.go +++ b/pkg/models/catalog_item_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -55,7 +57,6 @@ func (m *CatalogItemRequest) Validate(formats strfmt.Registry) error { } func (m *CatalogItemRequest) validateBulkRequestCount(formats strfmt.Registry) error { - if swag.IsZero(m.BulkRequestCount) { // not required return nil } @@ -71,6 +72,11 @@ func (m *CatalogItemRequest) validateBulkRequestCount(formats strfmt.Registry) e return nil } +// ContextValidate validates this catalog item request based on context it is used +func (m *CatalogItemRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_request_response.go b/pkg/models/catalog_item_request_response.go index c65dc578..f179648a 100644 --- a/pkg/models/catalog_item_request_response.go +++ b/pkg/models/catalog_item_request_response.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,6 +31,11 @@ func (m *CatalogItemRequestResponse) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this catalog item request response based on context it is used +func (m *CatalogItemRequestResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemRequestResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_resource_upfront_price_response.go b/pkg/models/catalog_item_resource_upfront_price_response.go index 742975bf..8a4a9f1e 100644 --- a/pkg/models/catalog_item_resource_upfront_price_response.go +++ b/pkg/models/catalog_item_resource_upfront_price_response.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -115,7 +116,6 @@ func (m *CatalogItemResourceUpfrontPriceResponse) validateStatusEnum(path, locat } func (m *CatalogItemResourceUpfrontPriceResponse) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -128,6 +128,133 @@ func (m *CatalogItemResourceUpfrontPriceResponse) validateStatus(formats strfmt. return nil } +// ContextValidate validate this catalog item resource upfront price response based on the context it is used +func (m *CatalogItemResourceUpfrontPriceResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDailyAdditionalPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyComputePrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyNetworkPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyStoragePrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyTotalPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceUpfrontPriceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUnit(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateDailyAdditionalPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyAdditionalPrice", "body", float64(m.DailyAdditionalPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateDailyComputePrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyComputePrice", "body", float64(m.DailyComputePrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateDailyNetworkPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyNetworkPrice", "body", float64(m.DailyNetworkPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateDailyStoragePrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyStoragePrice", "body", float64(m.DailyStoragePrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateDailyTotalPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyTotalPrice", "body", float64(m.DailyTotalPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateResourceUpfrontPriceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "resourceUpfrontPriceId", "body", string(m.ResourceUpfrontPriceID)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateStatusDetails(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "statusDetails", "body", string(m.StatusDetails)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemResourceUpfrontPriceResponse) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "unit", "body", string(m.Unit)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemResourceUpfrontPriceResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_type.go b/pkg/models/catalog_item_type.go index 278ace00..85f0c82d 100644 --- a/pkg/models/catalog_item_type.go +++ b/pkg/models/catalog_item_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -67,7 +69,6 @@ func (m *CatalogItemType) Validate(formats strfmt.Registry) error { } func (m *CatalogItemType) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -80,7 +81,6 @@ func (m *CatalogItemType) validateCreatedAt(formats strfmt.Registry) error { } func (m *CatalogItemType) validateIconID(formats strfmt.Registry) error { - if swag.IsZero(m.IconID) { // not required return nil } @@ -101,6 +101,11 @@ func (m *CatalogItemType) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this catalog item type based on context it is used +func (m *CatalogItemType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_upfront_price_response.go b/pkg/models/catalog_item_upfront_price_response.go index c4552dfc..5dcb775c 100644 --- a/pkg/models/catalog_item_upfront_price_response.go +++ b/pkg/models/catalog_item_upfront_price_response.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -82,7 +83,6 @@ func (m *CatalogItemUpfrontPriceResponse) Validate(formats strfmt.Registry) erro } func (m *CatalogItemUpfrontPriceResponse) validateResourcePriceDetails(formats strfmt.Registry) error { - if swag.IsZero(m.ResourcePriceDetails) { // not required return nil } @@ -154,7 +154,6 @@ func (m *CatalogItemUpfrontPriceResponse) validateStatusEnum(path, location stri } func (m *CatalogItemUpfrontPriceResponse) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -167,6 +166,155 @@ func (m *CatalogItemUpfrontPriceResponse) validateStatus(formats strfmt.Registry return nil } +// ContextValidate validate this catalog item upfront price response based on the context it is used +func (m *CatalogItemUpfrontPriceResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDailyAdditionalPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyComputePrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyNetworkPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyStoragePrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDailyTotalPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourcePriceDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUnit(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpfrontPriceID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateDailyAdditionalPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyAdditionalPrice", "body", float64(m.DailyAdditionalPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateDailyComputePrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyComputePrice", "body", float64(m.DailyComputePrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateDailyNetworkPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyNetworkPrice", "body", float64(m.DailyNetworkPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateDailyStoragePrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyStoragePrice", "body", float64(m.DailyStoragePrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateDailyTotalPrice(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dailyTotalPrice", "body", float64(m.DailyTotalPrice)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateResourcePriceDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ResourcePriceDetails); i++ { + + if m.ResourcePriceDetails[i] != nil { + if err := m.ResourcePriceDetails[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resourcePriceDetails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateStatusDetails(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "statusDetails", "body", string(m.StatusDetails)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "unit", "body", string(m.Unit)); err != nil { + return err + } + + return nil +} + +func (m *CatalogItemUpfrontPriceResponse) contextValidateUpfrontPriceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "upfrontPriceId", "body", string(m.UpfrontPriceID)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemUpfrontPriceResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_item_version.go b/pkg/models/catalog_item_version.go index c0e58525..ac559c9d 100644 --- a/pkg/models/catalog_item_version.go +++ b/pkg/models/catalog_item_version.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -51,7 +53,6 @@ func (m *CatalogItemVersion) Validate(formats strfmt.Registry) error { } func (m *CatalogItemVersion) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -63,6 +64,11 @@ func (m *CatalogItemVersion) validateCreatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validates this catalog item version based on context it is used +func (m *CatalogItemVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CatalogItemVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/catalog_source.go b/pkg/models/catalog_source.go index 299d5926..19342b57 100644 --- a/pkg/models/catalog_source.go +++ b/pkg/models/catalog_source.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -129,15 +131,14 @@ func (m *CatalogSource) Validate(formats strfmt.Registry) error { func (m *CatalogSource) validateConfig(formats strfmt.Registry) error { - if err := validate.Required("config", "body", m.Config); err != nil { - return err + if m.Config == nil { + return errors.Required("config", "body", nil) } return nil } func (m *CatalogSource) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -150,7 +151,6 @@ func (m *CatalogSource) validateCreatedAt(formats strfmt.Registry) error { } func (m *CatalogSource) validateIconID(formats strfmt.Registry) error { - if swag.IsZero(m.IconID) { // not required return nil } @@ -176,7 +176,6 @@ func (m *CatalogSource) validateID(formats strfmt.Registry) error { } func (m *CatalogSource) validateLastImportCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastImportCompletedAt) { // not required return nil } @@ -189,7 +188,6 @@ func (m *CatalogSource) validateLastImportCompletedAt(formats strfmt.Registry) e } func (m *CatalogSource) validateLastImportStartedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastImportStartedAt) { // not required return nil } @@ -202,7 +200,6 @@ func (m *CatalogSource) validateLastImportStartedAt(formats strfmt.Registry) err } func (m *CatalogSource) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -232,6 +229,11 @@ func (m *CatalogSource) validateTypeID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this catalog source based on context it is used +func (m *CatalogSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CatalogSource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/change_security_group_specification.go b/pkg/models/change_security_group_specification.go index 50d29672..9dff4be5 100644 --- a/pkg/models/change_security_group_specification.go +++ b/pkg/models/change_security_group_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,31 +25,39 @@ type ChangeSecurityGroupSpecification struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // A set of network interface controller specifications for this machine. If not specified, then no reconfiguration will be performed. NetworkInterfaceSpecifications []*NetworkInterfaceSpecification `json:"networkInterfaceSpecifications"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -76,6 +85,10 @@ func (m *ChangeSecurityGroupSpecification) Validate(formats strfmt.Registry) err func (m *ChangeSecurityGroupSpecification) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -102,7 +115,6 @@ func (m *ChangeSecurityGroupSpecification) validateID(formats strfmt.Registry) e } func (m *ChangeSecurityGroupSpecification) validateNetworkInterfaceSpecifications(formats strfmt.Registry) error { - if swag.IsZero(m.NetworkInterfaceSpecifications) { // not required return nil } @@ -126,6 +138,61 @@ func (m *ChangeSecurityGroupSpecification) validateNetworkInterfaceSpecification return nil } +// ContextValidate validate this change security group specification based on the context it is used +func (m *ChangeSecurityGroupSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworkInterfaceSpecifications(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ChangeSecurityGroupSpecification) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ChangeSecurityGroupSpecification) contextValidateNetworkInterfaceSpecifications(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NetworkInterfaceSpecifications); i++ { + + if m.NetworkInterfaceSpecifications[i] != nil { + if err := m.NetworkInterfaceSpecifications[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networkInterfaceSpecifications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ChangeSecurityGroupSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account.go b/pkg/models/cloud_account.go index 129fcf55..d97760df 100644 --- a/pkg/models/cloud_account.go +++ b/pkg/models/cloud_account.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,45 +25,58 @@ type CloudAccount struct { Links map[string]Href `json:"_links"` // Cloud account specific properties + // Example: { \"hostName\": \"vcenter.mycompany.com\" } // Required: true CloudAccountProperties map[string]string `json:"cloudAccountProperties"` // Cloud account type + // Example: vsphere, aws, azure, nsxv, nsxt // Required: true CloudAccountType *string `json:"cloudAccountType"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A set of region names to enable provisioning on. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] EnabledRegionIds []string `json:"enabledRegionIds"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -98,6 +112,10 @@ func (m *CloudAccount) Validate(formats strfmt.Registry) error { func (m *CloudAccount) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -116,6 +134,10 @@ func (m *CloudAccount) validateLinks(formats strfmt.Registry) error { func (m *CloudAccount) validateCloudAccountProperties(formats strfmt.Registry) error { + if err := validate.Required("cloudAccountProperties", "body", m.CloudAccountProperties); err != nil { + return err + } + return nil } @@ -138,7 +160,6 @@ func (m *CloudAccount) validateID(formats strfmt.Registry) error { } func (m *CloudAccount) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -162,6 +183,61 @@ func (m *CloudAccount) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account based on the context it is used +func (m *CloudAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccount) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccount) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_aws.go b/pkg/models/cloud_account_aws.go index 94448225..23b7d436 100644 --- a/pkg/models/cloud_account_aws.go +++ b/pkg/models/cloud_account_aws.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,41 +25,53 @@ type CloudAccountAws struct { Links map[string]Href `json:"_links"` // Access key id for Aws. + // Example: KLIKJ7EA4PPDZR7T7Z6K // Required: true AccessKeyID *string `json:"accessKeyId"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A set of region names that are enabled for this cloud account. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] EnabledRegionIds []string `json:"enabledRegionIds"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -90,6 +103,10 @@ func (m *CloudAccountAws) Validate(formats strfmt.Registry) error { func (m *CloudAccountAws) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -125,7 +142,6 @@ func (m *CloudAccountAws) validateID(formats strfmt.Registry) error { } func (m *CloudAccountAws) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -149,6 +165,61 @@ func (m *CloudAccountAws) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account aws based on the context it is used +func (m *CloudAccountAws) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAws) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountAws) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAws) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_aws_result.go b/pkg/models/cloud_account_aws_result.go index ca342a0e..1605a01a 100644 --- a/pkg/models/cloud_account_aws_result.go +++ b/pkg/models/cloud_account_aws_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountAwsResult State object representing a query result of Aws cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountAwsResult struct { Content []*CloudAccountAws `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountAwsResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountAwsResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountAwsResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account aws result based on the context it is used +func (m *CloudAccountAwsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAwsResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountAws(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountAwsResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountAwsResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAwsResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_aws_specification.go b/pkg/models/cloud_account_aws_specification.go index a1bd7ce0..da15fbc7 100644 --- a/pkg/models/cloud_account_aws_specification.go +++ b/pkg/models/cloud_account_aws_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,10 +21,12 @@ import ( type CloudAccountAwsSpecification struct { // Aws Access key ID + // Example: ACDC55DB4MFH6ADG75KK // Required: true AccessKeyID *string `json:"accessKeyId"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -34,14 +37,17 @@ type CloudAccountAwsSpecification struct { Name *string `json:"name"` // A set of Region names to enable provisioning on. Refer to /iaas/cloud-accounts-aws/region-enumeration.. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] // Required: true RegionIds []string `json:"regionIds"` // Aws Secret Access Key + // Example: gfsScK345sGGaVdds222dasdfDDSSasdfdsa34fS // Required: true SecretAccessKey *string `json:"secretAccessKey"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` } @@ -112,7 +118,6 @@ func (m *CloudAccountAwsSpecification) validateSecretAccessKey(formats strfmt.Re } func (m *CloudAccountAwsSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -136,6 +141,38 @@ func (m *CloudAccountAwsSpecification) validateTags(formats strfmt.Registry) err return nil } +// ContextValidate validate this cloud account aws specification based on the context it is used +func (m *CloudAccountAwsSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAwsSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAwsSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_azure.go b/pkg/models/cloud_account_azure.go index 3ed4ce42..2e47a39d 100644 --- a/pkg/models/cloud_account_azure.go +++ b/pkg/models/cloud_account_azure.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,63 @@ type CloudAccountAzure struct { Links map[string]Href `json:"_links"` // Azure Client Application IDaccount. + // Example: 66f277f2-ff12-4c3a-a4c9-b13d131a9a4d // Required: true ClientApplicationID *string `json:"clientApplicationId"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A set of region names that are enabled for this cloud account. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] EnabledRegionIds []string `json:"enabledRegionIds"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Azure Subscription IDaccount. + // Example: f3c86a85-e379-42ae-a8ba-7a51382d6dd7 // Required: true SubscriptionID *string `json:"subscriptionId"` // A set of tag keys and optional values that were set on on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Azure Tenant Idaccount. + // Example: 027f73d5-0a19-452e-9d45-775693421508 // Required: true TenantID *string `json:"tenantId"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -106,6 +121,10 @@ func (m *CloudAccountAzure) Validate(formats strfmt.Registry) error { func (m *CloudAccountAzure) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -150,7 +169,6 @@ func (m *CloudAccountAzure) validateSubscriptionID(formats strfmt.Registry) erro } func (m *CloudAccountAzure) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -183,6 +201,61 @@ func (m *CloudAccountAzure) validateTenantID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account azure based on the context it is used +func (m *CloudAccountAzure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAzure) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountAzure) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAzure) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_azure_result.go b/pkg/models/cloud_account_azure_result.go index 03fde53b..4087490b 100644 --- a/pkg/models/cloud_account_azure_result.go +++ b/pkg/models/cloud_account_azure_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountAzureResult State object representing a query result of Azure cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountAzureResult struct { Content []*CloudAccountAzure `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountAzureResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountAzureResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountAzureResult) validateContent(formats strfmt.Registry) error return nil } +// ContextValidate validate this cloud account azure result based on the context it is used +func (m *CloudAccountAzureResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAzureResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountAzure(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountAzureResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountAzureResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAzureResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_azure_specification.go b/pkg/models/cloud_account_azure_specification.go index 789480ff..2e0abb58 100644 --- a/pkg/models/cloud_account_azure_specification.go +++ b/pkg/models/cloud_account_azure_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,14 +21,17 @@ import ( type CloudAccountAzureSpecification struct { // Azure Client Application ID + // Example: 3287dd6e-76d8-41b7-9856-2584969e7739 // Required: true ClientApplicationID *string `json:"clientApplicationId"` // Azure Client Application Secret Key + // Example: GDfdasDasdASFas321das32cas2x3dsXCSA76xdcasg= // Required: true ClientApplicationSecretKey *string `json:"clientApplicationSecretKey"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -38,17 +42,21 @@ type CloudAccountAzureSpecification struct { Name *string `json:"name"` // A set of Region names to enable provisioning on. Refer to /iaas/cloud-accounts-azure/region-enumeration.. + // Example: [ \"East US\", \"North Europe\" ] // Required: true RegionIds []string `json:"regionIds"` // Azure Subscribtion ID + // Example: 064865b2-e914-4717-b415-8806d17948f7 // Required: true SubscriptionID *string `json:"subscriptionId"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Azure Tenant ID + // Example: 9a13d920-4691-4e2d-b5d5-9c4c1279bc9a // Required: true TenantID *string `json:"tenantId"` } @@ -137,7 +145,6 @@ func (m *CloudAccountAzureSpecification) validateSubscriptionID(formats strfmt.R } func (m *CloudAccountAzureSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -170,6 +177,38 @@ func (m *CloudAccountAzureSpecification) validateTenantID(formats strfmt.Registr return nil } +// ContextValidate validate this cloud account azure specification based on the context it is used +func (m *CloudAccountAzureSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountAzureSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountAzureSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_gcp.go b/pkg/models/cloud_account_gcp.go index 1e14fb1a..d31db6b7 100644 --- a/pkg/models/cloud_account_gcp.go +++ b/pkg/models/cloud_account_gcp.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,63 @@ type CloudAccountGcp struct { Links map[string]Href `json:"_links"` // GCP Client email + // Example: 321743978432-compute@developer.gserviceaccount.com // Required: true ClientEmail *string `json:"clientEmail"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A set of region names that are enabled for this + // Example: [ \"us-east1\", \"northamerica-northeast1\" ] EnabledRegionIds []string `json:"enabledRegionIds"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // GCP Private key ID + // Example: 027f73d50a19452eedf5775a9b42c5083678abdf // Required: true PrivateKeyID *string `json:"privateKeyId"` // GCP Project ID + // Example: example-gcp-project // Required: true ProjectID *string `json:"projectId"` // A set of tag keys and optional values that were set on on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -106,6 +121,10 @@ func (m *CloudAccountGcp) Validate(formats strfmt.Registry) error { func (m *CloudAccountGcp) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -159,7 +178,6 @@ func (m *CloudAccountGcp) validateProjectID(formats strfmt.Registry) error { } func (m *CloudAccountGcp) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -183,6 +201,61 @@ func (m *CloudAccountGcp) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account gcp based on the context it is used +func (m *CloudAccountGcp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountGcp) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountGcp) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountGcp) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_gcp_result.go b/pkg/models/cloud_account_gcp_result.go index 08a4c543..7331d7e3 100644 --- a/pkg/models/cloud_account_gcp_result.go +++ b/pkg/models/cloud_account_gcp_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountGcpResult State object representing a query result of GCP cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountGcpResult struct { Content []*CloudAccountGcp `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountGcpResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountGcpResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountGcpResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account gcp result based on the context it is used +func (m *CloudAccountGcpResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountGcpResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountGcp(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountGcpResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountGcpResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountGcpResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_gcp_specification.go b/pkg/models/cloud_account_gcp_specification.go index 4310c6b2..a8360723 100644 --- a/pkg/models/cloud_account_gcp_specification.go +++ b/pkg/models/cloud_account_gcp_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,10 +21,12 @@ import ( type CloudAccountGcpSpecification struct { // GCP Client email + // Example: 321743978432-compute@developer.gserviceaccount.com // Required: true ClientEmail *string `json:"clientEmail"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -34,22 +37,27 @@ type CloudAccountGcpSpecification struct { Name *string `json:"name"` // GCP Private key + // Example: -----BEGIN PRIVATE KEY-----\nMIICXgIHAASBgSDHikastc8+I81zCg/qWW8dMr8mqvXQ3qbPAmu0RjxoZVI47tvs\nkYlFAXOf0sPrhO2nUuooJngnHV0639iTTEYG1vckNaW2R6U5QTdQ5Rq5u+uV3pMk\n7w7Vs4n3urQ4jnqt7rTXbC1DNa/PFeAZatbf7ffBBy0IGO0zc128IshYcwIDAQAB\nAoGBALTNl2JxTvq4SDW/3VH0fZkQXWH1MM10oeMbB2qO5beWb11FGaOO77nGKfWc\nbYgfp5Ogrql2yhBvLAXnxH8bcqqwORtFhlyV68U1y4R+8WxDNh0aevxH8hRS/1X5\n963DJm1JlU0E+vStiktN0tC3ebH5hE+1OxbIHSZ+WOWLYX7JAkEA5uigRgKp8ScG\nauUijvdOLZIhHWq9y5Wz+nOHUuDw8P7wOTKU34QJAoWEe771p9Pf/GTA/kr0BQnP\nQvWUDxGzJwJBAN05C6krwPeryFKrKtjOGJIbiIoY72wRnoNcdEEs3HDRhf48YWFo\nriRbZylzzzNFy/gmzT6XJQTfktGqq+FZD9UCQGIJaGrxHJgfmpDuAhMzGsUsYtTr\niRox0D1Iqa7dhE693t5aBG010OF6MLqdZA1CXrn5SRtuVVaCSLZEL/2J5UcCQQDA\nd3MXucNnN4NPuS/L9HMYJWD7lPoosaORcgyK77bSSNgk+u9WSjbH1uYIAIPSffUZ\nbti+jc2dUg5wb+aeZlgJAkEAurrpmpqj5vg087ZngKfFGR5rozDiTsK5DceTV97K\na1Y+Nzl+XWTxDBWk4YPh2ZlKv402hZEfWBYxUDn5ZkH/bw==\n-----END PRIVATE KEY-----\n // Required: true PrivateKey *string `json:"privateKey"` // GCP Private key ID + // Example: 027f73d50a19452eedf5775a9b42c5083678abdf // Required: true PrivateKeyID *string `json:"privateKeyId"` // GCP Project ID + // Example: example-gcp-project // Required: true ProjectID *string `json:"projectId"` // A set of Region names to enable provisioning on. Refer to /iaas/cloud-accounts-gcp/region-enumeration. + // Example: [ \"us-east1\", \"northamerica-northeast1\" ] // Required: true RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` } @@ -146,7 +154,6 @@ func (m *CloudAccountGcpSpecification) validateRegionIds(formats strfmt.Registry } func (m *CloudAccountGcpSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -170,6 +177,38 @@ func (m *CloudAccountGcpSpecification) validateTags(formats strfmt.Registry) err return nil } +// ContextValidate validate this cloud account gcp specification based on the context it is used +func (m *CloudAccountGcpSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountGcpSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountGcpSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_t.go b/pkg/models/cloud_account_nsx_t.go index c3039e7c..fbeb4dfe 100644 --- a/pkg/models/cloud_account_nsx_t.go +++ b/pkg/models/cloud_account_nsx_t.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,47 +25,65 @@ type CloudAccountNsxT struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Identifier of a data collector vm deployed in the on premise infrastructure. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 Dcid string `json:"dcid,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // Host name for the NSX-T cloud account + // Example: nsxt.vmware.com // Required: true HostName *string `json:"hostName"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` + // Indicates whether this is an NSX-T Global Manager cloud account. NSX-T global manager cloud account can be associated with NSX-T local manager cloud accounts. It cannot be associated with vSphere cloud accounts. Default value: false. + // Example: true + IsGlobalManager bool `json:"isGlobalManager,omitempty"` + // Indicates whether NSX-T cloud account was created in Manager (legacy) mode. + // Example: true ManagerMode bool `json:"managerMode,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -101,6 +120,10 @@ func (m *CloudAccountNsxT) Validate(formats strfmt.Registry) error { func (m *CloudAccountNsxT) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -136,7 +159,6 @@ func (m *CloudAccountNsxT) validateID(formats strfmt.Registry) error { } func (m *CloudAccountNsxT) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -169,6 +191,61 @@ func (m *CloudAccountNsxT) validateUsername(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account nsx t based on the context it is used +func (m *CloudAccountNsxT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxT) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountNsxT) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxT) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_t_result.go b/pkg/models/cloud_account_nsx_t_result.go index ae880a62..ff8876b4 100644 --- a/pkg/models/cloud_account_nsx_t_result.go +++ b/pkg/models/cloud_account_nsx_t_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountNsxTResult State object representing a query result of Nsx-T cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountNsxTResult struct { Content []*CloudAccountNsxT `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountNsxTResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountNsxTResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountNsxTResult) validateContent(formats strfmt.Registry) error return nil } +// ContextValidate validate this cloud account nsx t result based on the context it is used +func (m *CloudAccountNsxTResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxTResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountNsxT(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountNsxTResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountNsxTResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxTResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_t_specification.go b/pkg/models/cloud_account_nsx_t_specification.go index 29afdba3..b5df22af 100644 --- a/pkg/models/cloud_account_nsx_t_specification.go +++ b/pkg/models/cloud_account_nsx_t_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,12 +21,16 @@ import ( type CloudAccountNsxTSpecification struct { // Accept self signed certificate when connecting. + // Example: false AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"` // vSphere cloud accounts associated with this NSX-T cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` - // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors + // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors. + // Note: Data collector endpoints are not available in vRA on-prem release and hence the data collector Id is optional for vRA on-prem. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 // Required: true Dcid *string `json:"dcid"` @@ -33,10 +38,16 @@ type CloudAccountNsxTSpecification struct { Description string `json:"description,omitempty"` // Host name for the NSX-T endpoint + // Example: nsxt.mycompany.com // Required: true HostName *string `json:"hostName"` + // Indicates whether this is an NSX-T Global Manager cloud account. NSX-T Global Manager can only be associated with NSX-T cloud accounts. Default value: false. + // Example: true + IsGlobalManager bool `json:"isGlobalManager,omitempty"` + // Create NSX-T cloud account in Manager (legacy) mode. When set to true, NSX-T cloud account in created in Manager mode. Mode cannot be changed after cloud account is created. Default value is false. + // Example: true ManagerMode bool `json:"managerMode,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -44,13 +55,16 @@ type CloudAccountNsxTSpecification struct { Name *string `json:"name"` // Password for the user used to authenticate with the cloud Account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true Password *string `json:"password"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -126,7 +140,6 @@ func (m *CloudAccountNsxTSpecification) validatePassword(formats strfmt.Registry } func (m *CloudAccountNsxTSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -159,6 +172,38 @@ func (m *CloudAccountNsxTSpecification) validateUsername(formats strfmt.Registry return nil } +// ContextValidate validate this cloud account nsx t specification based on the context it is used +func (m *CloudAccountNsxTSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxTSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxTSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_v.go b/pkg/models/cloud_account_nsx_v.go index b412f8d7..bfd68228 100644 --- a/pkg/models/cloud_account_nsx_v.go +++ b/pkg/models/cloud_account_nsx_v.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,44 +25,57 @@ type CloudAccountNsxV struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Identifier of a data collector vm deployed in the on premise infrastructure. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 Dcid string `json:"dcid,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // Host name for the Nsx-V cloud account + // Example: nsxv.vmware.com // Required: true HostName *string `json:"hostName"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -98,6 +112,10 @@ func (m *CloudAccountNsxV) Validate(formats strfmt.Registry) error { func (m *CloudAccountNsxV) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -133,7 +151,6 @@ func (m *CloudAccountNsxV) validateID(formats strfmt.Registry) error { } func (m *CloudAccountNsxV) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -166,6 +183,61 @@ func (m *CloudAccountNsxV) validateUsername(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account nsx v based on the context it is used +func (m *CloudAccountNsxV) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxV) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountNsxV) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxV) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_v_result.go b/pkg/models/cloud_account_nsx_v_result.go index ea70c591..e4477545 100644 --- a/pkg/models/cloud_account_nsx_v_result.go +++ b/pkg/models/cloud_account_nsx_v_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountNsxVResult State object representing a query result of Nsx-V cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountNsxVResult struct { Content []*CloudAccountNsxV `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountNsxVResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountNsxVResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountNsxVResult) validateContent(formats strfmt.Registry) error return nil } +// ContextValidate validate this cloud account nsx v result based on the context it is used +func (m *CloudAccountNsxVResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxVResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountNsxV(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountNsxVResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountNsxVResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxVResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_nsx_v_specification.go b/pkg/models/cloud_account_nsx_v_specification.go index 6249afcf..11f775b9 100644 --- a/pkg/models/cloud_account_nsx_v_specification.go +++ b/pkg/models/cloud_account_nsx_v_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,12 +21,16 @@ import ( type CloudAccountNsxVSpecification struct { // Accept self signed certificate when connecting. + // Example: false AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"` // vSphere cloud account associated with this NSX-V cloud account. NSX-V cloud account can be associated with a single vSphere cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` - // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors + // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors. + // Note: Data collector endpoints are not available in vRA on-prem release and hence the data collector Id is optional for vRA on-prem. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 // Required: true Dcid *string `json:"dcid"` @@ -33,6 +38,7 @@ type CloudAccountNsxVSpecification struct { Description string `json:"description,omitempty"` // Host name for the NSX-v endpoint + // Example: nsxv.mycompany.com // Required: true HostName *string `json:"hostName"` @@ -41,13 +47,16 @@ type CloudAccountNsxVSpecification struct { Name *string `json:"name"` // Password for the user used to authenticate with the cloud Account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true Password *string `json:"password"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -123,7 +132,6 @@ func (m *CloudAccountNsxVSpecification) validatePassword(formats strfmt.Registry } func (m *CloudAccountNsxVSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -156,6 +164,38 @@ func (m *CloudAccountNsxVSpecification) validateUsername(formats strfmt.Registry return nil } +// ContextValidate validate this cloud account nsx v specification based on the context it is used +func (m *CloudAccountNsxVSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountNsxVSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountNsxVSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_regions.go b/pkg/models/cloud_account_regions.go index a61723e4..2996e188 100644 --- a/pkg/models/cloud_account_regions.go +++ b/pkg/models/cloud_account_regions.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,6 +20,7 @@ import ( type CloudAccountRegions struct { // A set of region ids for the cloud account. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] // Required: true ExternalRegionIds []string `json:"externalRegionIds"` } @@ -45,6 +48,11 @@ func (m *CloudAccountRegions) validateExternalRegionIds(formats strfmt.Registry) return nil } +// ContextValidate validates this cloud account regions based on context it is used +func (m *CloudAccountRegions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountRegions) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_result.go b/pkg/models/cloud_account_result.go index 0a6898f1..31a38f3e 100644 --- a/pkg/models/cloud_account_result.go +++ b/pkg/models/cloud_account_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountResult State object representing a query result of cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountResult struct { Content []*CloudAccount `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account result based on the context it is used +func (m *CloudAccountResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccount(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_specification.go b/pkg/models/cloud_account_specification.go index 69f758ac..4cab6db0 100644 --- a/pkg/models/cloud_account_specification.go +++ b/pkg/models/cloud_account_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,20 +21,25 @@ import ( type CloudAccountSpecification struct { // Cloud accounts to associate with this cloud account + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // Cloud Account specific properties supplied in as name value pairs + // Example: {\"supportPublicImages\": \"true\", \"acceptSelfSignedCertificate\": \"true\" } // Required: true CloudAccountProperties map[string]string `json:"cloudAccountProperties"` // Cloud account type + // Example: vsphere, aws, azure, nsxv, nsxt // Required: true CloudAccountType *string `json:"cloudAccountType"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // Additional custom properties that may be used to extend the Cloud Account. + // Example: { \"sampleadapterProjectId\" : \"projectId\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. @@ -44,19 +50,23 @@ type CloudAccountSpecification struct { Name *string `json:"name"` // Secret access key or password to be used to authenticate with the cloud account + // Example: gfsScK345sGGaVdds222dasdfDDSSasdfdsa34fS // Required: true PrivateKey *string `json:"privateKey"` // Access key id or username to be used to authenticate with the cloud account + // Example: ACDC55DB4MFH6ADG75KK // Required: true PrivateKeyID *string `json:"privateKeyId"` // A set of Region names to enable provisioning on.Refer to /iaas/cloud-accounts/region-enumeration. // 'regionIds' is not required parameter for NSX-T and NSX-V cloud account types. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] // Required: true RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` } @@ -100,6 +110,10 @@ func (m *CloudAccountSpecification) Validate(formats strfmt.Registry) error { func (m *CloudAccountSpecification) validateCloudAccountProperties(formats strfmt.Registry) error { + if err := validate.Required("cloudAccountProperties", "body", m.CloudAccountProperties); err != nil { + return err + } + return nil } @@ -149,7 +163,6 @@ func (m *CloudAccountSpecification) validateRegionIds(formats strfmt.Registry) e } func (m *CloudAccountSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -173,6 +186,38 @@ func (m *CloudAccountSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this cloud account specification based on the context it is used +func (m *CloudAccountSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vcf.go b/pkg/models/cloud_account_vcf.go index 51565164..c05b0164 100644 --- a/pkg/models/cloud_account_vcf.go +++ b/pkg/models/cloud_account_vcf.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,64 +25,82 @@ type CloudAccountVcf struct { Links map[string]Href `json:"_links"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // NSX Hostname in a workload domain + // Example: nsx.mycompany.com // Required: true NsxHostName *string `json:"nsxHostName"` // Username to authenticate to NSX manager in workload domain + // Example: administrator@mycompany.com // Required: true NsxUsername *string `json:"nsxUsername"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // SDDC Manager ID + // Example: 2e5bb71d-0c14-4066-a999-2cb6c693654a // Required: true SddcManagerID *string `json:"sddcManagerId"` // A set of tag keys and optional values to set on the Cloud Account.Cloud account capability tags may enable different features. + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // vCenter Hostname in a workload domain + // Example: vcenter.mycompany.com // Required: true VcenterHostName *string `json:"vcenterHostName"` // Username to authenticate to vCenter Server in workload domain + // Example: administrator@mycompany.com // Required: true VcenterUsername *string `json:"vcenterUsername"` // Id of the VCF worload domain. + // Example: 587db412-6037-43e4-8e1e-49ebbaf6cd35 // Required: true VcfDomainID *string `json:"vcfDomainId"` // Name of the VCF worload domain. + // Example: Workload Domain - 1 // Required: true VcfDomainName *string `json:"vcfDomainName"` } @@ -138,6 +157,10 @@ func (m *CloudAccountVcf) Validate(formats strfmt.Registry) error { func (m *CloudAccountVcf) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -191,7 +214,6 @@ func (m *CloudAccountVcf) validateSddcManagerID(formats strfmt.Registry) error { } func (m *CloudAccountVcf) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -251,6 +273,61 @@ func (m *CloudAccountVcf) validateVcfDomainName(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account vcf based on the context it is used +func (m *CloudAccountVcf) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVcf) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVcf) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVcf) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vcf_result.go b/pkg/models/cloud_account_vcf_result.go index a6625d27..2ff843ca 100644 --- a/pkg/models/cloud_account_vcf_result.go +++ b/pkg/models/cloud_account_vcf_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountVcfResult State object representing a query result of VCF cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountVcfResult struct { Content []*CloudAccountVcf `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountVcfResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountVcfResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountVcfResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account vcf result based on the context it is used +func (m *CloudAccountVcfResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVcfResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountVcf(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVcfResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountVcfResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVcfResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vcf_specification.go b/pkg/models/cloud_account_vcf_specification.go index 44324de9..930f00c2 100644 --- a/pkg/models/cloud_account_vcf_specification.go +++ b/pkg/models/cloud_account_vcf_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,12 +21,16 @@ import ( type CloudAccountVcfSpecification struct { // Accept self signed certificate when connecting to vSphere and NSX-T + // Example: false AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` - // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors + // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors. + // Note: Data collector endpoints are not available in vRA on-prem release. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 DcID string `json:"dcId,omitempty"` // A human-friendly description. @@ -39,18 +44,22 @@ type CloudAccountVcfSpecification struct { NsxCertificate string `json:"nsxCertificate,omitempty"` // Host name for the NSX endpoint from the specified workload domain. + // Example: nsxt.mycompany.com // Required: true NsxHostName *string `json:"nsxHostName"` // Password for the user used to authenticate with the NSX-T manager in VCF cloud account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true NsxPassword *string `json:"nsxPassword"` // User name for the NSX manager in the specified workload domain. + // Example: administrator@mycompany.com // Required: true NsxUsername *string `json:"nsxUsername"` // A set of Region names to enable provisioning on.Refer to /iaas/cloud-accounts/region-enumeration. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] // Required: true RegionIds []string `json:"regionIds"` @@ -58,20 +67,24 @@ type CloudAccountVcfSpecification struct { SddcManagerID string `json:"sddcManagerId,omitempty"` // A set of tag keys and optional values to set on the Cloud Account.Cloud account capability tags may enable different features. + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // vCenter Certificate VcenterCertificate string `json:"vcenterCertificate,omitempty"` // Host name for the vSphere from the specified workload domain. + // Example: vc.mycompany.com // Required: true VcenterHostName *string `json:"vcenterHostName"` // Password for the user used to authenticate with the vCenter in VCF cloud account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true VcenterPassword *string `json:"vcenterPassword"` // vCenter user name for the specified workload domain.The specified user requires CloudAdmin credentials. The user does not require CloudGlobalAdmin credentials. + // Example: administrator@mycompany.com // Required: true VcenterUsername *string `json:"vcenterUsername"` @@ -80,6 +93,7 @@ type CloudAccountVcfSpecification struct { WorkloadDomainID *string `json:"workloadDomainId"` // Name of the workload domain to add as VCF cloud account. + // Example: Management // Required: true WorkloadDomainName *string `json:"workloadDomainName"` } @@ -184,7 +198,6 @@ func (m *CloudAccountVcfSpecification) validateRegionIds(formats strfmt.Registry } func (m *CloudAccountVcfSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -253,6 +266,38 @@ func (m *CloudAccountVcfSpecification) validateWorkloadDomainName(formats strfmt return nil } +// ContextValidate validate this cloud account vcf specification based on the context it is used +func (m *CloudAccountVcfSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVcfSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVcfSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vmc.go b/pkg/models/cloud_account_vmc.go index d600e6f3..bcf6393d 100644 --- a/pkg/models/cloud_account_vmc.go +++ b/pkg/models/cloud_account_vmc.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,31 +25,40 @@ type CloudAccountVmc struct { Links map[string]Href `json:"_links"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // SDDC environment. @@ -56,12 +66,15 @@ type CloudAccountVmc struct { Sddc *string `json:"sddc"` // A set of tag keys and optional values to set on the Cloud Account.Cloud account capability tags may enable different features. + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // Username to authenticate to vCenter + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -98,6 +111,10 @@ func (m *CloudAccountVmc) Validate(formats strfmt.Registry) error { func (m *CloudAccountVmc) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -133,7 +150,6 @@ func (m *CloudAccountVmc) validateSddc(formats strfmt.Registry) error { } func (m *CloudAccountVmc) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -166,6 +182,61 @@ func (m *CloudAccountVmc) validateUsername(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account vmc based on the context it is used +func (m *CloudAccountVmc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVmc) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVmc) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVmc) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vmc_result.go b/pkg/models/cloud_account_vmc_result.go index 5d4529b6..cb57b22f 100644 --- a/pkg/models/cloud_account_vmc_result.go +++ b/pkg/models/cloud_account_vmc_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountVmcResult State object representing a query result of Vmc cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountVmcResult struct { Content []*CloudAccountVmc `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountVmcResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountVmcResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountVmcResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account vmc result based on the context it is used +func (m *CloudAccountVmcResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVmcResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountVmc(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVmcResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountVmcResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVmcResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vmc_specification.go b/pkg/models/cloud_account_vmc_specification.go index 2c95829d..db886454 100644 --- a/pkg/models/cloud_account_vmc_specification.go +++ b/pkg/models/cloud_account_vmc_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,24 +21,29 @@ import ( type CloudAccountVmcSpecification struct { // Accept self signed certificate when connecting to vSphere + // Example: false AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"` // VMC API access key APIKey string `json:"apiKey,omitempty"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // The host name of the CSP service. + // Example: console-stg.cloud.vmware.com CspHostName string `json:"cspHostName,omitempty"` // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 DcID string `json:"dcId,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // Enter the IP address or FQDN of the vCenter Server in the specified SDDC. The cloud proxy belongs on this vCenter. + // Example: vc1.vmware.com // Required: true HostName *string `json:"hostName"` @@ -46,24 +52,30 @@ type CloudAccountVmcSpecification struct { Name *string `json:"name"` // The IP address of the NSX Manager server in the specified SDDC / FQDN. + // Example: nsxManager.sddc-52-12-8-145.vmwaretest.com // Required: true NsxHostName *string `json:"nsxHostName"` // Password for the user used to authenticate with the cloud Account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true Password *string `json:"password"` // A set of Region names to enable provisioning on.Refer to /iaas/cloud-accounts/region-enumeration. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] // Required: true RegionIds []string `json:"regionIds"` // Identifier of the on-premise SDDC to be used by this cloud account. Note that NSX-V SDDCs are not supported. + // Example: CMBU-PRD-NSXT-M8GA-090319 SddcID string `json:"sddcId,omitempty"` // A set of tag keys and optional values to set on the Cloud Account.Cloud account capability tags may enable different features. + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // vCenter user name for the specified SDDC.The specified user requires CloudAdmin credentials. The user does not require CloudGlobalAdmin credentials. + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -152,7 +164,6 @@ func (m *CloudAccountVmcSpecification) validateRegionIds(formats strfmt.Registry } func (m *CloudAccountVmcSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -185,6 +196,38 @@ func (m *CloudAccountVmcSpecification) validateUsername(formats strfmt.Registry) return nil } +// ContextValidate validate this cloud account vmc specification based on the context it is used +func (m *CloudAccountVmcSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVmcSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVmcSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vsphere.go b/pkg/models/cloud_account_vsphere.go index c31e8abb..330759bf 100644 --- a/pkg/models/cloud_account_vsphere.go +++ b/pkg/models/cloud_account_vsphere.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,47 +25,61 @@ type CloudAccountVsphere struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"isExternal\" : \"false\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Identifier of a data collector vm deployed in the on premise infrastructure. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 Dcid string `json:"dcid,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A set of region names that are enabled for this cloud account. + // Example: [ \"us-east-1\", \"ap-northeast-1\" ] EnabledRegionIds []string `json:"enabledRegionIds"` // Host name for the vSphere cloud account + // Example: vc1.vmware.com // Required: true HostName *string `json:"hostName"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -101,6 +116,10 @@ func (m *CloudAccountVsphere) Validate(formats strfmt.Registry) error { func (m *CloudAccountVsphere) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -136,7 +155,6 @@ func (m *CloudAccountVsphere) validateID(formats strfmt.Registry) error { } func (m *CloudAccountVsphere) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -169,6 +187,61 @@ func (m *CloudAccountVsphere) validateUsername(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud account vsphere based on the context it is used +func (m *CloudAccountVsphere) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVsphere) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVsphere) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVsphere) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vsphere_result.go b/pkg/models/cloud_account_vsphere_result.go index a5b4f544..ddc085db 100644 --- a/pkg/models/cloud_account_vsphere_result.go +++ b/pkg/models/cloud_account_vsphere_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudAccountVsphereResult State object representing a query result of vSphere cloud accounts. @@ -23,10 +25,12 @@ type CloudAccountVsphereResult struct { Content []*CloudAccountVsphere `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *CloudAccountVsphereResult) Validate(formats strfmt.Registry) error { } func (m *CloudAccountVsphereResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *CloudAccountVsphereResult) validateContent(formats strfmt.Registry) err return nil } +// ContextValidate validate this cloud account vsphere result based on the context it is used +func (m *CloudAccountVsphereResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVsphereResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*CloudAccountVsphere(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudAccountVsphereResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *CloudAccountVsphereResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVsphereResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/cloud_account_vsphere_specification.go b/pkg/models/cloud_account_vsphere_specification.go index 9c772f94..bdf5bb14 100644 --- a/pkg/models/cloud_account_vsphere_specification.go +++ b/pkg/models/cloud_account_vsphere_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,21 +21,27 @@ import ( type CloudAccountVsphereSpecification struct { // Accept self signed certificate when connecting to vSphere + // Example: false AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"` // NSX-V or NSX-T account to associate with this vSphere cloud account. vSphere cloud account can be a single NSX-V cloud account or a single NSX-T cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` - // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors + // Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors. + // Note: Data collector endpoints are not available in vRA on-prem release. + // Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4 Dcid string `json:"dcid,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // Host name for the vSphere endpoint + // Example: vc.mycompany.com // Required: true HostName *string `json:"hostName"` @@ -43,17 +50,21 @@ type CloudAccountVsphereSpecification struct { Name *string `json:"name"` // Password for the user used to authenticate with the cloud Account + // Example: cndhjslacd90ascdbasyoucbdh // Required: true Password *string `json:"password"` // A set of datacenter managed object reference identifiers (MoRef) to enable provisioning on. Refer to /iaas/cloud-accounts-vsphere/region-enumeration. + // Example: [ \"Datacenter:datacenter-2\" ] // Required: true RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` // Username to authenticate with the cloud account + // Example: administrator@mycompany.com // Required: true Username *string `json:"username"` } @@ -129,7 +140,6 @@ func (m *CloudAccountVsphereSpecification) validateRegionIds(formats strfmt.Regi } func (m *CloudAccountVsphereSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -162,6 +172,38 @@ func (m *CloudAccountVsphereSpecification) validateUsername(formats strfmt.Regis return nil } +// ContextValidate validate this cloud account vsphere specification based on the context it is used +func (m *CloudAccountVsphereSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudAccountVsphereSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudAccountVsphereSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/commit_details.go b/pkg/models/commit_details.go index b1ae2500..68c769f8 100644 --- a/pkg/models/commit_details.go +++ b/pkg/models/commit_details.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -52,7 +54,6 @@ func (m *CommitDetails) Validate(formats strfmt.Registry) error { } func (m *CommitDetails) validateCommittedDate(formats strfmt.Registry) error { - if swag.IsZero(m.CommittedDate) { // not required return nil } @@ -64,6 +65,11 @@ func (m *CommitDetails) validateCommittedDate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this commit details based on context it is used +func (m *CommitDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CommitDetails) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/compute_gateway.go b/pkg/models/compute_gateway.go index 2d1df1e0..807f7170 100644 --- a/pkg/models/compute_gateway.go +++ b/pkg/models/compute_gateway.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,37 +25,47 @@ type ComputeGateway struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // A list of NAT rule(s) to be created on the NSX network @@ -66,21 +77,27 @@ type ComputeGateway struct { Networks []string `json:"networks"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -128,6 +145,10 @@ func (m *ComputeGateway) Validate(formats strfmt.Registry) error { func (m *ComputeGateway) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -145,7 +166,6 @@ func (m *ComputeGateway) validateLinks(formats strfmt.Registry) error { } func (m *ComputeGateway) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -219,7 +239,6 @@ func (m *ComputeGateway) validateNetworks(formats strfmt.Registry) error { } func (m *ComputeGateway) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -243,6 +262,83 @@ func (m *ComputeGateway) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this compute gateway based on the context it is used +func (m *ComputeGateway) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeGateway) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ComputeGateway) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeGateway) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ComputeGateway) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/compute_gateway_result.go b/pkg/models/compute_gateway_result.go index 7f469bc9..1e25368f 100644 --- a/pkg/models/compute_gateway_result.go +++ b/pkg/models/compute_gateway_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ComputeGatewayResult State object representing a query result of compute-gateways. @@ -23,10 +25,12 @@ type ComputeGatewayResult struct { Content []*ComputeGateway `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ComputeGatewayResult) Validate(formats strfmt.Registry) error { } func (m *ComputeGatewayResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ComputeGatewayResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this compute gateway result based on the context it is used +func (m *ComputeGatewayResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeGatewayResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*ComputeGateway(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeGatewayResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ComputeGatewayResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ComputeGatewayResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/compute_gateway_specification.go b/pkg/models/compute_gateway_specification.go index 820ce032..3df5a599 100644 --- a/pkg/models/compute_gateway_specification.go +++ b/pkg/models/compute_gateway_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,10 +20,11 @@ import ( // swagger:model ComputeGatewaySpecification type ComputeGatewaySpecification struct { - // Additional custom properties that may be used to extend the compute gateway. + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -38,6 +40,7 @@ type ComputeGatewaySpecification struct { Networks []string `json:"networks"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` } @@ -120,6 +123,38 @@ func (m *ComputeGatewaySpecification) validateProjectID(formats strfmt.Registry) return nil } +// ContextValidate validate this compute gateway specification based on the context it is used +func (m *ComputeGatewaySpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeGatewaySpecification) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ComputeGatewaySpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/compute_nat.go b/pkg/models/compute_nat.go new file mode 100644 index 00000000..48e878c8 --- /dev/null +++ b/pkg/models/compute_nat.go @@ -0,0 +1,358 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ComputeNat The compute nat object is used to configure NAT rules on the Edge Gateway or Tier-1 logical router in NSX to enable port forwarding.
**HATEOAS** links:
**self** - Nat - Self link to this nat +// +// swagger:model ComputeNat +type ComputeNat struct { + + // HATEOAS of the entity + // Required: true + Links map[string]Href `json:"_links"` + + // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] + // Unique: true + CloudAccountIds []string `json:"cloudAccountIds"` + + // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 + CreatedAt string `json:"createdAt,omitempty"` + + // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } + CustomProperties map[string]string `json:"customProperties,omitempty"` + + // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 + DeploymentID string `json:"deploymentId,omitempty"` + + // A human-friendly description. + // Example: my-description + Description string `json:"description,omitempty"` + + // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 + ExternalID string `json:"externalId,omitempty"` + + // The external regionId of the resource. + // Example: us-east-1 + // Required: true + ExternalRegionID *string `json:"externalRegionId"` + + // The external zoneId of the resource. + // Example: us-east-1a + // Required: true + ExternalZoneID *string `json:"externalZoneId"` + + // The compute gateway to which the compute nat is attached + // Required: true + Gateway *string `json:"gateway"` + + // The id of this resource instance + // Example: 9e49 + // Required: true + ID *string `json:"id"` + + // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name + Name string `json:"name,omitempty"` + + // A list of NAT rule(s) to be created on the NSX network + // Required: true + NatRules []*NatRule `json:"natRules"` + + // The id of the organization this entity belongs to. + // Example: 9e49 + OrgID string `json:"orgId,omitempty"` + + // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated + OrganizationID string `json:"organizationId,omitempty"` + + // Email of the user that owns the entity. + // Example: csp@vmware.com + Owner string `json:"owner,omitempty"` + + // The id of the project this resource belongs to. + // Example: 9e49 + ProjectID string `json:"projectId,omitempty"` + + // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] + Tags []*Tag `json:"tags"` + + // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 + UpdatedAt string `json:"updatedAt,omitempty"` +} + +// Validate validates this compute nat +func (m *ComputeNat) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudAccountIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalRegionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalZoneID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGateway(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatRules(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNat) validateLinks(formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { + return err + } + if val, ok := m.Links[k]; ok { + if err := val.Validate(formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ComputeNat) validateCloudAccountIds(formats strfmt.Registry) error { + if swag.IsZero(m.CloudAccountIds) { // not required + return nil + } + + if err := validate.UniqueItems("cloudAccountIds", "body", m.CloudAccountIds); err != nil { + return err + } + + return nil +} + +func (m *ComputeNat) validateExternalRegionID(formats strfmt.Registry) error { + + if err := validate.Required("externalRegionId", "body", m.ExternalRegionID); err != nil { + return err + } + + return nil +} + +func (m *ComputeNat) validateExternalZoneID(formats strfmt.Registry) error { + + if err := validate.Required("externalZoneId", "body", m.ExternalZoneID); err != nil { + return err + } + + return nil +} + +func (m *ComputeNat) validateGateway(formats strfmt.Registry) error { + + if err := validate.Required("gateway", "body", m.Gateway); err != nil { + return err + } + + return nil +} + +func (m *ComputeNat) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ComputeNat) validateNatRules(formats strfmt.Registry) error { + + if err := validate.Required("natRules", "body", m.NatRules); err != nil { + return err + } + + for i := 0; i < len(m.NatRules); i++ { + if swag.IsZero(m.NatRules[i]) { // not required + continue + } + + if m.NatRules[i] != nil { + if err := m.NatRules[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeNat) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this compute nat based on the context it is used +func (m *ComputeNat) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNat) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ComputeNat) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeNat) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ComputeNat) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ComputeNat) UnmarshalBinary(b []byte) error { + var res ComputeNat + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/compute_nat_result.go b/pkg/models/compute_nat_result.go new file mode 100644 index 00000000..bbc73752 --- /dev/null +++ b/pkg/models/compute_nat_result.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ComputeNatResult State object representing a query result of compute-nats. +// +// swagger:model ComputeNatResult +type ComputeNatResult struct { + + // List of content items + // Read Only: true + Content []*ComputeNat `json:"content"` + + // Number of elements in the current page + // Example: 1 + // Read Only: true + NumberOfElements int64 `json:"numberOfElements,omitempty"` + + // Total number of elements. In some cases the field may not be populated + // Example: 1 + // Read Only: true + TotalElements int64 `json:"totalElements,omitempty"` +} + +// Validate validates this compute nat result +func (m *ComputeNatResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNatResult) validateContent(formats strfmt.Registry) error { + if swag.IsZero(m.Content) { // not required + return nil + } + + for i := 0; i < len(m.Content); i++ { + if swag.IsZero(m.Content[i]) { // not required + continue + } + + if m.Content[i] != nil { + if err := m.Content[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this compute nat result based on the context it is used +func (m *ComputeNatResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNatResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*ComputeNat(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeNatResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ComputeNatResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ComputeNatResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ComputeNatResult) UnmarshalBinary(b []byte) error { + var res ComputeNatResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/compute_nat_specification.go b/pkg/models/compute_nat_specification.go new file mode 100644 index 00000000..8470c41d --- /dev/null +++ b/pkg/models/compute_nat_specification.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ComputeNatSpecification compute nat specification +// +// swagger:model ComputeNatSpecification +type ComputeNatSpecification struct { + + // Additional custom properties that may be used to extend this resource. + CustomProperties map[string]string `json:"customProperties,omitempty"` + + // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 + DeploymentID string `json:"deploymentId,omitempty"` + + // Id of the Compute Gateway to which the Compute Nat resource will be attached + // Required: true + Gateway *string `json:"gateway"` + + // A human-friendly name used as an identifier in APIs that support this option. + // Required: true + Name *string `json:"name"` + + // List of NAT Rules + // Required: true + NatRules []*NatRule `json:"natRules"` + + // The id of the project the current user belongs to. + // Example: e058 + // Required: true + ProjectID *string `json:"projectId"` +} + +// Validate validates this compute nat specification +func (m *ComputeNatSpecification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGateway(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatRules(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProjectID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNatSpecification) validateGateway(formats strfmt.Registry) error { + + if err := validate.Required("gateway", "body", m.Gateway); err != nil { + return err + } + + return nil +} + +func (m *ComputeNatSpecification) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ComputeNatSpecification) validateNatRules(formats strfmt.Registry) error { + + if err := validate.Required("natRules", "body", m.NatRules); err != nil { + return err + } + + for i := 0; i < len(m.NatRules); i++ { + if swag.IsZero(m.NatRules[i]) { // not required + continue + } + + if m.NatRules[i] != nil { + if err := m.NatRules[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ComputeNatSpecification) validateProjectID(formats strfmt.Registry) error { + + if err := validate.Required("projectId", "body", m.ProjectID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this compute nat specification based on the context it is used +func (m *ComputeNatSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComputeNatSpecification) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ComputeNatSpecification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ComputeNatSpecification) UnmarshalBinary(b []byte) error { + var res ComputeNatSpecification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/constraint.go b/pkg/models/constraint.go index cd978c01..463c7655 100644 --- a/pkg/models/constraint.go +++ b/pkg/models/constraint.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -19,6 +21,7 @@ type Constraint struct { // An expression of the form "[!]tag-key[:[tag-value]]", used to indicate a constraint match on keys and values of tags. // + // Example: ha:strong // Required: true Expression *string `json:"expression"` @@ -63,6 +66,11 @@ func (m *Constraint) validateMandatory(formats strfmt.Registry) error { return nil } +// ContextValidate validates this constraint based on context it is used +func (m *Constraint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Constraint) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/content_about.go b/pkg/models/content_about.go index 0967643e..f01fcc25 100644 --- a/pkg/models/content_about.go +++ b/pkg/models/content_about.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ContentAbout ContentAbout @@ -42,7 +44,6 @@ func (m *ContentAbout) Validate(formats strfmt.Registry) error { } func (m *ContentAbout) validateSupportedApis(formats strfmt.Registry) error { - if swag.IsZero(m.SupportedApis) { // not required return nil } @@ -66,6 +67,55 @@ func (m *ContentAbout) validateSupportedApis(formats strfmt.Registry) error { return nil } +// ContextValidate validate this content about based on the context it is used +func (m *ContentAbout) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLatestAPIVersion(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupportedApis(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContentAbout) contextValidateLatestAPIVersion(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "latestApiVersion", "body", string(m.LatestAPIVersion)); err != nil { + return err + } + + return nil +} + +func (m *ContentAbout) contextValidateSupportedApis(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "supportedApis", "body", []*SupportedAPI(m.SupportedApis)); err != nil { + return err + } + + for i := 0; i < len(m.SupportedApis); i++ { + + if m.SupportedApis[i] != nil { + if err := m.SupportedApis[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("supportedApis" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ContentAbout) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/content_definition.go b/pkg/models/content_definition.go index eb4a6f0f..5d5329ba 100644 --- a/pkg/models/content_definition.go +++ b/pkg/models/content_definition.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -71,7 +73,6 @@ func (m *ContentDefinition) Validate(formats strfmt.Registry) error { } func (m *ContentDefinition) validateIconID(formats strfmt.Registry) error { - if swag.IsZero(m.IconID) { // not required return nil } @@ -105,6 +106,11 @@ func (m *ContentDefinition) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this content definition based on context it is used +func (m *ContentDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ContentDefinition) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/content_source.go b/pkg/models/content_source.go index c1528e35..a507bc1f 100644 --- a/pkg/models/content_source.go +++ b/pkg/models/content_source.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -20,6 +21,7 @@ import ( type ContentSource struct { // Source custom configuration + // Example: {"branch":"string","contentType":"string","endpointId":"string","integrationId":"string","path":"string","repository":"string"} Config interface{} `json:"config,omitempty"` // Creation time @@ -61,6 +63,7 @@ type ContentSource struct { ProjectID *string `json:"projectId"` // Is Sync Enabled + // Example: false SyncEnabled bool `json:"syncEnabled,omitempty"` // Content Source type @@ -104,7 +107,6 @@ func (m *ContentSource) Validate(formats strfmt.Registry) error { } func (m *ContentSource) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -130,7 +132,6 @@ func (m *ContentSource) validateID(formats strfmt.Registry) error { } func (m *ContentSource) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -174,17 +175,17 @@ func init() { const ( - // ContentSourceTypeIDComGithub captures enum value "com.github" - ContentSourceTypeIDComGithub string = "com.github" + // ContentSourceTypeIDComDotGithub captures enum value "com.github" + ContentSourceTypeIDComDotGithub string = "com.github" - // ContentSourceTypeIDComGitlab captures enum value "com.gitlab" - ContentSourceTypeIDComGitlab string = "com.gitlab" + // ContentSourceTypeIDComDotGitlab captures enum value "com.gitlab" + ContentSourceTypeIDComDotGitlab string = "com.gitlab" - // ContentSourceTypeIDOrgBitbucket captures enum value "org.bitbucket" - ContentSourceTypeIDOrgBitbucket string = "org.bitbucket" + // ContentSourceTypeIDOrgDotBitbucket captures enum value "org.bitbucket" + ContentSourceTypeIDOrgDotBitbucket string = "org.bitbucket" - // ContentSourceTypeIDComVmwareMarketplace captures enum value "com.vmware.marketplace" - ContentSourceTypeIDComVmwareMarketplace string = "com.vmware.marketplace" + // ContentSourceTypeIDComDotVmwareDotMarketplace captures enum value "com.vmware.marketplace" + ContentSourceTypeIDComDotVmwareDotMarketplace string = "com.vmware.marketplace" ) // prop value enum @@ -209,6 +210,81 @@ func (m *ContentSource) validateTypeID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this content source based on the context it is used +func (m *ContentSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContentSource) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ContentSource) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *ContentSource) contextValidateLastUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastUpdatedAt", "body", strfmt.DateTime(m.LastUpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ContentSource) contextValidateLastUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastUpdatedBy", "body", string(m.LastUpdatedBy)); err != nil { + return err + } + + return nil +} + +func (m *ContentSource) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ContentSource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/content_sources.go b/pkg/models/content_sources.go index 959b867e..ac476286 100644 --- a/pkg/models/content_sources.go +++ b/pkg/models/content_sources.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *ContentSources) Validate(formats strfmt.Registry) error { } func (m *ContentSources) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *ContentSources) validateContent(formats strfmt.Registry) error { } func (m *ContentSources) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *ContentSources) validateLinks(formats strfmt.Registry) error { } func (m *ContentSources) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *ContentSources) validatePage(formats strfmt.Registry) error { return nil } +// ContextValidate validate this content sources based on the context it is used +func (m *ContentSources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContentSources) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContentSources) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContentSources) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ContentSources) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/criteria.go b/pkg/models/criteria.go index 33e0c0a2..f6a5ab80 100644 --- a/pkg/models/criteria.go +++ b/pkg/models/criteria.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *Criteria) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this criteria based on context it is used +func (m *Criteria) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Criteria) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/csp_login_specification.go b/pkg/models/csp_login_specification.go index a931c41a..7da02574 100644 --- a/pkg/models/csp_login_specification.go +++ b/pkg/models/csp_login_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,6 +20,7 @@ import ( type CspLoginSpecification struct { // Refresh token obtained from the UI + // Example: 5e7c2c-9a9e-4b0-9339-a7f94 // Required: true RefreshToken *string `json:"refreshToken"` } @@ -45,6 +48,11 @@ func (m *CspLoginSpecification) validateRefreshToken(formats strfmt.Registry) er return nil } +// ContextValidate validates this csp login specification based on context it is used +func (m *CspLoginSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CspLoginSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/custom_properties.go b/pkg/models/custom_properties.go index 0f8ea86d..80525d70 100644 --- a/pkg/models/custom_properties.go +++ b/pkg/models/custom_properties.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -39,6 +41,11 @@ func (m *CustomProperties) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this custom properties based on context it is used +func (m *CustomProperties) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CustomProperties) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/data_collector.go b/pkg/models/data_collector.go index 9a96c62f..823e1f93 100644 --- a/pkg/models/data_collector.go +++ b/pkg/models/data_collector.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,22 +20,27 @@ import ( type DataCollector struct { // Data collector identifier + // Example: d5316b00-f3b8-4895-9e9a-c4b98649c2ca // Required: true DcID *string `json:"dcId"` // Data collector host name + // Example: dc1-lnd.mycompany.com // Required: true HostName *string `json:"hostName"` // Ip Address of the data collector VM + // Example: 10.0.0.1 // Required: true IPAddress *string `json:"ipAddress"` // Data collector name + // Example: Datacollector1 // Required: true Name *string `json:"name"` // Current status of the data collector + // Example: ACTIVE, INACTIVE // Required: true Status *string `json:"status"` } @@ -113,6 +120,11 @@ func (m *DataCollector) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this data collector based on context it is used +func (m *DataCollector) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DataCollector) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/data_collector_registration.go b/pkg/models/data_collector_registration.go index 5b4f2113..4842bcec 100644 --- a/pkg/models/data_collector_registration.go +++ b/pkg/models/data_collector_registration.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,10 +20,12 @@ import ( type DataCollectorRegistration struct { // A registration key for the data collector + // Example: eyJyZWdpc3RyYXRpb25VcmwiOiJodHRwczovL2Fw // Required: true Key *string `json:"key"` // Data collector OVA Link + // Example: https://ci-data-collector.s3.amazonaws.com/VMware-Cloud-Services-Data-Collector.ova // Required: true OvaLink *string `json:"ovaLink"` } @@ -62,6 +66,11 @@ func (m *DataCollectorRegistration) validateOvaLink(formats strfmt.Registry) err return nil } +// ContextValidate validates this data collector registration based on context it is used +func (m *DataCollectorRegistration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DataCollectorRegistration) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/data_collector_result.go b/pkg/models/data_collector_result.go index 736aeaec..079a033b 100644 --- a/pkg/models/data_collector_result.go +++ b/pkg/models/data_collector_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // DataCollectorResult State object representing a query result of data collectors. @@ -23,10 +25,12 @@ type DataCollectorResult struct { Content []*DataCollector `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *DataCollectorResult) Validate(formats strfmt.Registry) error { } func (m *DataCollectorResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *DataCollectorResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this data collector result based on the context it is used +func (m *DataCollectorResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCollectorResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*DataCollector(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DataCollectorResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *DataCollectorResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *DataCollectorResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/data_element.go b/pkg/models/data_element.go index 856459b9..6e1fa0d8 100644 --- a/pkg/models/data_element.go +++ b/pkg/models/data_element.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -36,6 +38,11 @@ func (m *DataElement) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this data element based on context it is used +func (m *DataElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DataElement) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment.go b/pkg/models/deployment.go index 300173bd..1844c1f5 100644 --- a/pkg/models/deployment.go +++ b/pkg/models/deployment.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -163,7 +164,6 @@ func (m *Deployment) Validate(formats strfmt.Registry) error { } func (m *Deployment) validateBlueprint(formats strfmt.Registry) error { - if swag.IsZero(m.Blueprint) { // not required return nil } @@ -181,7 +181,6 @@ func (m *Deployment) validateBlueprint(formats strfmt.Registry) error { } func (m *Deployment) validateCatalog(formats strfmt.Registry) error { - if swag.IsZero(m.Catalog) { // not required return nil } @@ -199,7 +198,6 @@ func (m *Deployment) validateCatalog(formats strfmt.Registry) error { } func (m *Deployment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -212,7 +210,6 @@ func (m *Deployment) validateCreatedAt(formats strfmt.Registry) error { } func (m *Deployment) validateExpense(formats strfmt.Registry) error { - if swag.IsZero(m.Expense) { // not required return nil } @@ -230,7 +227,6 @@ func (m *Deployment) validateExpense(formats strfmt.Registry) error { } func (m *Deployment) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -243,7 +239,6 @@ func (m *Deployment) validateID(formats strfmt.Registry) error { } func (m *Deployment) validateLastRequest(formats strfmt.Registry) error { - if swag.IsZero(m.LastRequest) { // not required return nil } @@ -261,7 +256,6 @@ func (m *Deployment) validateLastRequest(formats strfmt.Registry) error { } func (m *Deployment) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -274,7 +268,6 @@ func (m *Deployment) validateLastUpdatedAt(formats strfmt.Registry) error { } func (m *Deployment) validateLeaseExpireAt(formats strfmt.Registry) error { - if swag.IsZero(m.LeaseExpireAt) { // not required return nil } @@ -296,7 +289,6 @@ func (m *Deployment) validateName(formats strfmt.Registry) error { } func (m *Deployment) validateProject(formats strfmt.Registry) error { - if swag.IsZero(m.Project) { // not required return nil } @@ -314,7 +306,6 @@ func (m *Deployment) validateProject(formats strfmt.Registry) error { } func (m *Deployment) validateResources(formats strfmt.Registry) error { - if swag.IsZero(m.Resources) { // not required return nil } @@ -398,7 +389,6 @@ func (m *Deployment) validateStatusEnum(path, location string, value string) err } func (m *Deployment) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -411,6 +401,128 @@ func (m *Deployment) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this deployment based on the context it is used +func (m *Deployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBlueprint(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCatalog(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastRequest(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProject(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Deployment) contextValidateBlueprint(ctx context.Context, formats strfmt.Registry) error { + + if m.Blueprint != nil { + if err := m.Blueprint.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("blueprint") + } + return err + } + } + + return nil +} + +func (m *Deployment) contextValidateCatalog(ctx context.Context, formats strfmt.Registry) error { + + if m.Catalog != nil { + if err := m.Catalog.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("catalog") + } + return err + } + } + + return nil +} + +func (m *Deployment) contextValidateExpense(ctx context.Context, formats strfmt.Registry) error { + + if m.Expense != nil { + if err := m.Expense.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("expense") + } + return err + } + } + + return nil +} + +func (m *Deployment) contextValidateLastRequest(ctx context.Context, formats strfmt.Registry) error { + + if m.LastRequest != nil { + if err := m.LastRequest.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lastRequest") + } + return err + } + } + + return nil +} + +func (m *Deployment) contextValidateProject(ctx context.Context, formats strfmt.Registry) error { + + if m.Project != nil { + if err := m.Project.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("project") + } + return err + } + } + + return nil +} + +func (m *Deployment) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Deployment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_expense_history.go b/pkg/models/deployment_expense_history.go index 2fd92fe3..ee95aa9e 100644 --- a/pkg/models/deployment_expense_history.go +++ b/pkg/models/deployment_expense_history.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -55,7 +56,6 @@ func (m *DeploymentExpenseHistory) Validate(formats strfmt.Registry) error { } func (m *DeploymentExpenseHistory) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -112,7 +112,6 @@ func (m *DeploymentExpenseHistory) validateIntervalEnum(path, location string, v } func (m *DeploymentExpenseHistory) validateInterval(formats strfmt.Registry) error { - if swag.IsZero(m.Interval) { // not required return nil } @@ -125,6 +124,68 @@ func (m *DeploymentExpenseHistory) validateInterval(formats strfmt.Registry) err return nil } +// ContextValidate validate this deployment expense history based on the context it is used +func (m *DeploymentExpenseHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterval(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentExpenseHistory) contextValidateCurrency(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "currency", "body", string(m.Currency)); err != nil { + return err + } + + return nil +} + +func (m *DeploymentExpenseHistory) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "data", "body", []*TimeSeriesValue(m.Data)); err != nil { + return err + } + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeploymentExpenseHistory) contextValidateInterval(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "interval", "body", string(m.Interval)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *DeploymentExpenseHistory) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_filter.go b/pkg/models/deployment_filter.go index ca3f7bc1..6fdad4d7 100644 --- a/pkg/models/deployment_filter.go +++ b/pkg/models/deployment_filter.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -84,7 +85,6 @@ func (m *DeploymentFilter) Validate(formats strfmt.Registry) error { } func (m *DeploymentFilter) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -109,7 +109,6 @@ func (m *DeploymentFilter) validateContent(formats strfmt.Registry) error { } func (m *DeploymentFilter) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -156,7 +155,6 @@ func (m *DeploymentFilter) validateTypeEnum(path, location string, value string) } func (m *DeploymentFilter) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -169,6 +167,56 @@ func (m *DeploymentFilter) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this deployment filter based on the context it is used +func (m *DeploymentFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentFilter) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeploymentFilter) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DeploymentFilter) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_filter_schema.go b/pkg/models/deployment_filter_schema.go index 25acd67e..488cea17 100644 --- a/pkg/models/deployment_filter_schema.go +++ b/pkg/models/deployment_filter_schema.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,7 +38,6 @@ func (m *DeploymentFilterSchema) Validate(formats strfmt.Registry) error { } func (m *DeploymentFilterSchema) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(m.Filters) { // not required return nil } @@ -61,6 +61,38 @@ func (m *DeploymentFilterSchema) validateFilters(formats strfmt.Registry) error return nil } +// ContextValidate validate this deployment filter schema based on the context it is used +func (m *DeploymentFilterSchema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentFilterSchema) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Filters); i++ { + + if m.Filters[i] != nil { + if err := m.Filters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DeploymentFilterSchema) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_resource_type.go b/pkg/models/deployment_resource_type.go index 036dfa2f..b601228f 100644 --- a/pkg/models/deployment_resource_type.go +++ b/pkg/models/deployment_resource_type.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -113,23 +114,23 @@ const ( // DeploymentResourceTypeAccountTypeVSphere captures enum value "vSphere" DeploymentResourceTypeAccountTypeVSphere string = "vSphere" - // DeploymentResourceTypeAccountTypeVSphereCloud captures enum value "vSphere-cloud" - DeploymentResourceTypeAccountTypeVSphereCloud string = "vSphere-cloud" + // DeploymentResourceTypeAccountTypeVSphereDashCloud captures enum value "vSphere-cloud" + DeploymentResourceTypeAccountTypeVSphereDashCloud string = "vSphere-cloud" - // DeploymentResourceTypeAccountTypeAzureEA captures enum value "Azure-EA" - DeploymentResourceTypeAccountTypeAzureEA string = "Azure-EA" + // DeploymentResourceTypeAccountTypeAzureDashEA captures enum value "Azure-EA" + DeploymentResourceTypeAccountTypeAzureDashEA string = "Azure-EA" - // DeploymentResourceTypeAccountTypeNSXV captures enum value "NSX-V" - DeploymentResourceTypeAccountTypeNSXV string = "NSX-V" + // DeploymentResourceTypeAccountTypeNSXDashV captures enum value "NSX-V" + DeploymentResourceTypeAccountTypeNSXDashV string = "NSX-V" - // DeploymentResourceTypeAccountTypeNSXT captures enum value "NSX-T" - DeploymentResourceTypeAccountTypeNSXT string = "NSX-T" + // DeploymentResourceTypeAccountTypeNSXDashT captures enum value "NSX-T" + DeploymentResourceTypeAccountTypeNSXDashT string = "NSX-T" - // DeploymentResourceTypeAccountTypeNSXP captures enum value "NSX-P" - DeploymentResourceTypeAccountTypeNSXP string = "NSX-P" + // DeploymentResourceTypeAccountTypeNSXDashP captures enum value "NSX-P" + DeploymentResourceTypeAccountTypeNSXDashP string = "NSX-P" - // DeploymentResourceTypeAccountTypeNSXPCloud captures enum value "NSX-P-cloud" - DeploymentResourceTypeAccountTypeNSXPCloud string = "NSX-P-cloud" + // DeploymentResourceTypeAccountTypeNSXDashPDashCloud captures enum value "NSX-P-cloud" + DeploymentResourceTypeAccountTypeNSXDashPDashCloud string = "NSX-P-cloud" // DeploymentResourceTypeAccountTypeVCloudDirector captures enum value "vCloud Director" DeploymentResourceTypeAccountTypeVCloudDirector string = "vCloud Director" @@ -153,7 +154,6 @@ func (m *DeploymentResourceType) validateAccountTypeEnum(path, location string, } func (m *DeploymentResourceType) validateAccountType(formats strfmt.Registry) error { - if swag.IsZero(m.AccountType) { // not required return nil } @@ -167,7 +167,6 @@ func (m *DeploymentResourceType) validateAccountType(formats strfmt.Registry) er } func (m *DeploymentResourceType) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -180,7 +179,6 @@ func (m *DeploymentResourceType) validateCreatedAt(formats strfmt.Registry) erro } func (m *DeploymentResourceType) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -192,6 +190,11 @@ func (m *DeploymentResourceType) validateUpdatedAt(formats strfmt.Registry) erro return nil } +// ContextValidate validates this deployment resource type based on context it is used +func (m *DeploymentResourceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeploymentResourceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_specification.go b/pkg/models/deployment_specification.go index f0cb61a0..7f2ffe57 100644 --- a/pkg/models/deployment_specification.go +++ b/pkg/models/deployment_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -25,6 +27,7 @@ type DeploymentSpecification struct { Name *string `json:"name"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` } @@ -65,6 +68,11 @@ func (m *DeploymentSpecification) validateProjectID(formats strfmt.Registry) err return nil } +// ContextValidate validates this deployment specification based on context it is used +func (m *DeploymentSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeploymentSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deployment_update.go b/pkg/models/deployment_update.go index 80d32b33..37bf820a 100644 --- a/pkg/models/deployment_update.go +++ b/pkg/models/deployment_update.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,6 +31,11 @@ func (m *DeploymentUpdate) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this deployment update based on context it is used +func (m *DeploymentUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeploymentUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/deprecation_policy.go b/pkg/models/deprecation_policy.go index 4dbfe788..fca45f8a 100644 --- a/pkg/models/deprecation_policy.go +++ b/pkg/models/deprecation_policy.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *DeprecationPolicy) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this deprecation policy based on context it is used +func (m *DeprecationPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeprecationPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/disk_attachment_specification.go b/pkg/models/disk_attachment_specification.go index cea089d5..dba6a878 100644 --- a/pkg/models/disk_attachment_specification.go +++ b/pkg/models/disk_attachment_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,6 +20,7 @@ import ( type DiskAttachmentSpecification struct { // The id of the existing block device + // Example: 1298765 // Required: true BlockDeviceID *string `json:"blockDeviceId"` @@ -26,6 +29,14 @@ type DiskAttachmentSpecification struct { // A human-friendly name used as an identifier in APIs that support this option. Name string `json:"name,omitempty"` + + // The SCSI controller to be assigned + // Example: SCSI_Controller_0, SCSI_Controller_1, SCSI_Controller_2, SCSI_Controller_3 + ScsiController string `json:"scsiController,omitempty"` + + // The Unit Number to be assigned + // Example: 0 + UnitNumber string `json:"unitNumber,omitempty"` } // Validate validates this disk attachment specification @@ -51,6 +62,11 @@ func (m *DiskAttachmentSpecification) validateBlockDeviceID(formats strfmt.Regis return nil } +// ContextValidate validates this disk attachment specification based on context it is used +func (m *DiskAttachmentSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DiskAttachmentSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/disk_snapshot.go b/pkg/models/disk_snapshot.go index d5042c6f..26a59aaa 100644 --- a/pkg/models/disk_snapshot.go +++ b/pkg/models/disk_snapshot.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,31 +24,44 @@ type DiskSnapshot struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Desc string `json:"desc,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` - // A human-friendly description. + // Specifies if the snapshot is the current snapshot for the block device. Valid only for vSphere First Class Disks + // Example: false IsCurrent bool `json:"isCurrent,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` + // Snapshot specific properties + // Example: { \"incremental\": \"false\" } + SnapshotProperties map[string]string `json:"snapshotProperties,omitempty"` + // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -70,6 +85,10 @@ func (m *DiskSnapshot) Validate(formats strfmt.Registry) error { func (m *DiskSnapshot) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -95,6 +114,39 @@ func (m *DiskSnapshot) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this disk snapshot based on the context it is used +func (m *DiskSnapshot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DiskSnapshot) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DiskSnapshot) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/disk_snapshot_specification.go b/pkg/models/disk_snapshot_specification.go index ec357d10..7d49bdd6 100644 --- a/pkg/models/disk_snapshot_specification.go +++ b/pkg/models/disk_snapshot_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,6 +19,13 @@ type DiskSnapshotSpecification struct { // A human-friendly description. Description string `json:"description,omitempty"` + + // A human-friendly name used as an identifier in APIs that support this option. + Name string `json:"name,omitempty"` + + // Cloud specific snapshot properties supplied in as name value pairs + // Example: {\"incremental\": \"true\", + SnapshotProperties map[string]string `json:"snapshotProperties,omitempty"` } // Validate validates this disk snapshot specification @@ -24,6 +33,11 @@ func (m *DiskSnapshotSpecification) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this disk snapshot specification based on context it is used +func (m *DiskSnapshotSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DiskSnapshotSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/document.go b/pkg/models/document.go index 1227de2d..0823a0ca 100644 --- a/pkg/models/document.go +++ b/pkg/models/document.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *Document) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this document based on context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Document) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/endpoint_properties.go b/pkg/models/endpoint_properties.go index 324f8946..d22c6d97 100644 --- a/pkg/models/endpoint_properties.go +++ b/pkg/models/endpoint_properties.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -51,6 +53,11 @@ func (m *EndpointProperties) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this endpoint properties based on context it is used +func (m *EndpointProperties) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *EndpointProperties) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/entitlement.go b/pkg/models/entitlement.go index 21611ee2..6e8ca21f 100644 --- a/pkg/models/entitlement.go +++ b/pkg/models/entitlement.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -95,6 +97,34 @@ func (m *Entitlement) validateProjectID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this entitlement based on the context it is used +func (m *Entitlement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDefinition(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Entitlement) contextValidateDefinition(ctx context.Context, formats strfmt.Registry) error { + + if m.Definition != nil { + if err := m.Definition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("definition") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Entitlement) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/error.go b/pkg/models/error.go index f4908034..96ab2372 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -18,6 +20,7 @@ import ( type Error struct { // Error message + // Example: Failed to validate credentials. Message string `json:"message,omitempty"` // status code @@ -29,6 +32,11 @@ func (m *Error) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Error) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/event.go b/pkg/models/event.go index 008e9300..d23b7286 100644 --- a/pkg/models/event.go +++ b/pkg/models/event.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -68,7 +70,6 @@ func (m *Event) Validate(formats strfmt.Registry) error { } func (m *Event) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -102,6 +103,11 @@ func (m *Event) validateTimestamp(formats strfmt.Registry) error { return nil } +// ContextValidate validates this event based on context it is used +func (m *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Event) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/event_log.go b/pkg/models/event_log.go index c4fcaadb..4428e24d 100644 --- a/pkg/models/event_log.go +++ b/pkg/models/event_log.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -62,7 +64,6 @@ func (m *EventLog) Validate(formats strfmt.Registry) error { } func (m *EventLog) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -96,6 +97,11 @@ func (m *EventLog) validateTimestamp(formats strfmt.Registry) error { return nil } +// ContextValidate validates this event log based on context it is used +func (m *EventLog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *EventLog) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/execution_message.go b/pkg/models/execution_message.go index 0c5c60e0..d0f0424b 100644 --- a/pkg/models/execution_message.go +++ b/pkg/models/execution_message.go @@ -6,8 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ExecutionMessage ExecutionMessage @@ -25,6 +29,29 @@ func (m *ExecutionMessage) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validate this execution message based on the context it is used +func (m *ExecutionMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExecutionMessage) contextValidateMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "message", "body", string(m.Message)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ExecutionMessage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/expense.go b/pkg/models/expense.go index 06b1876f..4c1f7ec2 100644 --- a/pkg/models/expense.go +++ b/pkg/models/expense.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -70,7 +72,6 @@ func (m *Expense) Validate(formats strfmt.Registry) error { } func (m *Expense) validateLastUpdatedTime(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedTime) { // not required return nil } @@ -82,6 +83,133 @@ func (m *Expense) validateLastUpdatedTime(formats strfmt.Registry) error { return nil } +// ContextValidate validate this expense based on the context it is used +func (m *Expense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdditionalExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateComputeExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdatedTime(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworkExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUnit(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Expense) contextValidateAdditionalExpense(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "additionalExpense", "body", float64(m.AdditionalExpense)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "code", "body", string(m.Code)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateComputeExpense(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "computeExpense", "body", float64(m.ComputeExpense)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateLastUpdatedTime(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastUpdatedTime", "body", strfmt.DateTime(m.LastUpdatedTime)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "message", "body", string(m.Message)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateNetworkExpense(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "networkExpense", "body", float64(m.NetworkExpense)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateStorageExpense(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "storageExpense", "body", float64(m.StorageExpense)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateTotalExpense(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalExpense", "body", float64(m.TotalExpense)); err != nil { + return err + } + + return nil +} + +func (m *Expense) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "unit", "body", string(m.Unit)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *Expense) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/external_network_ip_range.go b/pkg/models/external_network_ip_range.go index a1422f0a..704f7aac 100644 --- a/pkg/models/external_network_ip_range.go +++ b/pkg/models/external_network_ip_range.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -28,9 +29,11 @@ type ExternalNetworkIPRange struct { AddressSpaceID string `json:"addressSpaceId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // DNS domain search (in order) @@ -47,12 +50,14 @@ type ExternalNetworkIPRange struct { EndIPAddress *string `json:"endIPAddress"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The gateway address of the range GatewayAddress string `json:"gatewayAddress,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` @@ -61,15 +66,19 @@ type ExternalNetworkIPRange struct { IPVersion string `json:"ipVersion,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Start IP address of the range. @@ -81,9 +90,11 @@ type ExternalNetworkIPRange struct { SubnetPrefixLength *int32 `json:"subnetPrefixLength"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"ipv6-range\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -127,6 +138,10 @@ func (m *ExternalNetworkIPRange) Validate(formats strfmt.Registry) error { func (m *ExternalNetworkIPRange) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -191,7 +206,6 @@ func (m *ExternalNetworkIPRange) validateIPVersionEnum(path, location string, va } func (m *ExternalNetworkIPRange) validateIPVersion(formats strfmt.Registry) error { - if swag.IsZero(m.IPVersion) { // not required return nil } @@ -223,7 +237,6 @@ func (m *ExternalNetworkIPRange) validateSubnetPrefixLength(formats strfmt.Regis } func (m *ExternalNetworkIPRange) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -247,6 +260,61 @@ func (m *ExternalNetworkIPRange) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this external network IP range based on the context it is used +func (m *ExternalNetworkIPRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExternalNetworkIPRange) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ExternalNetworkIPRange) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ExternalNetworkIPRange) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/external_network_ip_range_result.go b/pkg/models/external_network_ip_range_result.go index 99e04cad..1ca7e110 100644 --- a/pkg/models/external_network_ip_range_result.go +++ b/pkg/models/external_network_ip_range_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ExternalNetworkIPRangeResult State object representing a query result of external IPAM network IP range. @@ -23,10 +25,12 @@ type ExternalNetworkIPRangeResult struct { Content []*ExternalNetworkIPRange `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ExternalNetworkIPRangeResult) Validate(formats strfmt.Registry) error { } func (m *ExternalNetworkIPRangeResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ExternalNetworkIPRangeResult) validateContent(formats strfmt.Registry) return nil } +// ContextValidate validate this external network IP range result based on the context it is used +func (m *ExternalNetworkIPRangeResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExternalNetworkIPRangeResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*ExternalNetworkIPRange(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExternalNetworkIPRangeResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ExternalNetworkIPRangeResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ExternalNetworkIPRangeResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_azure_storage_account.go b/pkg/models/fabric_azure_storage_account.go index 2f80a323..669c02b4 100644 --- a/pkg/models/fabric_azure_storage_account.go +++ b/pkg/models/fabric_azure_storage_account.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,42 +24,54 @@ type FabricAzureStorageAccount struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // Indicates the ID of region. + // Example: westus // Required: true ExternalRegionID *string `json:"externalRegionId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Indicates the performance tier for the storage type. Premium disks are SSD backed and Standard disks are HDD backed. + // Example: Standard_LRS / Premium_LRS Type string `json:"type,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -89,6 +103,10 @@ func (m *FabricAzureStorageAccount) Validate(formats strfmt.Registry) error { func (m *FabricAzureStorageAccount) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -106,7 +124,6 @@ func (m *FabricAzureStorageAccount) validateLinks(formats strfmt.Registry) error } func (m *FabricAzureStorageAccount) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -136,6 +153,39 @@ func (m *FabricAzureStorageAccount) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric azure storage account based on the context it is used +func (m *FabricAzureStorageAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricAzureStorageAccount) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricAzureStorageAccount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_azure_storage_account_result.go b/pkg/models/fabric_azure_storage_account_result.go index dbc65e15..56c1a21b 100644 --- a/pkg/models/fabric_azure_storage_account_result.go +++ b/pkg/models/fabric_azure_storage_account_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricAzureStorageAccountResult State object representing a query result of Azure storage accounts. @@ -23,10 +25,12 @@ type FabricAzureStorageAccountResult struct { Content []*FabricAzureStorageAccount `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricAzureStorageAccountResult) Validate(formats strfmt.Registry) erro } func (m *FabricAzureStorageAccountResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricAzureStorageAccountResult) validateContent(formats strfmt.Registr return nil } +// ContextValidate validate this fabric azure storage account result based on the context it is used +func (m *FabricAzureStorageAccountResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricAzureStorageAccountResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricAzureStorageAccount(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricAzureStorageAccountResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricAzureStorageAccountResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricAzureStorageAccountResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_compute.go b/pkg/models/fabric_compute.go index d113e98f..cb294988 100644 --- a/pkg/models/fabric_compute.go +++ b/pkg/models/fabric_compute.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,48 +25,68 @@ type FabricCompute struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Custom properties of the compute instance CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the compute + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the compute. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` + // Lifecycle status of the compute instance + // Example: PROVISIONING, READY, SUSPEND, STOPPED, RETIRED + LifecycleState string `json:"lifecycleState,omitempty"` + // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` + // Power state of compute instance + // Example: ON, OFF, GUEST_OFF, UNKNOWN, SUSPEND + PowerState string `json:"powerState,omitempty"` + // A set of tag keys and optional values that were set on this resource instance. Tags []*Tag `json:"tags"` // Type of the compute instance + // Example: Availability Zone Type string `json:"type,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -101,6 +122,10 @@ func (m *FabricCompute) Validate(formats strfmt.Registry) error { func (m *FabricCompute) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -145,7 +170,6 @@ func (m *FabricCompute) validateID(formats strfmt.Registry) error { } func (m *FabricCompute) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -169,6 +193,61 @@ func (m *FabricCompute) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric compute based on the context it is used +func (m *FabricCompute) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricCompute) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FabricCompute) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricCompute) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_compute_result.go b/pkg/models/fabric_compute_result.go index 61509919..0cbfb0e3 100644 --- a/pkg/models/fabric_compute_result.go +++ b/pkg/models/fabric_compute_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricComputeResult State object representing a query result of cloud zone's computes. @@ -23,10 +25,12 @@ type FabricComputeResult struct { Content []*FabricCompute `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricComputeResult) Validate(formats strfmt.Registry) error { } func (m *FabricComputeResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricComputeResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric compute result based on the context it is used +func (m *FabricComputeResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricComputeResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricCompute(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricComputeResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricComputeResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricComputeResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_compute_specification.go b/pkg/models/fabric_compute_specification.go index 6e2be0f7..05d9813a 100644 --- a/pkg/models/fabric_compute_specification.go +++ b/pkg/models/fabric_compute_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type FabricComputeSpecification struct { // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"?\", \"value\": \"Environment\" } ] Tags []*Tag `json:"tags"` } @@ -37,7 +39,6 @@ func (m *FabricComputeSpecification) Validate(formats strfmt.Registry) error { } func (m *FabricComputeSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -61,6 +62,38 @@ func (m *FabricComputeSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this fabric compute specification based on the context it is used +func (m *FabricComputeSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricComputeSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricComputeSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_flavor.go b/pkg/models/fabric_flavor.go index 72b54f71..6390682e 100644 --- a/pkg/models/fabric_flavor.go +++ b/pkg/models/fabric_flavor.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,31 +20,40 @@ import ( type FabricFlavor struct { // Size of the boot disk (in megabytes). Not populated when inapplicable. + // Example: 486400 BootDiskSizeInMB int32 `json:"bootDiskSizeInMB,omitempty"` // Number of CPU cores. Not populated when inapplicable. + // Example: 2 CPUCount int32 `json:"cpuCount,omitempty"` // Number of data disks. Not populated when inapplicable. + // Example: 1 DataDiskMaxCount int32 `json:"dataDiskMaxCount,omitempty"` // Size of the data disks (in megabytes). Not populated when inapplicable. + // Example: 486400 DataDiskSizeInMB int32 `json:"dataDiskSizeInMB,omitempty"` // The internal identification used by the corresponding cloud end-point + // Example: i3.large ID string `json:"id,omitempty"` // Total amount of memory (in megabytes). Not populated when inapplicable. + // Example: 15616 MemoryInMB int64 `json:"memoryInMB,omitempty"` // The value of the instance type in the corresponding cloud. + // Example: i3.large // Required: true Name *string `json:"name"` // The type of network supported by this instance type. Not populated when inapplicable. + // Example: Up to 10 Gigabit NetworkType string `json:"networkType,omitempty"` // The type of storage supported by this instance type. Not populated when inapplicable. + // Example: NVMe_SSD StorageType string `json:"storageType,omitempty"` } @@ -69,6 +80,11 @@ func (m *FabricFlavor) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this fabric flavor based on context it is used +func (m *FabricFlavor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FabricFlavor) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_flavor_description.go b/pkg/models/fabric_flavor_description.go index 372e3cc5..92ef5466 100644 --- a/pkg/models/fabric_flavor_description.go +++ b/pkg/models/fabric_flavor_description.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -16,12 +18,15 @@ import ( type FabricFlavorDescription struct { // Number of CPU cores. Mandatory for private clouds such as vSphere. Not populated when inapplicable. + // Example: 4 CPUCount int32 `json:"cpuCount,omitempty"` // Total amount of memory (in megabytes). Mandatory for private clouds such as vSphere. Not populated when inapplicable. + // Example: 4096 MemoryInMB int64 `json:"memoryInMB,omitempty"` // The value of the instance type in the corresponding cloud. Valid and mandatory for public clouds + // Example: t2.small, t2.medium Name string `json:"name,omitempty"` } @@ -30,6 +35,11 @@ func (m *FabricFlavorDescription) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this fabric flavor description based on context it is used +func (m *FabricFlavorDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FabricFlavorDescription) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_flavor_result.go b/pkg/models/fabric_flavor_result.go index 3b52519d..18104faa 100644 --- a/pkg/models/fabric_flavor_result.go +++ b/pkg/models/fabric_flavor_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricFlavorResult State object representing a query result of fabric flavors. @@ -23,10 +25,12 @@ type FabricFlavorResult struct { Content []*FabricFlavor `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricFlavorResult) Validate(formats strfmt.Registry) error { } func (m *FabricFlavorResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricFlavorResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric flavor result based on the context it is used +func (m *FabricFlavorResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricFlavorResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricFlavor(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricFlavorResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricFlavorResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricFlavorResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_image.go b/pkg/models/fabric_image.go index 2da0e414..db515087 100644 --- a/pkg/models/fabric_image.go +++ b/pkg/models/fabric_image.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,47 +24,61 @@ type FabricImage struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"prop1\" : \"value1\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The regionId of the image + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Indicates whether this fabric image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items + // Example: true IsPrivate bool `json:"isPrivate,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Operating System family of the image. + // Example: linux, win OsFamily string `json:"osFamily,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -90,6 +106,10 @@ func (m *FabricImage) Validate(formats strfmt.Registry) error { func (m *FabricImage) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -107,7 +127,6 @@ func (m *FabricImage) validateLinks(formats strfmt.Registry) error { } func (m *FabricImage) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -128,6 +147,39 @@ func (m *FabricImage) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric image based on the context it is used +func (m *FabricImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricImage) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricImage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_image_description.go b/pkg/models/fabric_image_description.go index aa8027ce..e6730554 100644 --- a/pkg/models/fabric_image_description.go +++ b/pkg/models/fabric_image_description.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,15 +20,19 @@ import ( type FabricImageDescription struct { // Cloud config for this image. This cloud config will be merged during provisioning with other cloud configurations such as the bootConfig provided in MachineSpecification. + // Example: runcmd:\n - [\"mkdir\", \"/imageFolder\"] CloudConfig string `json:"cloudConfig,omitempty"` // Constraints that are used to drive placement policies for the image that is produced from this mapping.Constraint expressions are matched against tags on existing placement targets. + // Example: [{\"mandatory\" : \"true\", \"expression\": \"environment\":\"prod\"}, {\"mandatory\" : \"false\", \"expression\": \"pci\"}] Constraints []*Constraint `json:"constraints"` // The id of the fabric image + // Example: 9e49 ID string `json:"id,omitempty"` // Fabric image name. Valid if id not provided. + // Example: ami-ubuntu-16.04-1.9.1-00-1516139717 Name string `json:"name,omitempty"` } @@ -46,7 +51,6 @@ func (m *FabricImageDescription) Validate(formats strfmt.Registry) error { } func (m *FabricImageDescription) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -70,6 +74,38 @@ func (m *FabricImageDescription) validateConstraints(formats strfmt.Registry) er return nil } +// ContextValidate validate this fabric image description based on the context it is used +func (m *FabricImageDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricImageDescription) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Constraints); i++ { + + if m.Constraints[i] != nil { + if err := m.Constraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricImageDescription) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_image_result.go b/pkg/models/fabric_image_result.go index ac321526..93f914ee 100644 --- a/pkg/models/fabric_image_result.go +++ b/pkg/models/fabric_image_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricImageResult State object representing a query result of fabric images. @@ -23,10 +25,12 @@ type FabricImageResult struct { Content []*FabricImage `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricImageResult) Validate(formats strfmt.Registry) error { } func (m *FabricImageResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricImageResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric image result based on the context it is used +func (m *FabricImageResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricImageResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricImage(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricImageResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricImageResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricImageResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network.go b/pkg/models/fabric_network.go index a288199b..bc30c76b 100644 --- a/pkg/models/fabric_network.go +++ b/pkg/models/fabric_network.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,32 +25,40 @@ type FabricNetwork struct { Links map[string]Href `json:"_links"` // Network CIDR to be used. + // Example: 10.1.2.0/24 Cidr string `json:"cidr,omitempty"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Custom properties of the fabric network instance CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The id of the region for which this network is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Network IPv6 CIDR to be used. + // Example: 2001:eeee:6bd:2a::1/64 IPV6Cidr string `json:"ipv6Cidr,omitempty"` // Indicates whether this is the default subnet for the zone. @@ -59,21 +68,27 @@ type FabricNetwork struct { IsPublic bool `json:"isPublic,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"fast-network\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -105,6 +120,10 @@ func (m *FabricNetwork) Validate(formats strfmt.Registry) error { func (m *FabricNetwork) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -122,7 +141,6 @@ func (m *FabricNetwork) validateLinks(formats strfmt.Registry) error { } func (m *FabricNetwork) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -144,7 +162,6 @@ func (m *FabricNetwork) validateID(formats strfmt.Registry) error { } func (m *FabricNetwork) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -168,6 +185,61 @@ func (m *FabricNetwork) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric network based on the context it is used +func (m *FabricNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetwork) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FabricNetwork) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network_result.go b/pkg/models/fabric_network_result.go index 311f7aad..aed18689 100644 --- a/pkg/models/fabric_network_result.go +++ b/pkg/models/fabric_network_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricNetworkResult State object representing a query result of fabric networks. @@ -23,10 +25,12 @@ type FabricNetworkResult struct { Content []*FabricNetwork `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricNetworkResult) Validate(formats strfmt.Registry) error { } func (m *FabricNetworkResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricNetworkResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric network result based on the context it is used +func (m *FabricNetworkResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetworkResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricNetwork(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricNetworkResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricNetworkResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetworkResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network_specification.go b/pkg/models/fabric_network_specification.go index 00e319e3..bf55381c 100644 --- a/pkg/models/fabric_network_specification.go +++ b/pkg/models/fabric_network_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type FabricNetworkSpecification struct { // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"fast-network\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` } @@ -37,7 +39,6 @@ func (m *FabricNetworkSpecification) Validate(formats strfmt.Registry) error { } func (m *FabricNetworkSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -61,6 +62,38 @@ func (m *FabricNetworkSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this fabric network specification based on the context it is used +func (m *FabricNetworkSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetworkSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetworkSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network_vsphere.go b/pkg/models/fabric_network_vsphere.go index c8f01e85..dd0190d1 100644 --- a/pkg/models/fabric_network_vsphere.go +++ b/pkg/models/fabric_network_vsphere.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,47 +25,60 @@ type FabricNetworkVsphere struct { Links map[string]Href `json:"_links"` // Network CIDR to be used. + // Example: 10.1.2.0/24 Cidr string `json:"cidr,omitempty"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Custom properties of the fabric network instance CustomProperties map[string]string `json:"customProperties,omitempty"` // IPv4 default gateway to be used. + // Example: 10.1.2.1 DefaultGateway string `json:"defaultGateway,omitempty"` // IPv6 default gateway to be used. + // Example: 2001:eeee:6bd:2a::1 DefaultIPV6Gateway string `json:"defaultIpv6Gateway,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // A list of DNS search domains that were set on this resource instance. + // Example: [vmware.com] DNSSearchDomains []string `json:"dnsSearchDomains"` // A list of DNS server addresses that were set on this resource instance. + // Example: [1.1.1.1] DNSServerAddresses []string `json:"dnsServerAddresses"` // Domain value. + // Example: sqa.local Domain string `json:"domain,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The id of the region for which this network is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Network IPv6 CIDR to be used. + // Example: 2001:eeee:6bd:2a::1/64 IPV6Cidr string `json:"ipv6Cidr,omitempty"` // Indicates whether this is the default subnet for the zone. @@ -74,21 +88,27 @@ type FabricNetworkVsphere struct { IsPublic bool `json:"isPublic,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"fast-network\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -120,6 +140,10 @@ func (m *FabricNetworkVsphere) Validate(formats strfmt.Registry) error { func (m *FabricNetworkVsphere) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -137,7 +161,6 @@ func (m *FabricNetworkVsphere) validateLinks(formats strfmt.Registry) error { } func (m *FabricNetworkVsphere) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -159,7 +182,6 @@ func (m *FabricNetworkVsphere) validateID(formats strfmt.Registry) error { } func (m *FabricNetworkVsphere) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -183,6 +205,61 @@ func (m *FabricNetworkVsphere) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric network vsphere based on the context it is used +func (m *FabricNetworkVsphere) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetworkVsphere) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FabricNetworkVsphere) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetworkVsphere) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network_vsphere_result.go b/pkg/models/fabric_network_vsphere_result.go index 2b11fa5c..4d08a0b4 100644 --- a/pkg/models/fabric_network_vsphere_result.go +++ b/pkg/models/fabric_network_vsphere_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricNetworkVsphereResult State object representing a query result of fabric networks. @@ -23,10 +25,12 @@ type FabricNetworkVsphereResult struct { Content []*FabricNetworkVsphere `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricNetworkVsphereResult) Validate(formats strfmt.Registry) error { } func (m *FabricNetworkVsphereResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricNetworkVsphereResult) validateContent(formats strfmt.Registry) er return nil } +// ContextValidate validate this fabric network vsphere result based on the context it is used +func (m *FabricNetworkVsphereResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetworkVsphereResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricNetworkVsphere(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricNetworkVsphereResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricNetworkVsphereResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetworkVsphereResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_network_vsphere_specification.go b/pkg/models/fabric_network_vsphere_specification.go index 7623a59e..d14ae3c1 100644 --- a/pkg/models/fabric_network_vsphere_specification.go +++ b/pkg/models/fabric_network_vsphere_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,24 +20,31 @@ import ( type FabricNetworkVsphereSpecification struct { // Network CIDR to be used. + // Example: 10.1.2.0/24 Cidr string `json:"cidr,omitempty"` // IPv4 default gateway to be used. + // Example: 10.1.2.1 DefaultGateway string `json:"defaultGateway,omitempty"` // IPv6 default gateway to be used. + // Example: 2001:eeee:6bd:2a::1 DefaultIPV6Gateway string `json:"defaultIpv6Gateway,omitempty"` // A list of DNS search domains that were set on this resource instance. + // Example: [vmware.com] DNSSearchDomains []string `json:"dnsSearchDomains"` // A list of DNS server addresses that were set on this resource instance. + // Example: [1.1.1.1] DNSServerAddresses []string `json:"dnsServerAddresses"` // Domain value. + // Example: sqa.local Domain string `json:"domain,omitempty"` // Network IPv6 CIDR to be used. + // Example: 2001:eeee:6bd:2a::1/64 IPV6Cidr string `json:"ipv6Cidr,omitempty"` // Indicates whether this is the default subnet for the zone. @@ -46,6 +54,7 @@ type FabricNetworkVsphereSpecification struct { IsPublic *bool `json:"isPublic,omitempty"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"fast-network\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` } @@ -64,7 +73,6 @@ func (m *FabricNetworkVsphereSpecification) Validate(formats strfmt.Registry) er } func (m *FabricNetworkVsphereSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -88,6 +96,38 @@ func (m *FabricNetworkVsphereSpecification) validateTags(formats strfmt.Registry return nil } +// ContextValidate validate this fabric network vsphere specification based on the context it is used +func (m *FabricNetworkVsphereSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricNetworkVsphereSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricNetworkVsphereSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_vsphere_datastore.go b/pkg/models/fabric_vsphere_datastore.go index 8d8bea5b..dbe64a5b 100644 --- a/pkg/models/fabric_vsphere_datastore.go +++ b/pkg/models/fabric_vsphere_datastore.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,47 +25,61 @@ type FabricVsphereDatastore struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // Id of datacenter in which the datastore is present. + // Example: Datacenter:datacenter-2 ExternalRegionID string `json:"externalRegionId,omitempty"` // Indicates free size available in datastore. + // Example: 20 FreeSizeGB string `json:"freeSizeGB,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this datastore / datastore cluster. + // Example: [ { \"key\" : \"vsan\", \"value\": \" \" } ] Tags []*Tag `json:"tags"` // Type of datastore. + // Example: VMFS / NFS / StoragePod Type string `json:"type,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -96,6 +111,10 @@ func (m *FabricVsphereDatastore) Validate(formats strfmt.Registry) error { func (m *FabricVsphereDatastore) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -113,7 +132,6 @@ func (m *FabricVsphereDatastore) validateLinks(formats strfmt.Registry) error { } func (m *FabricVsphereDatastore) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -135,7 +153,6 @@ func (m *FabricVsphereDatastore) validateID(formats strfmt.Registry) error { } func (m *FabricVsphereDatastore) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -159,6 +176,61 @@ func (m *FabricVsphereDatastore) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this fabric vsphere datastore based on the context it is used +func (m *FabricVsphereDatastore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricVsphereDatastore) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FabricVsphereDatastore) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricVsphereDatastore) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_vsphere_datastore_result.go b/pkg/models/fabric_vsphere_datastore_result.go index 6774b917..4843163d 100644 --- a/pkg/models/fabric_vsphere_datastore_result.go +++ b/pkg/models/fabric_vsphere_datastore_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricVsphereDatastoreResult State object representing a query result of vSphere datastores. @@ -23,10 +25,12 @@ type FabricVsphereDatastoreResult struct { Content []*FabricVsphereDatastore `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricVsphereDatastoreResult) Validate(formats strfmt.Registry) error { } func (m *FabricVsphereDatastoreResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricVsphereDatastoreResult) validateContent(formats strfmt.Registry) return nil } +// ContextValidate validate this fabric vsphere datastore result based on the context it is used +func (m *FabricVsphereDatastoreResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricVsphereDatastoreResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricVsphereDatastore(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricVsphereDatastoreResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricVsphereDatastoreResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricVsphereDatastoreResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_vsphere_storage_policy.go b/pkg/models/fabric_vsphere_storage_policy.go index 48a06ea6..f0207751 100644 --- a/pkg/models/fabric_vsphere_storage_policy.go +++ b/pkg/models/fabric_vsphere_storage_policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,41 +25,53 @@ type FabricVsphereStoragePolicy struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // Id of datacenter in which the storage policy is present. + // Example: Datacenter:datacenter-2 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this storage policy. + // Example: [ { \"key\" : \"vmencryption\", \"value\": \" \" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -90,6 +103,10 @@ func (m *FabricVsphereStoragePolicy) Validate(formats strfmt.Registry) error { func (m *FabricVsphereStoragePolicy) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -107,7 +124,6 @@ func (m *FabricVsphereStoragePolicy) validateLinks(formats strfmt.Registry) erro } func (m *FabricVsphereStoragePolicy) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -129,7 +145,6 @@ func (m *FabricVsphereStoragePolicy) validateID(formats strfmt.Registry) error { } func (m *FabricVsphereStoragePolicy) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -153,6 +168,61 @@ func (m *FabricVsphereStoragePolicy) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this fabric vsphere storage policy based on the context it is used +func (m *FabricVsphereStoragePolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricVsphereStoragePolicy) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FabricVsphereStoragePolicy) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricVsphereStoragePolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fabric_vsphere_storage_policy_result.go b/pkg/models/fabric_vsphere_storage_policy_result.go index 385e87de..6c8cf87c 100644 --- a/pkg/models/fabric_vsphere_storage_policy_result.go +++ b/pkg/models/fabric_vsphere_storage_policy_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FabricVsphereStoragePolicyResult State object representing a query result of vSphere storage policies. @@ -23,10 +25,12 @@ type FabricVsphereStoragePolicyResult struct { Content []*FabricVsphereStoragePolicy `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FabricVsphereStoragePolicyResult) Validate(formats strfmt.Registry) err } func (m *FabricVsphereStoragePolicyResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FabricVsphereStoragePolicyResult) validateContent(formats strfmt.Regist return nil } +// ContextValidate validate this fabric vsphere storage policy result based on the context it is used +func (m *FabricVsphereStoragePolicyResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FabricVsphereStoragePolicyResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FabricVsphereStoragePolicy(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FabricVsphereStoragePolicyResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FabricVsphereStoragePolicyResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FabricVsphereStoragePolicyResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/file_tree.go b/pkg/models/file_tree.go index a6bce096..75f5eb4b 100644 --- a/pkg/models/file_tree.go +++ b/pkg/models/file_tree.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -48,7 +49,6 @@ func (m *FileTree) Validate(formats strfmt.Registry) error { } func (m *FileTree) validateRepositoryID(formats strfmt.Registry) error { - if swag.IsZero(m.RepositoryID) { // not required return nil } @@ -61,7 +61,6 @@ func (m *FileTree) validateRepositoryID(formats strfmt.Registry) error { } func (m *FileTree) validateTree(formats strfmt.Registry) error { - if swag.IsZero(m.Tree) { // not required return nil } @@ -85,6 +84,38 @@ func (m *FileTree) validateTree(formats strfmt.Registry) error { return nil } +// ContextValidate validate this file tree based on the context it is used +func (m *FileTree) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTree(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FileTree) contextValidateTree(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tree); i++ { + + if m.Tree[i] != nil { + if err := m.Tree[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tree" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FileTree) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/file_tree_directory.go b/pkg/models/file_tree_directory.go index 333b3779..09ef7f45 100644 --- a/pkg/models/file_tree_directory.go +++ b/pkg/models/file_tree_directory.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *FileTreeDirectory) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this file tree directory based on context it is used +func (m *FileTreeDirectory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FileTreeDirectory) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/filter_entry.go b/pkg/models/filter_entry.go index 9b6c365c..51eb5c63 100644 --- a/pkg/models/filter_entry.go +++ b/pkg/models/filter_entry.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *FilterEntry) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this filter entry based on context it is used +func (m *FilterEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FilterEntry) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/fixed_price.go b/pkg/models/fixed_price.go index b72d5d6c..a07cacf4 100644 --- a/pkg/models/fixed_price.go +++ b/pkg/models/fixed_price.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -77,7 +78,6 @@ func (m *FixedPrice) validateChargePeriodEnum(path, location string, value strin } func (m *FixedPrice) validateChargePeriod(formats strfmt.Registry) error { - if swag.IsZero(m.ChargePeriod) { // not required return nil } @@ -90,6 +90,11 @@ func (m *FixedPrice) validateChargePeriod(formats strfmt.Registry) error { return nil } +// ContextValidate validates this fixed price based on context it is used +func (m *FixedPrice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FixedPrice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/flavor_mapping.go b/pkg/models/flavor_mapping.go index 065ce055..ba2dc09a 100644 --- a/pkg/models/flavor_mapping.go +++ b/pkg/models/flavor_mapping.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,9 +24,11 @@ type FlavorMapping struct { Links map[string]Href `json:"_links"` // The id of the region for which this mapping is defined. + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // Flavors defined for the particular region. Keyed by global flavor key. + // Example: { \"small\": { \"name\": \"t2.small\", \"cpuCount\": \"1\", \"MemoryInMB\": \"2048\", \"storageType\": \"EBS\", \"networkType\": \"Low to Moderate\"} } // Required: true Mapping map[string]FabricFlavor `json:"mapping"` } @@ -49,6 +53,10 @@ func (m *FlavorMapping) Validate(formats strfmt.Registry) error { func (m *FlavorMapping) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -67,6 +75,10 @@ func (m *FlavorMapping) validateLinks(formats strfmt.Registry) error { func (m *FlavorMapping) validateMapping(formats strfmt.Registry) error { + if err := validate.Required("mapping", "body", m.Mapping); err != nil { + return err + } + for k := range m.Mapping { if err := validate.Required("mapping"+"."+k, "body", m.Mapping[k]); err != nil { @@ -83,6 +95,62 @@ func (m *FlavorMapping) validateMapping(formats strfmt.Registry) error { return nil } +// ContextValidate validate this flavor mapping based on the context it is used +func (m *FlavorMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FlavorMapping) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FlavorMapping) contextValidateMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("mapping", "body", m.Mapping); err != nil { + return err + } + + for k := range m.Mapping { + + if val, ok := m.Mapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FlavorMapping) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/flavor_profile.go b/pkg/models/flavor_profile.go index 2d1b4676..c0768735 100644 --- a/pkg/models/flavor_profile.go +++ b/pkg/models/flavor_profile.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,15 +24,19 @@ type FlavorProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this flavor profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of the region for which this profile is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // A list of the flavor mappings defined for the corresponding cloud end-point region @@ -38,22 +44,28 @@ type FlavorProfile struct { FlavorMappings *FlavorMapping `json:"flavorMappings"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -81,6 +93,10 @@ func (m *FlavorProfile) Validate(formats strfmt.Registry) error { func (m *FlavorProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -124,6 +140,57 @@ func (m *FlavorProfile) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this flavor profile based on the context it is used +func (m *FlavorProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFlavorMappings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FlavorProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *FlavorProfile) contextValidateFlavorMappings(ctx context.Context, formats strfmt.Registry) error { + + if m.FlavorMappings != nil { + if err := m.FlavorMappings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("flavorMappings") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *FlavorProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/flavor_profile_result.go b/pkg/models/flavor_profile_result.go index 59be07ef..2ae9bed8 100644 --- a/pkg/models/flavor_profile_result.go +++ b/pkg/models/flavor_profile_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FlavorProfileResult State object representing a query result of flavor profiles. @@ -23,10 +25,12 @@ type FlavorProfileResult struct { Content []*FlavorProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FlavorProfileResult) Validate(formats strfmt.Registry) error { } func (m *FlavorProfileResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FlavorProfileResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this flavor profile result based on the context it is used +func (m *FlavorProfileResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FlavorProfileResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FlavorProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FlavorProfileResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FlavorProfileResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FlavorProfileResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/flavor_profile_specification.go b/pkg/models/flavor_profile_specification.go index c4281e97..5d7b581b 100644 --- a/pkg/models/flavor_profile_specification.go +++ b/pkg/models/flavor_profile_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,6 +23,7 @@ type FlavorProfileSpecification struct { Description string `json:"description,omitempty"` // Map between global fabric flavor keys and fabric flavor descriptions + // Example: { \"small\": { \"name\": \"t2.small\" }, \"medium\": { \"name\": \"t2.medium\"}}, \"vSphere_small\": { \"cpuCount\": \"2\", \"memoryInMB\": \"2048\"}, \"vSphere_medium\": { \"cpuCount\": \"4\", \"memoryInMB\": \"4096\"}} // Required: true FlavorMapping map[string]FabricFlavorDescription `json:"flavorMapping"` @@ -29,6 +32,7 @@ type FlavorProfileSpecification struct { Name *string `json:"name"` // The id of the region for which this profile is created + // Example: 9e49 // Required: true RegionID *string `json:"regionId"` } @@ -57,6 +61,10 @@ func (m *FlavorProfileSpecification) Validate(formats strfmt.Registry) error { func (m *FlavorProfileSpecification) validateFlavorMapping(formats strfmt.Registry) error { + if err := validate.Required("flavorMapping", "body", m.FlavorMapping); err != nil { + return err + } + for k := range m.FlavorMapping { if err := validate.Required("flavorMapping"+"."+k, "body", m.FlavorMapping[k]); err != nil { @@ -91,6 +99,39 @@ func (m *FlavorProfileSpecification) validateRegionID(formats strfmt.Registry) e return nil } +// ContextValidate validate this flavor profile specification based on the context it is used +func (m *FlavorProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFlavorMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FlavorProfileSpecification) contextValidateFlavorMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("flavorMapping", "body", m.FlavorMapping); err != nil { + return err + } + + for k := range m.FlavorMapping { + + if val, ok := m.FlavorMapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *FlavorProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/flavor_result.go b/pkg/models/flavor_result.go index e29857af..3df85b9e 100644 --- a/pkg/models/flavor_result.go +++ b/pkg/models/flavor_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // FlavorResult State object representing a query result of falvor mappings. @@ -23,10 +25,12 @@ type FlavorResult struct { Content []*FlavorMapping `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *FlavorResult) Validate(formats strfmt.Registry) error { } func (m *FlavorResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *FlavorResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this flavor result based on the context it is used +func (m *FlavorResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FlavorResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*FlavorMapping(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FlavorResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *FlavorResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *FlavorResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/form_definition.go b/pkg/models/form_definition.go index 5415364c..83e6ad06 100644 --- a/pkg/models/form_definition.go +++ b/pkg/models/form_definition.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *FormDefinition) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this form definition based on context it is used +func (m *FormDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FormDefinition) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/health_check_configuration.go b/pkg/models/health_check_configuration.go index 5d614373..f30dd034 100644 --- a/pkg/models/health_check_configuration.go +++ b/pkg/models/health_check_configuration.go @@ -6,10 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/errors" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // HealthCheckConfiguration Load balancer health check configuration. @@ -18,74 +18,57 @@ import ( type HealthCheckConfiguration struct { // Number of consecutive successful checks before considering a particular back-end instance as healthy. + // Example: 2 HealthyThreshold int32 `json:"healthyThreshold,omitempty"` // HTTP or HTTPS method to use when sending a health check request. + // Example: GET, OPTIONS, POST, HEAD, PUT HTTPMethod string `json:"httpMethod,omitempty"` // Interval (in seconds) at which the health checks will be performed. + // Example: 60 IntervalSeconds int32 `json:"intervalSeconds,omitempty"` // Enable passive monitor mode. This setting only applies to NSX-T. + // Example: false PassiveMonitor bool `json:"passiveMonitor,omitempty"` // Port on the back-end instance machine to use for the health check. - // Required: true - Port *string `json:"port"` + // Example: 80 + Port string `json:"port,omitempty"` // The protocol used for the health check. - // Required: true - Protocol *string `json:"protocol"` + // Example: HTTP, HTTPS + Protocol string `json:"protocol,omitempty"` // Request body. Used by HTTP, HTTPS, TCP, UDP. + // Example: http_request.body RequestBody string `json:"requestBody,omitempty"` // Expected response body. Used by HTTP, HTTPS, TCP, UDP. + // Example: http_response.body ResponseBody string `json:"responseBody,omitempty"` // Timeout (in seconds) to wait for a response from the back-end instance. + // Example: 5 TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` // Number of consecutive check failures before considering a particular back-end instance as unhealthy. + // Example: 5 UnhealthyThreshold int32 `json:"unhealthyThreshold,omitempty"` // URL path on the back-end instance against which a request will be performed for the health check. Useful when the health check protocol is HTTP/HTTPS. + // Example: /index.html URLPath string `json:"urlPath,omitempty"` } // Validate validates this health check configuration func (m *HealthCheckConfiguration) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProtocol(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HealthCheckConfiguration) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - return nil } -func (m *HealthCheckConfiguration) validateProtocol(formats strfmt.Registry) error { - - if err := validate.Required("protocol", "body", m.Protocol); err != nil { - return err - } - +// ContextValidate validates this health check configuration based on context it is used +func (m *HealthCheckConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } diff --git a/pkg/models/href.go b/pkg/models/href.go index 4ca4aa60..c126e6bb 100644 --- a/pkg/models/href.go +++ b/pkg/models/href.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *Href) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this href based on context it is used +func (m *Href) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Href) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/iaa_s_about.go b/pkg/models/iaa_s_about.go index 13afa3d7..36bb3cc7 100644 --- a/pkg/models/iaa_s_about.go +++ b/pkg/models/iaa_s_about.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -80,6 +81,38 @@ func (m *IaaSAbout) validateSupportedApis(formats strfmt.Registry) error { return nil } +// ContextValidate validate this iaas about based on the context it is used +func (m *IaaSAbout) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSupportedApis(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IaaSAbout) contextValidateSupportedApis(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SupportedApis); i++ { + + if m.SupportedApis[i] != nil { + if err := m.SupportedApis[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("supportedApis" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *IaaSAbout) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/iaa_s_deployment.go b/pkg/models/iaa_s_deployment.go index 7e9a7b63..2f2cbbe7 100644 --- a/pkg/models/iaa_s_deployment.go +++ b/pkg/models/iaa_s_deployment.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,31 +24,39 @@ type IaaSDeployment struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // project Id ProjectID string `json:"projectId,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -70,6 +80,10 @@ func (m *IaaSDeployment) Validate(formats strfmt.Registry) error { func (m *IaaSDeployment) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -95,6 +109,39 @@ func (m *IaaSDeployment) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this iaas deployment based on the context it is used +func (m *IaaSDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IaaSDeployment) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *IaaSDeployment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_mapping.go b/pkg/models/image_mapping.go index 05436890..f32a24f4 100644 --- a/pkg/models/image_mapping.go +++ b/pkg/models/image_mapping.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,9 +24,11 @@ type ImageMapping struct { Links map[string]Href `json:"_links"` // The id of the region for which this mapping is defined. + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // Image mapping defined for the particular region. + // Example: { \"ubuntu\" : {\"externalRegionId\": \"us-east-1\", \"externalId\": \"ami-2c7b5656\", \"name\": \"ami-ubuntu-16.04\", \"description\": \"instance-store - HVM - supports - UTF-8 - tools\"} } // Required: true Mapping map[string]ImageMappingDescription `json:"mapping"` } @@ -49,6 +53,10 @@ func (m *ImageMapping) Validate(formats strfmt.Registry) error { func (m *ImageMapping) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -67,6 +75,10 @@ func (m *ImageMapping) validateLinks(formats strfmt.Registry) error { func (m *ImageMapping) validateMapping(formats strfmt.Registry) error { + if err := validate.Required("mapping", "body", m.Mapping); err != nil { + return err + } + for k := range m.Mapping { if err := validate.Required("mapping"+"."+k, "body", m.Mapping[k]); err != nil { @@ -83,6 +95,62 @@ func (m *ImageMapping) validateMapping(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image mapping based on the context it is used +func (m *ImageMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageMapping) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ImageMapping) contextValidateMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("mapping", "body", m.Mapping); err != nil { + return err + } + + for k := range m.Mapping { + + if val, ok := m.Mapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageMapping) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_mapping_description.go b/pkg/models/image_mapping_description.go index def56fba..86f1d38f 100644 --- a/pkg/models/image_mapping_description.go +++ b/pkg/models/image_mapping_description.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,53 +25,69 @@ type ImageMappingDescription struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Cloud config for this image. This cloud config will be merged during provisioning with other cloud configurations such as the bootConfig provided in MachineSpecification. + // Example: runcmd:\n - [\"mkdir\", \"/imageFolder\"] CloudConfig string `json:"cloudConfig,omitempty"` // Constraints that are used to drive placement policies for the image that is produced from this mapping.Constraint expressions are matched against tags on existing placement targets. + // Example: [{\"mandatory\" : \"true\", \"expression\": \"environment\":\"prod\"}, {\"mandatory\" : \"false\", \"expression\": \"pci\"}] Constraints []*Constraint `json:"constraints"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"prop1\" : \"value1\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The regionId of the image + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Indicates whether this fabric image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items + // Example: true IsPrivate bool `json:"isPrivate,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Operating System family of the image. + // Example: linux, win OsFamily string `json:"osFamily,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -102,6 +119,10 @@ func (m *ImageMappingDescription) Validate(formats strfmt.Registry) error { func (m *ImageMappingDescription) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -119,7 +140,6 @@ func (m *ImageMappingDescription) validateLinks(formats strfmt.Registry) error { } func (m *ImageMappingDescription) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -132,7 +152,6 @@ func (m *ImageMappingDescription) validateCloudAccountIds(formats strfmt.Registr } func (m *ImageMappingDescription) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -165,6 +184,61 @@ func (m *ImageMappingDescription) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image mapping description based on the context it is used +func (m *ImageMappingDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageMappingDescription) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ImageMappingDescription) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Constraints); i++ { + + if m.Constraints[i] != nil { + if err := m.Constraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageMappingDescription) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_profile.go b/pkg/models/image_profile.go index 09edfdf5..0ef2e712 100644 --- a/pkg/models/image_profile.go +++ b/pkg/models/image_profile.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,18 +24,23 @@ type ImageProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this image profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of the region for which this profile is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` @@ -42,18 +49,23 @@ type ImageProfile struct { ImageMappings *ImageMapping `json:"imageMappings"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -81,6 +93,10 @@ func (m *ImageProfile) Validate(formats strfmt.Registry) error { func (m *ImageProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -124,6 +140,57 @@ func (m *ImageProfile) validateImageMappings(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image profile based on the context it is used +func (m *ImageProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImageMappings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *ImageProfile) contextValidateImageMappings(ctx context.Context, formats strfmt.Registry) error { + + if m.ImageMappings != nil { + if err := m.ImageMappings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("imageMappings") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_profile_result.go b/pkg/models/image_profile_result.go index 0529fd45..a2b1dd9c 100644 --- a/pkg/models/image_profile_result.go +++ b/pkg/models/image_profile_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ImageProfileResult State object representing a query result of image profiles. @@ -23,10 +25,12 @@ type ImageProfileResult struct { Content []*ImageProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ImageProfileResult) Validate(formats strfmt.Registry) error { } func (m *ImageProfileResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ImageProfileResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image profile result based on the context it is used +func (m *ImageProfileResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageProfileResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*ImageProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ImageProfileResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ImageProfileResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageProfileResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_profile_specification.go b/pkg/models/image_profile_specification.go index d03d9981..48ac50fe 100644 --- a/pkg/models/image_profile_specification.go +++ b/pkg/models/image_profile_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,6 +23,7 @@ type ImageProfileSpecification struct { Description string `json:"description,omitempty"` // Image mapping defined for the corresponding region. + // Example: { \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"centos\": { \"id\": \"9e50\", \"name\": \"ami-centos-7-1.13.0-00-1543963388\"}} // Required: true ImageMapping map[string]FabricImageDescription `json:"imageMapping"` @@ -29,6 +32,7 @@ type ImageProfileSpecification struct { Name *string `json:"name"` // The id of the region for which this profile is created + // Example: 9e49 // Required: true RegionID *string `json:"regionId"` } @@ -57,6 +61,10 @@ func (m *ImageProfileSpecification) Validate(formats strfmt.Registry) error { func (m *ImageProfileSpecification) validateImageMapping(formats strfmt.Registry) error { + if err := validate.Required("imageMapping", "body", m.ImageMapping); err != nil { + return err + } + for k := range m.ImageMapping { if err := validate.Required("imageMapping"+"."+k, "body", m.ImageMapping[k]); err != nil { @@ -91,6 +99,39 @@ func (m *ImageProfileSpecification) validateRegionID(formats strfmt.Registry) er return nil } +// ContextValidate validate this image profile specification based on the context it is used +func (m *ImageProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImageMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageProfileSpecification) contextValidateImageMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("imageMapping", "body", m.ImageMapping); err != nil { + return err + } + + for k := range m.ImageMapping { + + if val, ok := m.ImageMapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/image_result.go b/pkg/models/image_result.go index 13d4a5c6..1c1ef52a 100644 --- a/pkg/models/image_result.go +++ b/pkg/models/image_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ImageResult State object representing a query result of image mappings. @@ -23,10 +25,12 @@ type ImageResult struct { Content []*ImageMapping `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ImageResult) Validate(formats strfmt.Registry) error { } func (m *ImageResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ImageResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image result based on the context it is used +func (m *ImageResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*ImageMapping(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ImageResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ImageResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/link.go b/pkg/models/link.go index b09fecc5..ec3d7e35 100644 --- a/pkg/models/link.go +++ b/pkg/models/link.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *Link) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this link based on context it is used +func (m *Link) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Link) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index 327dca91..c66d2f35 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,55 +25,71 @@ type LoadBalancer struct { Links map[string]Href `json:"_links"` // Primary address allocated or in use by this load balancer. The address could be an in the form of a publicly resolvable DNS name or an IP address. + // Example: lb-123456789.eu-west-1.elb.amazonaws.com Address string `json:"address,omitempty"` // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Defines logging level for collecting load balancer traffic logs. + // Example: ERROR, WARNING, INFO, DEBUG LoggingLevel string `json:"loggingLevel,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // The load balancer route configuration regarding ports and protocols. @@ -80,12 +97,15 @@ type LoadBalancer struct { Routes []*RouteConfiguration `json:"routes"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Define the type/variant of load balancer numbers e.g.for NSX the number virtual servers and pool members load balancer can host + // Example: Azure: BASIC, or STANDARD, AWS: Application, Network, or Classic, NSX: SMALL, MEDIUM, LARGE, EXTRA_LARGE Type string `json:"type,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -129,6 +149,10 @@ func (m *LoadBalancer) Validate(formats strfmt.Registry) error { func (m *LoadBalancer) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -146,7 +170,6 @@ func (m *LoadBalancer) validateLinks(formats strfmt.Registry) error { } func (m *LoadBalancer) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -211,7 +234,6 @@ func (m *LoadBalancer) validateRoutes(formats strfmt.Registry) error { } func (m *LoadBalancer) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -235,6 +257,83 @@ func (m *LoadBalancer) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this load balancer based on the context it is used +func (m *LoadBalancer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoutes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoadBalancer) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *LoadBalancer) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Routes); i++ { + + if m.Routes[i] != nil { + if err := m.Routes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoadBalancer) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *LoadBalancer) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/load_balancer_result.go b/pkg/models/load_balancer_result.go index 6dbc0614..d8ad1dcb 100644 --- a/pkg/models/load_balancer_result.go +++ b/pkg/models/load_balancer_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // LoadBalancerResult State object representing a query result of load balancecrs. @@ -23,10 +25,12 @@ type LoadBalancerResult struct { Content []*LoadBalancer `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *LoadBalancerResult) Validate(formats strfmt.Registry) error { } func (m *LoadBalancerResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *LoadBalancerResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this load balancer result based on the context it is used +func (m *LoadBalancerResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoadBalancerResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*LoadBalancer(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoadBalancerResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *LoadBalancerResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *LoadBalancerResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/load_balancer_specification.go b/pkg/models/load_balancer_specification.go index 4c646231..a0c7cdcb 100644 --- a/pkg/models/load_balancer_specification.go +++ b/pkg/models/load_balancer_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,10 +20,11 @@ import ( // swagger:model LoadBalancerSpecification type LoadBalancerSpecification struct { - // Additional custom properties that may be used to extend the load balancer. + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. @@ -32,6 +34,7 @@ type LoadBalancerSpecification struct { InternetFacing bool `json:"internetFacing,omitempty"` // Defines logging level for collecting load balancer traffic logs. + // Example: ERROR, WARNING, INFO, DEBUG LoggingLevel string `json:"loggingLevel,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -43,6 +46,7 @@ type LoadBalancerSpecification struct { Nics []*NetworkInterfaceSpecification `json:"nics"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` @@ -51,12 +55,15 @@ type LoadBalancerSpecification struct { Routes []*RouteConfiguration `json:"routes"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // A list of links to target load balancer pool members. Links can be to either a machine or a machine's network interface. + // Example: [ \"/iaas/machines/eac3d\" ] TargetLinks []string `json:"targetLinks"` // Define the type/variant of load balancer numbers e.g.for NSX the number virtual servers and pool members load balancer can host + // Example: SMALL, MEDIUM, LARGE Type string `json:"type,omitempty"` } @@ -159,7 +166,6 @@ func (m *LoadBalancerSpecification) validateRoutes(formats strfmt.Registry) erro } func (m *LoadBalancerSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -183,6 +189,82 @@ func (m *LoadBalancerSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this load balancer specification based on the context it is used +func (m *LoadBalancerSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoutes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoadBalancerSpecification) contextValidateNics(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Nics); i++ { + + if m.Nics[i] != nil { + if err := m.Nics[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoadBalancerSpecification) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Routes); i++ { + + if m.Routes[i] != nil { + if err := m.Routes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoadBalancerSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *LoadBalancerSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/machine.go b/pkg/models/machine.go index 36b6a386..d00b50f6 100644 --- a/pkg/models/machine.go +++ b/pkg/models/machine.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -25,63 +26,87 @@ type Machine struct { Links map[string]Href `json:"_links"` // Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address. + // Example: 34.242.21.5 Address string `json:"address,omitempty"` + // The cloud config data in json-escaped yaml syntax + BootConfig *MachineBootConfig `json:"bootConfig,omitempty"` + // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` + // Hostname associated with this machine instance. + Hostname string `json:"hostname,omitempty"` + // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Power state of machine. + // Example: ON, OFF // Required: true // Enum: [ON OFF GUEST_OFF UNKNOWN SUSPEND] PowerState *string `json:"powerState"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -93,6 +118,10 @@ func (m *Machine) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateBootConfig(formats); err != nil { + res = append(res, err) + } + if err := m.validateCloudAccountIds(formats); err != nil { res = append(res, err) } @@ -125,6 +154,10 @@ func (m *Machine) Validate(formats strfmt.Registry) error { func (m *Machine) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -141,8 +174,24 @@ func (m *Machine) validateLinks(formats strfmt.Registry) error { return nil } -func (m *Machine) validateCloudAccountIds(formats strfmt.Registry) error { +func (m *Machine) validateBootConfig(formats strfmt.Registry) error { + if swag.IsZero(m.BootConfig) { // not required + return nil + } + + if m.BootConfig != nil { + if err := m.BootConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bootConfig") + } + return err + } + } + return nil +} + +func (m *Machine) validateCloudAccountIds(formats strfmt.Registry) error { if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -234,7 +283,6 @@ func (m *Machine) validatePowerState(formats strfmt.Registry) error { } func (m *Machine) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -258,6 +306,79 @@ func (m *Machine) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this machine based on the context it is used +func (m *Machine) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBootConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Machine) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *Machine) contextValidateBootConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.BootConfig != nil { + if err := m.BootConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bootConfig") + } + return err + } + } + + return nil +} + +func (m *Machine) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Machine) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/machine_boot_config.go b/pkg/models/machine_boot_config.go index 2d4e2b85..faac50c8 100644 --- a/pkg/models/machine_boot_config.go +++ b/pkg/models/machine_boot_config.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -16,6 +18,7 @@ import ( type MachineBootConfig struct { // A valid cloud config data in json-escaped yaml syntax + // Example: #cloud-config\nrepo_update: true\nrepo_upgrade: all\n\npackages:\n - mysql-server\n\nruncmd:\n - sed -e '/bind-address/ s/^#*/#/' -i /etc/mysql/mysql.conf.d/mysqld.cnf\n - service mysql restart\n - mysql -e \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysqlpassword';\"\n - mysql -e \"FLUSH PRIVILEGES;\"\n Content string `json:"content,omitempty"` } @@ -24,6 +27,11 @@ func (m *MachineBootConfig) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this machine boot config based on context it is used +func (m *MachineBootConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MachineBootConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/machine_boot_config_settings.go b/pkg/models/machine_boot_config_settings.go index 32d69fd7..26810c50 100644 --- a/pkg/models/machine_boot_config_settings.go +++ b/pkg/models/machine_boot_config_settings.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -16,12 +18,15 @@ import ( type MachineBootConfigSettings struct { // In case a timeout occurs whether the provisioning process should fail or continue. + // Example: false PhoneHomeFailOnTimeout bool `json:"phoneHomeFailOnTimeout,omitempty"` // A phone_home module will be added to the Cloud Config and the provisioning will wait on a callback prior proceeding + // Example: true PhoneHomeShouldWait bool `json:"phoneHomeShouldWait,omitempty"` // The period of time to wait for the phone_home module callback to occur + // Example: 100 PhoneHomeTimeoutSeconds int32 `json:"phoneHomeTimeoutSeconds,omitempty"` } @@ -30,6 +35,11 @@ func (m *MachineBootConfigSettings) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this machine boot config settings based on context it is used +func (m *MachineBootConfigSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MachineBootConfigSettings) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/machine_result.go b/pkg/models/machine_result.go index 63c83e7b..b0f589e0 100644 --- a/pkg/models/machine_result.go +++ b/pkg/models/machine_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // MachineResult State object representing a query result of machines. @@ -23,10 +25,12 @@ type MachineResult struct { Content []*Machine `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *MachineResult) Validate(formats strfmt.Registry) error { } func (m *MachineResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *MachineResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this machine result based on the context it is used +func (m *MachineResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MachineResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Machine(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MachineResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *MachineResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *MachineResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/machine_specification.go b/pkg/models/machine_specification.go index 38b022f6..23c2a9fd 100644 --- a/pkg/models/machine_specification.go +++ b/pkg/models/machine_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -26,12 +27,14 @@ type MachineSpecification struct { BootConfigSettings *MachineBootConfigSettings `json:"bootConfigSettings,omitempty"` // Constraints that are used to drive placement policies for the virtual machine that is produced from this specification. Constraint expressions are matched against tags on existing placement targets. + // Example: [{\"mandatory\" : \"true\", \"expression\": \"environment\":\"prod\"}, {\"mandatory\" : \"false\", \"expression\": \"pci\"}] Constraints []*Constraint `json:"constraints"` - // Additional custom properties that may be used to extend the machine. + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // Describes machine within the scope of your organization and is not propagated to the cloud @@ -41,21 +44,26 @@ type MachineSpecification struct { Disks []*DiskAttachmentSpecification `json:"disks"` // Flavor of machine instance. + // Example: small, medium, large // Required: true Flavor *string `json:"flavor"` // Type of image used for this machine. + // Example: vmware-gold-master, ubuntu-latest, rhel-compliant, windows // Required: true Image *string `json:"image"` // Constraints that are used to drive placement policies for the image disk. Constraint expressions are matched against tags on existing placement targets. + // Example: [{\"mandatory\" : \"true\", \"expression\": \"environment:prod\"}, {\"mandatory\" : \"false\", \"expression\": \"pci\"}] ImageDiskConstraints []*Constraint `json:"imageDiskConstraints"` // Direct image reference used for this machine (name, path, location, uri, etc.). Valid if no image property is provided + // Example: ami-f6795a8c // Required: true ImageRef *string `json:"imageRef"` // Number of machines to provision - default 1. + // Example: 3 MachineCount int32 `json:"machineCount,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -66,6 +74,7 @@ type MachineSpecification struct { Nics []*NetworkInterfaceSpecification `json:"nics"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` @@ -73,6 +82,7 @@ type MachineSpecification struct { RemoteAccess *RemoteAccessSpecification `json:"remoteAccess,omitempty"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` } @@ -139,7 +149,6 @@ func (m *MachineSpecification) Validate(formats strfmt.Registry) error { } func (m *MachineSpecification) validateBootConfig(formats strfmt.Registry) error { - if swag.IsZero(m.BootConfig) { // not required return nil } @@ -157,7 +166,6 @@ func (m *MachineSpecification) validateBootConfig(formats strfmt.Registry) error } func (m *MachineSpecification) validateBootConfigSettings(formats strfmt.Registry) error { - if swag.IsZero(m.BootConfigSettings) { // not required return nil } @@ -175,7 +183,6 @@ func (m *MachineSpecification) validateBootConfigSettings(formats strfmt.Registr } func (m *MachineSpecification) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -200,7 +207,6 @@ func (m *MachineSpecification) validateConstraints(formats strfmt.Registry) erro } func (m *MachineSpecification) validateDisks(formats strfmt.Registry) error { - if swag.IsZero(m.Disks) { // not required return nil } @@ -243,7 +249,6 @@ func (m *MachineSpecification) validateImage(formats strfmt.Registry) error { } func (m *MachineSpecification) validateImageDiskConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.ImageDiskConstraints) { // not required return nil } @@ -286,7 +291,6 @@ func (m *MachineSpecification) validateName(formats strfmt.Registry) error { } func (m *MachineSpecification) validateNics(formats strfmt.Registry) error { - if swag.IsZero(m.Nics) { // not required return nil } @@ -320,7 +324,6 @@ func (m *MachineSpecification) validateProjectID(formats strfmt.Registry) error } func (m *MachineSpecification) validateRemoteAccess(formats strfmt.Registry) error { - if swag.IsZero(m.RemoteAccess) { // not required return nil } @@ -338,7 +341,6 @@ func (m *MachineSpecification) validateRemoteAccess(formats strfmt.Registry) err } func (m *MachineSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -362,6 +364,180 @@ func (m *MachineSpecification) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this machine specification based on the context it is used +func (m *MachineSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBootConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBootConfigSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImageDiskConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRemoteAccess(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MachineSpecification) contextValidateBootConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.BootConfig != nil { + if err := m.BootConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bootConfig") + } + return err + } + } + + return nil +} + +func (m *MachineSpecification) contextValidateBootConfigSettings(ctx context.Context, formats strfmt.Registry) error { + + if m.BootConfigSettings != nil { + if err := m.BootConfigSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bootConfigSettings") + } + return err + } + } + + return nil +} + +func (m *MachineSpecification) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Constraints); i++ { + + if m.Constraints[i] != nil { + if err := m.Constraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MachineSpecification) contextValidateDisks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Disks); i++ { + + if m.Disks[i] != nil { + if err := m.Disks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("disks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MachineSpecification) contextValidateImageDiskConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ImageDiskConstraints); i++ { + + if m.ImageDiskConstraints[i] != nil { + if err := m.ImageDiskConstraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("imageDiskConstraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MachineSpecification) contextValidateNics(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Nics); i++ { + + if m.Nics[i] != nil { + if err := m.Nics[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MachineSpecification) contextValidateRemoteAccess(ctx context.Context, formats strfmt.Registry) error { + + if m.RemoteAccess != nil { + if err := m.RemoteAccess.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteAccess") + } + return err + } + } + + return nil +} + +func (m *MachineSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *MachineSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_content.go b/pkg/models/marketplace_content.go index 8f8acb0c..9aed992c 100644 --- a/pkg/models/marketplace_content.go +++ b/pkg/models/marketplace_content.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -95,7 +96,6 @@ func (m *MarketplaceContent) Validate(formats strfmt.Registry) error { } func (m *MarketplaceContent) validateDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.Documents) { // not required return nil } @@ -120,7 +120,6 @@ func (m *MarketplaceContent) validateDocuments(formats strfmt.Registry) error { } func (m *MarketplaceContent) validateSupport(formats strfmt.Registry) error { - if swag.IsZero(m.Support) { // not required return nil } @@ -138,7 +137,6 @@ func (m *MarketplaceContent) validateSupport(formats strfmt.Registry) error { } func (m *MarketplaceContent) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -150,6 +148,56 @@ func (m *MarketplaceContent) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this marketplace content based on the context it is used +func (m *MarketplaceContent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupport(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceContent) contextValidateDocuments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Documents); i++ { + + if m.Documents[i] != nil { + if err := m.Documents[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("documents" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContent) contextValidateSupport(ctx context.Context, formats strfmt.Registry) error { + + if m.Support != nil { + if err := m.Support.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("support") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContent) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_content_download_request.go b/pkg/models/marketplace_content_download_request.go index c92b726b..a2a22dac 100644 --- a/pkg/models/marketplace_content_download_request.go +++ b/pkg/models/marketplace_content_download_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -193,7 +194,6 @@ func (m *MarketplaceContentDownloadRequest) validateContentType(formats strfmt.R } func (m *MarketplaceContentDownloadRequest) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -206,7 +206,6 @@ func (m *MarketplaceContentDownloadRequest) validateCreatedAt(formats strfmt.Reg } func (m *MarketplaceContentDownloadRequest) validateExecutionMessages(formats strfmt.Registry) error { - if swag.IsZero(m.ExecutionMessages) { // not required return nil } @@ -231,7 +230,6 @@ func (m *MarketplaceContentDownloadRequest) validateExecutionMessages(formats st } func (m *MarketplaceContentDownloadRequest) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -244,7 +242,6 @@ func (m *MarketplaceContentDownloadRequest) validateID(formats strfmt.Registry) } func (m *MarketplaceContentDownloadRequest) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -318,6 +315,107 @@ func (m *MarketplaceContentDownloadRequest) validateTargetType(formats strfmt.Re return nil } +// ContextValidate validate this marketplace content download request based on the context it is used +func (m *MarketplaceContentDownloadRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDownloadedContentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExecutionMessages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateDownloadedContentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "downloadedContentId", "body", string(m.DownloadedContentID)); err != nil { + return err + } + + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateExecutionMessages(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "executionMessages", "body", []*ExecutionMessage(m.ExecutionMessages)); err != nil { + return err + } + + for i := 0; i < len(m.ExecutionMessages); i++ { + + if m.ExecutionMessages[i] != nil { + if err := m.ExecutionMessages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("executionMessages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateLastUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastUpdatedAt", "body", strfmt.DateTime(m.LastUpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MarketplaceContentDownloadRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContentDownloadRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_content_link.go b/pkg/models/marketplace_content_link.go index 979587b5..751b60f3 100644 --- a/pkg/models/marketplace_content_link.go +++ b/pkg/models/marketplace_content_link.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *MarketplaceContentLink) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this marketplace content link based on context it is used +func (m *MarketplaceContentLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContentLink) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_content_review.go b/pkg/models/marketplace_content_review.go index ac0a1415..120a4c07 100644 --- a/pkg/models/marketplace_content_review.go +++ b/pkg/models/marketplace_content_review.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -39,6 +41,11 @@ func (m *MarketplaceContentReview) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this marketplace content review based on context it is used +func (m *MarketplaceContentReview) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContentReview) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_content_reviews.go b/pkg/models/marketplace_content_reviews.go index 1eaa9145..590234d1 100644 --- a/pkg/models/marketplace_content_reviews.go +++ b/pkg/models/marketplace_content_reviews.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *MarketplaceContentReviews) Validate(formats strfmt.Registry) error { } func (m *MarketplaceContentReviews) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *MarketplaceContentReviews) validateContent(formats strfmt.Registry) err } func (m *MarketplaceContentReviews) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *MarketplaceContentReviews) validateLinks(formats strfmt.Registry) error } func (m *MarketplaceContentReviews) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *MarketplaceContentReviews) validatePage(formats strfmt.Registry) error return nil } +// ContextValidate validate this marketplace content reviews based on the context it is used +func (m *MarketplaceContentReviews) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceContentReviews) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContentReviews) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContentReviews) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContentReviews) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_contents.go b/pkg/models/marketplace_contents.go index fafdd6de..9220c18c 100644 --- a/pkg/models/marketplace_contents.go +++ b/pkg/models/marketplace_contents.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *MarketplaceContents) Validate(formats strfmt.Registry) error { } func (m *MarketplaceContents) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *MarketplaceContents) validateContent(formats strfmt.Registry) error { } func (m *MarketplaceContents) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *MarketplaceContents) validateLinks(formats strfmt.Registry) error { } func (m *MarketplaceContents) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *MarketplaceContents) validatePage(formats strfmt.Registry) error { return nil } +// ContextValidate validate this marketplace contents based on the context it is used +func (m *MarketplaceContents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceContents) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContents) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceContents) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceContents) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_download_history.go b/pkg/models/marketplace_download_history.go index 05e7563f..8fbdfed7 100644 --- a/pkg/models/marketplace_download_history.go +++ b/pkg/models/marketplace_download_history.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *MarketplaceDownloadHistory) Validate(formats strfmt.Registry) error { } func (m *MarketplaceDownloadHistory) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *MarketplaceDownloadHistory) validateContent(formats strfmt.Registry) er } func (m *MarketplaceDownloadHistory) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *MarketplaceDownloadHistory) validateLinks(formats strfmt.Registry) erro } func (m *MarketplaceDownloadHistory) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *MarketplaceDownloadHistory) validatePage(formats strfmt.Registry) error return nil } +// ContextValidate validate this marketplace download history based on the context it is used +func (m *MarketplaceDownloadHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceDownloadHistory) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceDownloadHistory) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceDownloadHistory) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceDownloadHistory) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_download_history_item.go b/pkg/models/marketplace_download_history_item.go index b0777c99..525d6fbc 100644 --- a/pkg/models/marketplace_download_history_item.go +++ b/pkg/models/marketplace_download_history_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -124,7 +125,6 @@ func (m *MarketplaceDownloadHistoryItem) validateContentTypeEnum(path, location } func (m *MarketplaceDownloadHistoryItem) validateContentType(formats strfmt.Registry) error { - if swag.IsZero(m.ContentType) { // not required return nil } @@ -138,7 +138,6 @@ func (m *MarketplaceDownloadHistoryItem) validateContentType(formats strfmt.Regi } func (m *MarketplaceDownloadHistoryItem) validateDownloadedOn(formats strfmt.Registry) error { - if swag.IsZero(m.DownloadedOn) { // not required return nil } @@ -180,7 +179,6 @@ func (m *MarketplaceDownloadHistoryItem) validateStatusEnum(path, location strin } func (m *MarketplaceDownloadHistoryItem) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -220,7 +218,6 @@ func (m *MarketplaceDownloadHistoryItem) validateTargetTypeEnum(path, location s } func (m *MarketplaceDownloadHistoryItem) validateTargetType(formats strfmt.Registry) error { - if swag.IsZero(m.TargetType) { // not required return nil } @@ -234,7 +231,6 @@ func (m *MarketplaceDownloadHistoryItem) validateTargetType(formats strfmt.Regis } func (m *MarketplaceDownloadHistoryItem) validateUpdatedOn(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedOn) { // not required return nil } @@ -246,6 +242,11 @@ func (m *MarketplaceDownloadHistoryItem) validateUpdatedOn(formats strfmt.Regist return nil } +// ContextValidate validates this marketplace download history item based on context it is used +func (m *MarketplaceDownloadHistoryItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceDownloadHistoryItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_filter.go b/pkg/models/marketplace_filter.go index b74744d5..d523fcc3 100644 --- a/pkg/models/marketplace_filter.go +++ b/pkg/models/marketplace_filter.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -60,7 +61,6 @@ func (m *MarketplaceFilter) Validate(formats strfmt.Registry) error { } func (m *MarketplaceFilter) validateEntries(formats strfmt.Registry) error { - if swag.IsZero(m.Entries) { // not required return nil } @@ -110,7 +110,6 @@ func (m *MarketplaceFilter) validateTypeEnum(path, location string, value string } func (m *MarketplaceFilter) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -156,7 +155,6 @@ func (m *MarketplaceFilter) validateValueTypeEnum(path, location string, value s } func (m *MarketplaceFilter) validateValueType(formats strfmt.Registry) error { - if swag.IsZero(m.ValueType) { // not required return nil } @@ -169,6 +167,34 @@ func (m *MarketplaceFilter) validateValueType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this marketplace filter based on the context it is used +func (m *MarketplaceFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEntries(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceFilter) contextValidateEntries(ctx context.Context, formats strfmt.Registry) error { + + if m.Entries != nil { + if err := m.Entries.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entries") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceFilter) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_filter_entries.go b/pkg/models/marketplace_filter_entries.go index a17d8a23..94ef093f 100644 --- a/pkg/models/marketplace_filter_entries.go +++ b/pkg/models/marketplace_filter_entries.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *MarketplaceFilterEntries) Validate(formats strfmt.Registry) error { } func (m *MarketplaceFilterEntries) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *MarketplaceFilterEntries) validateContent(formats strfmt.Registry) erro } func (m *MarketplaceFilterEntries) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *MarketplaceFilterEntries) validateLinks(formats strfmt.Registry) error } func (m *MarketplaceFilterEntries) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *MarketplaceFilterEntries) validatePage(formats strfmt.Registry) error { return nil } +// ContextValidate validate this marketplace filter entries based on the context it is used +func (m *MarketplaceFilterEntries) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceFilterEntries) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceFilterEntries) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarketplaceFilterEntries) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceFilterEntries) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_filter_entry.go b/pkg/models/marketplace_filter_entry.go index f9706887..ad898b1e 100644 --- a/pkg/models/marketplace_filter_entry.go +++ b/pkg/models/marketplace_filter_entry.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -16,6 +18,7 @@ import ( type MarketplaceFilterEntry struct { // Entry count for this filter + // Example: 0 Count int64 `json:"count,omitempty"` // id @@ -30,6 +33,11 @@ func (m *MarketplaceFilterEntry) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this marketplace filter entry based on context it is used +func (m *MarketplaceFilterEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceFilterEntry) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/marketplace_filter_schema.go b/pkg/models/marketplace_filter_schema.go index 4efc5bcc..23c7f086 100644 --- a/pkg/models/marketplace_filter_schema.go +++ b/pkg/models/marketplace_filter_schema.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,7 +38,6 @@ func (m *MarketplaceFilterSchema) Validate(formats strfmt.Registry) error { } func (m *MarketplaceFilterSchema) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(m.Filters) { // not required return nil } @@ -61,6 +61,38 @@ func (m *MarketplaceFilterSchema) validateFilters(formats strfmt.Registry) error return nil } +// ContextValidate validate this marketplace filter schema based on the context it is used +func (m *MarketplaceFilterSchema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarketplaceFilterSchema) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Filters); i++ { + + if m.Filters[i] != nil { + if err := m.Filters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *MarketplaceFilterSchema) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering.go b/pkg/models/metering.go index 1ef91266..9c2d21d4 100644 --- a/pkg/models/metering.go +++ b/pkg/models/metering.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -90,7 +91,6 @@ func (m *Metering) validateChargeBasedOnEnum(path, location string, value string } func (m *Metering) validateChargeBasedOn(formats strfmt.Registry) error { - if swag.IsZero(m.ChargeBasedOn) { // not required return nil } @@ -136,7 +136,6 @@ func (m *Metering) validateChargeOnPowerStateEnum(path, location string, value s } func (m *Metering) validateChargeOnPowerState(formats strfmt.Registry) error { - if swag.IsZero(m.ChargeOnPowerState) { // not required return nil } @@ -185,7 +184,6 @@ func (m *Metering) validateChargePeriodEnum(path, location string, value string) } func (m *Metering) validateChargePeriod(formats strfmt.Registry) error { - if swag.IsZero(m.ChargePeriod) { // not required return nil } @@ -198,6 +196,11 @@ func (m *Metering) validateChargePeriod(formats strfmt.Registry) error { return nil } +// ContextValidate validates this metering based on context it is used +func (m *Metering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Metering) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering_assignment_strategy.go b/pkg/models/metering_assignment_strategy.go index 594d3661..59190ad8 100644 --- a/pkg/models/metering_assignment_strategy.go +++ b/pkg/models/metering_assignment_strategy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -73,7 +74,6 @@ func (m *MeteringAssignmentStrategy) validateEntityTypeEnum(path, location strin } func (m *MeteringAssignmentStrategy) validateEntityType(formats strfmt.Registry) error { - if swag.IsZero(m.EntityType) { // not required return nil } @@ -86,6 +86,11 @@ func (m *MeteringAssignmentStrategy) validateEntityType(formats strfmt.Registry) return nil } +// ContextValidate validates this metering assignment strategy based on context it is used +func (m *MeteringAssignmentStrategy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MeteringAssignmentStrategy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering_item.go b/pkg/models/metering_item.go index ac5ed1ba..6c14f104 100644 --- a/pkg/models/metering_item.go +++ b/pkg/models/metering_item.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -38,7 +40,6 @@ func (m *MeteringItem) Validate(formats strfmt.Registry) error { } func (m *MeteringItem) validateMetering(formats strfmt.Registry) error { - if swag.IsZero(m.Metering) { // not required return nil } @@ -55,6 +56,34 @@ func (m *MeteringItem) validateMetering(formats strfmt.Registry) error { return nil } +// ContextValidate validate this metering item based on the context it is used +func (m *MeteringItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMetering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MeteringItem) contextValidateMetering(ctx context.Context, formats strfmt.Registry) error { + + if m.Metering != nil { + if err := m.Metering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metering") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *MeteringItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering_policy.go b/pkg/models/metering_policy.go index 811aa4fc..0460e71b 100644 --- a/pkg/models/metering_policy.go +++ b/pkg/models/metering_policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -158,7 +159,6 @@ func (m *MeteringPolicy) validateChargeModelEnum(path, location string, value st } func (m *MeteringPolicy) validateChargeModel(formats strfmt.Registry) error { - if swag.IsZero(m.ChargeModel) { // not required return nil } @@ -172,7 +172,6 @@ func (m *MeteringPolicy) validateChargeModel(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -185,7 +184,6 @@ func (m *MeteringPolicy) validateCreatedAt(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateFixedPrice(formats strfmt.Registry) error { - if swag.IsZero(m.FixedPrice) { // not required return nil } @@ -203,7 +201,6 @@ func (m *MeteringPolicy) validateFixedPrice(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -216,7 +213,6 @@ func (m *MeteringPolicy) validateID(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -229,7 +225,6 @@ func (m *MeteringPolicy) validateLastUpdatedAt(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateMeteringItems(formats strfmt.Registry) error { - if swag.IsZero(m.MeteringItems) { // not required return nil } @@ -254,7 +249,6 @@ func (m *MeteringPolicy) validateMeteringItems(formats strfmt.Registry) error { } func (m *MeteringPolicy) validateNamedMeteringItems(formats strfmt.Registry) error { - if swag.IsZero(m.NamedMeteringItems) { // not required return nil } @@ -279,7 +273,6 @@ func (m *MeteringPolicy) validateNamedMeteringItems(formats strfmt.Registry) err } func (m *MeteringPolicy) validateOneTimeMeteringItems(formats strfmt.Registry) error { - if swag.IsZero(m.OneTimeMeteringItems) { // not required return nil } @@ -304,7 +297,6 @@ func (m *MeteringPolicy) validateOneTimeMeteringItems(formats strfmt.Registry) e } func (m *MeteringPolicy) validatePricingCardAssignmentInfo(formats strfmt.Registry) error { - if swag.IsZero(m.PricingCardAssignmentInfo) { // not required return nil } @@ -322,7 +314,6 @@ func (m *MeteringPolicy) validatePricingCardAssignmentInfo(formats strfmt.Regist } func (m *MeteringPolicy) validateTagBasedMeteringItems(formats strfmt.Registry) error { - if swag.IsZero(m.TagBasedMeteringItems) { // not required return nil } @@ -347,7 +338,6 @@ func (m *MeteringPolicy) validateTagBasedMeteringItems(formats strfmt.Registry) } func (m *MeteringPolicy) validateTagBasedOneTimeMeteringItems(formats strfmt.Registry) error { - if swag.IsZero(m.TagBasedOneTimeMeteringItems) { // not required return nil } @@ -372,7 +362,6 @@ func (m *MeteringPolicy) validateTagBasedOneTimeMeteringItems(formats strfmt.Reg } func (m *MeteringPolicy) validateTagBasedRateFactorItems(formats strfmt.Registry) error { - if swag.IsZero(m.TagBasedRateFactorItems) { // not required return nil } @@ -396,6 +385,184 @@ func (m *MeteringPolicy) validateTagBasedRateFactorItems(formats strfmt.Registry return nil } +// ContextValidate validate this metering policy based on the context it is used +func (m *MeteringPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFixedPrice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeteringItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNamedMeteringItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOneTimeMeteringItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePricingCardAssignmentInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagBasedMeteringItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagBasedOneTimeMeteringItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagBasedRateFactorItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MeteringPolicy) contextValidateFixedPrice(ctx context.Context, formats strfmt.Registry) error { + + if m.FixedPrice != nil { + if err := m.FixedPrice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fixedPrice") + } + return err + } + } + + return nil +} + +func (m *MeteringPolicy) contextValidateMeteringItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MeteringItems); i++ { + + if m.MeteringItems[i] != nil { + if err := m.MeteringItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meteringItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MeteringPolicy) contextValidateNamedMeteringItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NamedMeteringItems); i++ { + + if m.NamedMeteringItems[i] != nil { + if err := m.NamedMeteringItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("namedMeteringItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MeteringPolicy) contextValidateOneTimeMeteringItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OneTimeMeteringItems); i++ { + + if m.OneTimeMeteringItems[i] != nil { + if err := m.OneTimeMeteringItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oneTimeMeteringItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MeteringPolicy) contextValidatePricingCardAssignmentInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.PricingCardAssignmentInfo != nil { + if err := m.PricingCardAssignmentInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pricingCardAssignmentInfo") + } + return err + } + } + + return nil +} + +func (m *MeteringPolicy) contextValidateTagBasedMeteringItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagBasedMeteringItems); i++ { + + if m.TagBasedMeteringItems[i] != nil { + if err := m.TagBasedMeteringItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagBasedMeteringItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MeteringPolicy) contextValidateTagBasedOneTimeMeteringItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagBasedOneTimeMeteringItems); i++ { + + if m.TagBasedOneTimeMeteringItems[i] != nil { + if err := m.TagBasedOneTimeMeteringItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagBasedOneTimeMeteringItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MeteringPolicy) contextValidateTagBasedRateFactorItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagBasedRateFactorItems); i++ { + + if m.TagBasedRateFactorItems[i] != nil { + if err := m.TagBasedRateFactorItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagBasedRateFactorItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *MeteringPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering_policy_assignment.go b/pkg/models/metering_policy_assignment.go index 61b455b9..1bbb48ab 100644 --- a/pkg/models/metering_policy_assignment.go +++ b/pkg/models/metering_policy_assignment.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -85,7 +86,6 @@ func (m *MeteringPolicyAssignment) Validate(formats strfmt.Registry) error { } func (m *MeteringPolicyAssignment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -130,7 +130,6 @@ func (m *MeteringPolicyAssignment) validateEntityTypeEnum(path, location string, } func (m *MeteringPolicyAssignment) validateEntityType(formats strfmt.Registry) error { - if swag.IsZero(m.EntityType) { // not required return nil } @@ -144,7 +143,6 @@ func (m *MeteringPolicyAssignment) validateEntityType(formats strfmt.Registry) e } func (m *MeteringPolicyAssignment) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -157,7 +155,6 @@ func (m *MeteringPolicyAssignment) validateID(formats strfmt.Registry) error { } func (m *MeteringPolicyAssignment) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -170,7 +167,6 @@ func (m *MeteringPolicyAssignment) validateLastUpdatedAt(formats strfmt.Registry } func (m *MeteringPolicyAssignment) validatePricingCardID(formats strfmt.Registry) error { - if swag.IsZero(m.PricingCardID) { // not required return nil } @@ -182,6 +178,11 @@ func (m *MeteringPolicyAssignment) validatePricingCardID(formats strfmt.Registry return nil } +// ContextValidate validates this metering policy assignment based on context it is used +func (m *MeteringPolicyAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MeteringPolicyAssignment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/metering_policy_assignment_info.go b/pkg/models/metering_policy_assignment_info.go index 14a4c02c..642fc2b3 100644 --- a/pkg/models/metering_policy_assignment_info.go +++ b/pkg/models/metering_policy_assignment_info.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -74,7 +75,6 @@ func (m *MeteringPolicyAssignmentInfo) validateEntityTypeEnum(path, location str } func (m *MeteringPolicyAssignmentInfo) validateEntityType(formats strfmt.Registry) error { - if swag.IsZero(m.EntityType) { // not required return nil } @@ -87,6 +87,11 @@ func (m *MeteringPolicyAssignmentInfo) validateEntityType(formats strfmt.Registr return nil } +// ContextValidate validates this metering policy assignment info based on context it is used +func (m *MeteringPolicyAssignmentInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MeteringPolicyAssignmentInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/named_metering.go b/pkg/models/named_metering.go index 41ed8b40..99295187 100644 --- a/pkg/models/named_metering.go +++ b/pkg/models/named_metering.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -38,7 +40,6 @@ func (m *NamedMetering) Validate(formats strfmt.Registry) error { } func (m *NamedMetering) validateMetering(formats strfmt.Registry) error { - if swag.IsZero(m.Metering) { // not required return nil } @@ -55,6 +56,34 @@ func (m *NamedMetering) validateMetering(formats strfmt.Registry) error { return nil } +// ContextValidate validate this named metering based on the context it is used +func (m *NamedMetering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMetering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NamedMetering) contextValidateMetering(ctx context.Context, formats strfmt.Registry) error { + + if m.Metering != nil { + if err := m.Metering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metering") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *NamedMetering) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/named_metering_item.go b/pkg/models/named_metering_item.go index 29fc0d7c..c107d3df 100644 --- a/pkg/models/named_metering_item.go +++ b/pkg/models/named_metering_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,6 @@ func (m *NamedMeteringItem) Validate(formats strfmt.Registry) error { } func (m *NamedMeteringItem) validateNamedMeterings(formats strfmt.Registry) error { - if swag.IsZero(m.NamedMeterings) { // not required return nil } @@ -64,6 +64,38 @@ func (m *NamedMeteringItem) validateNamedMeterings(formats strfmt.Registry) erro return nil } +// ContextValidate validate this named metering item based on the context it is used +func (m *NamedMeteringItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNamedMeterings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NamedMeteringItem) contextValidateNamedMeterings(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NamedMeterings); i++ { + + if m.NamedMeterings[i] != nil { + if err := m.NamedMeterings[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("namedMeterings" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NamedMeteringItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/nat_rule.go b/pkg/models/nat_rule.go index d7ad9234..ff926d93 100644 --- a/pkg/models/nat_rule.go +++ b/pkg/models/nat_rule.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -20,35 +22,50 @@ type NatRule struct { // Description of the NAT rule. Description string `json:"description,omitempty"` - // The edge gateway port - // Required: true - DestinationPorts *string `json:"destinationPorts"` + // The external IP address of the outbound or routed network + // Example: any, 10.20.156.101 + // Read Only: true + DestinationAddress string `json:"destinationAddress,omitempty"` + + // The edge gateway port. Default is `any` + // Example: any, 80, 5000-5100 + DestinationPorts string `json:"destinationPorts,omitempty"` // Index in which the rule must be applied // Required: true Index *int32 `json:"index"` - // Kind of NAT: NAT44/NAT64/NAT66. Only NAT44 is supported currently + // Kind of NAT: NAT44/NAT64/NAT66. Only NAT44 is supported currently and it is the default value + // Example: NAT44 Kind string `json:"kind,omitempty"` // The protocol of the incoming requests. Default is TCP. + // Example: TCP, UDP Protocol string `json:"protocol,omitempty"` + // Unique ID of the NAT Rule + // Read Only: true + RuleID string `json:"ruleId,omitempty"` + // The IP of the external source. Default is `any` + // Example: any, 10.20.156.101 SourceIPs string `json:"sourceIPs,omitempty"` // Ports from where the request is originating. Default is `any` + // Example: any, 80, 5000-5100 SourcePorts string `json:"sourcePorts,omitempty"` // A links to target load balancer or a machine's network interface where the request will be forwarded. + // Example: /iaas/api/load-balancers/try6-45ef, /iaas/api/machines/ht54-a472/network-interfaces/dyd6-d67e // Required: true TargetLink *string `json:"targetLink"` - // The machine port where the request will be forwarded - // Required: true - TranslatedPorts *string `json:"translatedPorts"` + // The machine port where the request will be forwarded. Default is `any` + // Example: any, 80, 5000-5100 + TranslatedPorts string `json:"translatedPorts,omitempty"` // Type of the NAT rule. Only DNAT is supported currently. + // Example: DNAT Type string `json:"type,omitempty"` } @@ -56,10 +73,6 @@ type NatRule struct { func (m *NatRule) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDestinationPorts(formats); err != nil { - res = append(res, err) - } - if err := m.validateIndex(formats); err != nil { res = append(res, err) } @@ -68,46 +81,60 @@ func (m *NatRule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateTranslatedPorts(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } -func (m *NatRule) validateDestinationPorts(formats strfmt.Registry) error { +func (m *NatRule) validateIndex(formats strfmt.Registry) error { - if err := validate.Required("destinationPorts", "body", m.DestinationPorts); err != nil { + if err := validate.Required("index", "body", m.Index); err != nil { return err } return nil } -func (m *NatRule) validateIndex(formats strfmt.Registry) error { +func (m *NatRule) validateTargetLink(formats strfmt.Registry) error { - if err := validate.Required("index", "body", m.Index); err != nil { + if err := validate.Required("targetLink", "body", m.TargetLink); err != nil { return err } return nil } -func (m *NatRule) validateTargetLink(formats strfmt.Registry) error { +// ContextValidate validate this nat rule based on the context it is used +func (m *NatRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if err := validate.Required("targetLink", "body", m.TargetLink); err != nil { + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRuleID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NatRule) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationAddress", "body", string(m.DestinationAddress)); err != nil { return err } return nil } -func (m *NatRule) validateTranslatedPorts(formats strfmt.Registry) error { +func (m *NatRule) contextValidateRuleID(ctx context.Context, formats strfmt.Registry) error { - if err := validate.Required("translatedPorts", "body", m.TranslatedPorts); err != nil { + if err := validate.ReadOnly(ctx, "ruleId", "body", string(m.RuleID)); err != nil { return err } diff --git a/pkg/models/network.go b/pkg/models/network.go index fbd082a7..efef7124 100644 --- a/pkg/models/network.go +++ b/pkg/models/network.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -26,59 +27,76 @@ type Network struct { Links map[string]Href `json:"_links"` // IPv4 address range of the network in CIDR format + // Example: 10.10.0.0/16 // Required: true Cidr *string `json:"cidr"` // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -122,6 +140,10 @@ func (m *Network) Validate(formats strfmt.Registry) error { func (m *Network) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -148,7 +170,6 @@ func (m *Network) validateCidr(formats strfmt.Registry) error { } func (m *Network) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -188,7 +209,6 @@ func (m *Network) validateID(formats strfmt.Registry) error { } func (m *Network) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -212,6 +232,61 @@ func (m *Network) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network based on the context it is used +func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Network) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *Network) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Network) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_domain.go b/pkg/models/network_domain.go index 132a9c23..cdc95af0 100644 --- a/pkg/models/network_domain.go +++ b/pkg/models/network_domain.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,63 @@ type NetworkDomain struct { Links map[string]Href `json:"_links"` // IPv4 address range of the network domain in CIDR format + // Example: 10.0.0.0/8 // Required: true Cidr *string `json:"cidr"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"awsGatewayID\" : \"igw-f9539691\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the network domain. + // Example: ap-northeast-2 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this network domain. + // Example: [ { \"key\" : \"vmware.enumeration.type\", \"value\": \"nec2_vpc\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -106,6 +121,10 @@ func (m *NetworkDomain) Validate(formats strfmt.Registry) error { func (m *NetworkDomain) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -132,7 +151,6 @@ func (m *NetworkDomain) validateCidr(formats strfmt.Registry) error { } func (m *NetworkDomain) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -163,7 +181,6 @@ func (m *NetworkDomain) validateID(formats strfmt.Registry) error { } func (m *NetworkDomain) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -187,6 +204,61 @@ func (m *NetworkDomain) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network domain based on the context it is used +func (m *NetworkDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkDomain) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *NetworkDomain) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkDomain) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_domain_result.go b/pkg/models/network_domain_result.go index c699f895..291de148 100644 --- a/pkg/models/network_domain_result.go +++ b/pkg/models/network_domain_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NetworkDomainResult State object representing a query result of network domains. @@ -23,10 +25,12 @@ type NetworkDomainResult struct { Content []*NetworkDomain `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *NetworkDomainResult) Validate(formats strfmt.Registry) error { } func (m *NetworkDomainResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *NetworkDomainResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network domain result based on the context it is used +func (m *NetworkDomainResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkDomainResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*NetworkDomain(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NetworkDomainResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *NetworkDomainResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkDomainResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_interface.go b/pkg/models/network_interface.go index 4a855a7f..b23d6b78 100644 --- a/pkg/models/network_interface.go +++ b/pkg/models/network_interface.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,54 +25,69 @@ type NetworkInterface struct { Links map[string]Href `json:"_links"` // A list of IP addresses allocated or in use by this network interface. + // Example: [ \"10.1.2.190\" ] Addresses []string `json:"addresses"` // Set of ids of the cloud accounts this entity belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base type. + // Example: { \"awaitIp\" : \"true\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The device index of this network interface. + // Example: 1 DeviceIndex int32 `json:"deviceIndex,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the network interface. + // Example: ap-northeast-2 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A list of security group ids this network interface is associated with SecurityGroupIds []string `json:"securityGroupIds"` // A set of tag keys and optional values that were set on this network interface. + // Example: [ { \"key\" : \"vmware.enumeration.type\", \"value\": \"nec2_net_interface\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -107,6 +123,10 @@ func (m *NetworkInterface) Validate(formats strfmt.Registry) error { func (m *NetworkInterface) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -124,7 +144,6 @@ func (m *NetworkInterface) validateLinks(formats strfmt.Registry) error { } func (m *NetworkInterface) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -155,7 +174,6 @@ func (m *NetworkInterface) validateID(formats strfmt.Registry) error { } func (m *NetworkInterface) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -179,6 +197,61 @@ func (m *NetworkInterface) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network interface based on the context it is used +func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkInterface) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *NetworkInterface) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkInterface) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_interface_specification.go b/pkg/models/network_interface_specification.go index 4194af81..8f792905 100644 --- a/pkg/models/network_interface_specification.go +++ b/pkg/models/network_interface_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,21 +20,25 @@ import ( type NetworkInterfaceSpecification struct { // A list of IP addresses allocated or in use by this network interface. + // Example: [ \"10.1.2.190\" ] Addresses []string `json:"addresses"` // Additional properties that may be used to extend the base type. + // Example: { \"awaitIp\" : \"true\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // The device index of this network interface. + // Example: 1 DeviceIndex int32 `json:"deviceIndex,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. Name string `json:"name,omitempty"` // Id of the network instance that this network interface plugs into. + // Example: dcd9 // Required: true NetworkID *string `json:"networkId"` @@ -63,6 +69,11 @@ func (m *NetworkInterfaceSpecification) validateNetworkID(formats strfmt.Registr return nil } +// ContextValidate validates this network interface specification based on context it is used +func (m *NetworkInterfaceSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkInterfaceSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_ip_range.go b/pkg/models/network_ip_range.go index 37638ef7..a4495cc0 100644 --- a/pkg/models/network_ip_range.go +++ b/pkg/models/network_ip_range.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -25,9 +26,11 @@ type NetworkIPRange struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // End IP address of the range. @@ -35,9 +38,11 @@ type NetworkIPRange struct { EndIPAddress *string `json:"endIPAddress"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` @@ -46,15 +51,19 @@ type NetworkIPRange struct { IPVersion string `json:"ipVersion,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Start IP address of the range. @@ -62,9 +71,11 @@ type NetworkIPRange struct { StartIPAddress *string `json:"startIPAddress"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"ipv6-range\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -104,6 +115,10 @@ func (m *NetworkIPRange) Validate(formats strfmt.Registry) error { func (m *NetworkIPRange) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -168,7 +183,6 @@ func (m *NetworkIPRange) validateIPVersionEnum(path, location string, value stri } func (m *NetworkIPRange) validateIPVersion(formats strfmt.Registry) error { - if swag.IsZero(m.IPVersion) { // not required return nil } @@ -191,7 +205,6 @@ func (m *NetworkIPRange) validateStartIPAddress(formats strfmt.Registry) error { } func (m *NetworkIPRange) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -215,6 +228,61 @@ func (m *NetworkIPRange) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network IP range based on the context it is used +func (m *NetworkIPRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkIPRange) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *NetworkIPRange) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkIPRange) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_ip_range_result.go b/pkg/models/network_ip_range_result.go index 62897d93..4755b71f 100644 --- a/pkg/models/network_ip_range_result.go +++ b/pkg/models/network_ip_range_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NetworkIPRangeResult State object representing a query result of network IP range. @@ -23,10 +25,12 @@ type NetworkIPRangeResult struct { Content []*NetworkIPRange `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *NetworkIPRangeResult) Validate(formats strfmt.Registry) error { } func (m *NetworkIPRangeResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *NetworkIPRangeResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network IP range result based on the context it is used +func (m *NetworkIPRangeResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkIPRangeResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*NetworkIPRange(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NetworkIPRangeResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *NetworkIPRangeResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkIPRangeResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_ip_range_specification.go b/pkg/models/network_ip_range_specification.go index 59c2a221..63e9ea1e 100644 --- a/pkg/models/network_ip_range_specification.go +++ b/pkg/models/network_ip_range_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -43,6 +44,7 @@ type NetworkIPRangeSpecification struct { StartIPAddress *string `json:"startIPAddress"` // A set of tag keys and optional values that were set on this resource instance. + // Example: [ { \"key\" : \"fast-network\", \"value\": \"true\" } ] Tags []*Tag `json:"tags"` } @@ -115,7 +117,6 @@ func (m *NetworkIPRangeSpecification) validateIPVersionEnum(path, location strin } func (m *NetworkIPRangeSpecification) validateIPVersion(formats strfmt.Registry) error { - if swag.IsZero(m.IPVersion) { // not required return nil } @@ -147,7 +148,6 @@ func (m *NetworkIPRangeSpecification) validateStartIPAddress(formats strfmt.Regi } func (m *NetworkIPRangeSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -171,6 +171,38 @@ func (m *NetworkIPRangeSpecification) validateTags(formats strfmt.Registry) erro return nil } +// ContextValidate validate this network IP range specification based on the context it is used +func (m *NetworkIPRangeSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkIPRangeSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkIPRangeSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_profile.go b/pkg/models/network_profile.go index a5028955..97b3346b 100644 --- a/pkg/models/network_profile.go +++ b/pkg/models/network_profile.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -25,21 +26,27 @@ type NetworkProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the Network Profile object that is produced from this specification. For isolationType security group, datastoreId identifies the Compute Resource Edge datastore. computeCluster and resourcePoolId identify the Compute Resource Edge cluster. For isolationType subnet, distributedLogicalRouterStateLink identifies the on-demand network distributed local router. onDemandNetworkIPAssignmentType identifies the on-demand network IP range assignment type static, dynamic, or mixed. + // Example: { \"resourcePoolId\" : \"resource-pool-1\", \"datastoreId\" : \"StoragePod:group-p87839\", \"computeCluster\" : \"/resources/compute/1234\", \"distributedLogicalRouterStateLink\" : \"/resources/routers/1234\", \"onDemandNetworkIPAssignmentType\" : \"dynamic\"} CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of the region for which this profile is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` @@ -54,21 +61,27 @@ type NetworkProfile struct { IsolationType string `json:"isolationType,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // A set of tag keys and optional values that were set on this Network Profile. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -100,6 +113,10 @@ func (m *NetworkProfile) Validate(formats strfmt.Registry) error { func (m *NetworkProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -158,7 +175,6 @@ func (m *NetworkProfile) validateIsolationTypeEnum(path, location string, value } func (m *NetworkProfile) validateIsolationType(formats strfmt.Registry) error { - if swag.IsZero(m.IsolationType) { // not required return nil } @@ -172,7 +188,6 @@ func (m *NetworkProfile) validateIsolationType(formats strfmt.Registry) error { } func (m *NetworkProfile) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -196,6 +211,61 @@ func (m *NetworkProfile) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network profile based on the context it is used +func (m *NetworkProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *NetworkProfile) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_profile_result.go b/pkg/models/network_profile_result.go index c7f291e8..4ef29255 100644 --- a/pkg/models/network_profile_result.go +++ b/pkg/models/network_profile_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NetworkProfileResult State object representing a query result of network profiles. @@ -23,10 +25,12 @@ type NetworkProfileResult struct { Content []*NetworkProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *NetworkProfileResult) Validate(formats strfmt.Registry) error { } func (m *NetworkProfileResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *NetworkProfileResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network profile result based on the context it is used +func (m *NetworkProfileResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkProfileResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*NetworkProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NetworkProfileResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *NetworkProfileResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkProfileResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_profile_specification.go b/pkg/models/network_profile_specification.go index 2b7db500..9ddd3640 100644 --- a/pkg/models/network_profile_specification.go +++ b/pkg/models/network_profile_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -21,34 +22,43 @@ import ( type NetworkProfileSpecification struct { // Additional properties that may be used to extend the Network Profile object that is produced from this specification. For isolationType security group, datastoreId identifies the Compute Resource Edge datastore. computeCluster and resourcePoolId identify the Compute Resource Edge cluster. For isolationType subnet, distributedLogicalRouterStateLink identifies the on-demand network distributed local router. onDemandNetworkIPAssignmentType identifies the on-demand network IP range assignment type static, dynamic, or mixed. + // Example: { \"resourcePoolId\" : \"resource-pool-1\", \"datastoreId\" : \"StoragePod:group-p87839\", \"computeCluster\" : \"/resources/compute/1234\", \"distributedLogicalRouterStateLink\" : \"/resources/routers/1234\", \"onDemandNetworkIPAssignmentType\" : \"dynamic\"} CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // List of external IP blocks coming from an external IPAM provider that can be used to create subnetworks inside them + // Example: [\"3e2bb9bc-6a6a-11ea-bc55-0242ac130003\"] ExternalIPBlockIds []string `json:"externalIpBlockIds"` // A list of fabric network Ids which are assigned to the network profile. + // Example: [ \"6543\" ] FabricNetworkIds []string `json:"fabricNetworkIds"` // The CIDR prefix length to be used for the isolated networks that are created with the network profile. + // Example: 24 IsolatedNetworkCIDRPrefix int32 `json:"isolatedNetworkCIDRPrefix,omitempty"` // The Id of the fabric network used for outbound access. + // Example: 1234 IsolationExternalFabricNetworkID string `json:"isolationExternalFabricNetworkId,omitempty"` // CIDR of the isolation network domain. + // Example: 10.10.10.0/24 IsolationNetworkDomainCIDR string `json:"isolationNetworkDomainCIDR,omitempty"` // The Id of the network domain used for creating isolated networks. + // Example: 1234 IsolationNetworkDomainID string `json:"isolationNetworkDomainId,omitempty"` // Specifies the isolation type e.g. none, subnet or security group + // Example: SUBNET // Enum: [NONE SUBNET SECURITY_GROUP] IsolationType string `json:"isolationType,omitempty"` // A list of load balancers which are assigned to the network profile. + // Example: [ \"6545\" ] LoadBalancerIds []string `json:"loadBalancerIds"` // A human-friendly name used as an identifier in APIs that support this option. @@ -56,13 +66,16 @@ type NetworkProfileSpecification struct { Name *string `json:"name"` // The Id of the region for which this profile is created + // Example: 9e49 // Required: true RegionID *string `json:"regionId"` // A list of security group Ids which are assigned to the network profile. + // Example: [ \"6545\" ] SecurityGroupIds []string `json:"securityGroupIds"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"dev\", \"value\": \"hard\" } ] Tags []*Tag `json:"tags"` } @@ -125,7 +138,6 @@ func (m *NetworkProfileSpecification) validateIsolationTypeEnum(path, location s } func (m *NetworkProfileSpecification) validateIsolationType(formats strfmt.Registry) error { - if swag.IsZero(m.IsolationType) { // not required return nil } @@ -157,7 +169,6 @@ func (m *NetworkProfileSpecification) validateRegionID(formats strfmt.Registry) } func (m *NetworkProfileSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -181,6 +192,38 @@ func (m *NetworkProfileSpecification) validateTags(formats strfmt.Registry) erro return nil } +// ContextValidate validate this network profile specification based on the context it is used +func (m *NetworkProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkProfileSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_result.go b/pkg/models/network_result.go index 420d4fe7..86aa3e02 100644 --- a/pkg/models/network_result.go +++ b/pkg/models/network_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NetworkResult State object representing a query result of networks. @@ -23,10 +25,12 @@ type NetworkResult struct { Content []*Network `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *NetworkResult) Validate(formats strfmt.Registry) error { } func (m *NetworkResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *NetworkResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network result based on the context it is used +func (m *NetworkResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Network(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NetworkResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *NetworkResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/network_specification.go b/pkg/models/network_specification.go index e82a80cc..27b3d8da 100644 --- a/pkg/models/network_specification.go +++ b/pkg/models/network_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,12 +21,18 @@ import ( type NetworkSpecification struct { // Constraints that are used to drive placement policies for the network that is produced from this specification, related with the network profile. Constraint expressions are matched against tags on existing placement targets. + // Example: [{\"mandatory\" : \"true\", \"expression\": \"environment\":\"prod\"}, {\"mandatory\" : \"false\", \"expression\": \"pci\"}] Constraints []*Constraint `json:"constraints"` - // Additional custom properties that may be used to extend the network. + // Flag to indicate if the network creation should create a gateway. Default is true. + // Example: true + CreateGateway bool `json:"createGateway,omitempty"` + + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. @@ -36,13 +43,16 @@ type NetworkSpecification struct { Name *string `json:"name"` // Flag to indicate if the network needs to have outbound access or not. Default is true. This field will be ignored if there is proper input for networkType customProperty + // Example: true OutboundAccess bool `json:"outboundAccess,omitempty"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"vmware.enumeration.type\", \"value\": \"nec2_vpc\" } ] Tags []*Tag `json:"tags"` } @@ -73,7 +83,6 @@ func (m *NetworkSpecification) Validate(formats strfmt.Registry) error { } func (m *NetworkSpecification) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -116,7 +125,6 @@ func (m *NetworkSpecification) validateProjectID(formats strfmt.Registry) error } func (m *NetworkSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -140,6 +148,60 @@ func (m *NetworkSpecification) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network specification based on the context it is used +func (m *NetworkSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkSpecification) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Constraints); i++ { + + if m.Constraints[i] != nil { + if err := m.Constraints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NetworkSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/nsx_account.go b/pkg/models/nsx_account.go index 65d6946c..cf39cbaa 100644 --- a/pkg/models/nsx_account.go +++ b/pkg/models/nsx_account.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *NsxAccount) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this nsx account based on context it is used +func (m *NsxAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NsxAccount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/one_time_metering.go b/pkg/models/one_time_metering.go index 068c957b..aef9d2c2 100644 --- a/pkg/models/one_time_metering.go +++ b/pkg/models/one_time_metering.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *OneTimeMetering) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this one time metering based on context it is used +func (m *OneTimeMetering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OneTimeMetering) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/one_time_metering_item.go b/pkg/models/one_time_metering_item.go index 7d798c62..0d0f4b1b 100644 --- a/pkg/models/one_time_metering_item.go +++ b/pkg/models/one_time_metering_item.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -38,7 +40,6 @@ func (m *OneTimeMeteringItem) Validate(formats strfmt.Registry) error { } func (m *OneTimeMeteringItem) validateOneTimeMetering(formats strfmt.Registry) error { - if swag.IsZero(m.OneTimeMetering) { // not required return nil } @@ -55,6 +56,34 @@ func (m *OneTimeMeteringItem) validateOneTimeMetering(formats strfmt.Registry) e return nil } +// ContextValidate validate this one time metering item based on the context it is used +func (m *OneTimeMeteringItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOneTimeMetering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OneTimeMeteringItem) contextValidateOneTimeMetering(ctx context.Context, formats strfmt.Registry) error { + + if m.OneTimeMetering != nil { + if err := m.OneTimeMetering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oneTimeMetering") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *OneTimeMeteringItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/output_value.go b/pkg/models/output_value.go index ec3dd719..32f75ffb 100644 --- a/pkg/models/output_value.go +++ b/pkg/models/output_value.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *OutputValue) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this output value based on context it is used +func (m *OutputValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OutputValue) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page.go b/pkg/models/page.go index 65b1e64a..f2598be4 100644 --- a/pkg/models/page.go +++ b/pkg/models/page.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,6 +28,11 @@ func (m *Page) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this page based on context it is used +func (m *Page) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Page) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_metadata.go b/pkg/models/page_metadata.go index 9eeb91ed..536818ef 100644 --- a/pkg/models/page_metadata.go +++ b/pkg/models/page_metadata.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -33,6 +35,11 @@ func (m *PageMetadata) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this page metadata based on context it is used +func (m *PageMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PageMetadata) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_blueprint.go b/pkg/models/page_of_blueprint.go index 5d03d5ce..fdb64109 100644 --- a/pkg/models/page_of_blueprint.go +++ b/pkg/models/page_of_blueprint.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfBlueprint) Validate(formats strfmt.Registry) error { } func (m *PageOfBlueprint) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfBlueprint) validateContent(formats strfmt.Registry) error { } func (m *PageOfBlueprint) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfBlueprint) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of blueprint based on the context it is used +func (m *PageOfBlueprint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfBlueprint) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfBlueprint) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfBlueprint) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_blueprint_content_source.go b/pkg/models/page_of_blueprint_content_source.go index 10be2cc9..ff8f6a84 100644 --- a/pkg/models/page_of_blueprint_content_source.go +++ b/pkg/models/page_of_blueprint_content_source.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfBlueprintContentSource) Validate(formats strfmt.Registry) error { } func (m *PageOfBlueprintContentSource) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfBlueprintContentSource) validateContent(formats strfmt.Registry) } func (m *PageOfBlueprintContentSource) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfBlueprintContentSource) validateSort(formats strfmt.Registry) err return nil } +// ContextValidate validate this page of blueprint content source based on the context it is used +func (m *PageOfBlueprintContentSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfBlueprintContentSource) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfBlueprintContentSource) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfBlueprintContentSource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_blueprint_request.go b/pkg/models/page_of_blueprint_request.go index 11723e44..e6b4bf84 100644 --- a/pkg/models/page_of_blueprint_request.go +++ b/pkg/models/page_of_blueprint_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfBlueprintRequest) Validate(formats strfmt.Registry) error { } func (m *PageOfBlueprintRequest) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfBlueprintRequest) validateContent(formats strfmt.Registry) error } func (m *PageOfBlueprintRequest) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfBlueprintRequest) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of blueprint request based on the context it is used +func (m *PageOfBlueprintRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfBlueprintRequest) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfBlueprintRequest) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfBlueprintRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_blueprint_version.go b/pkg/models/page_of_blueprint_version.go index 8d2ad64b..20023804 100644 --- a/pkg/models/page_of_blueprint_version.go +++ b/pkg/models/page_of_blueprint_version.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfBlueprintVersion) Validate(formats strfmt.Registry) error { } func (m *PageOfBlueprintVersion) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfBlueprintVersion) validateContent(formats strfmt.Registry) error } func (m *PageOfBlueprintVersion) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfBlueprintVersion) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of blueprint version based on the context it is used +func (m *PageOfBlueprintVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfBlueprintVersion) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfBlueprintVersion) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfBlueprintVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_catalog_item.go b/pkg/models/page_of_catalog_item.go index ead05ce6..2fb62937 100644 --- a/pkg/models/page_of_catalog_item.go +++ b/pkg/models/page_of_catalog_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfCatalogItem) Validate(formats strfmt.Registry) error { } func (m *PageOfCatalogItem) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfCatalogItem) validateContent(formats strfmt.Registry) error { } func (m *PageOfCatalogItem) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfCatalogItem) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of catalog item based on the context it is used +func (m *PageOfCatalogItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfCatalogItem) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfCatalogItem) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfCatalogItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_catalog_item_type.go b/pkg/models/page_of_catalog_item_type.go index 1a88f324..000a6ef4 100644 --- a/pkg/models/page_of_catalog_item_type.go +++ b/pkg/models/page_of_catalog_item_type.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfCatalogItemType) Validate(formats strfmt.Registry) error { } func (m *PageOfCatalogItemType) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfCatalogItemType) validateContent(formats strfmt.Registry) error { } func (m *PageOfCatalogItemType) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfCatalogItemType) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of catalog item type based on the context it is used +func (m *PageOfCatalogItemType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfCatalogItemType) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfCatalogItemType) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfCatalogItemType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_catalog_item_version.go b/pkg/models/page_of_catalog_item_version.go index fe3d7335..d0521fa0 100644 --- a/pkg/models/page_of_catalog_item_version.go +++ b/pkg/models/page_of_catalog_item_version.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfCatalogItemVersion) Validate(formats strfmt.Registry) error { } func (m *PageOfCatalogItemVersion) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfCatalogItemVersion) validateContent(formats strfmt.Registry) erro } func (m *PageOfCatalogItemVersion) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfCatalogItemVersion) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of catalog item version based on the context it is used +func (m *PageOfCatalogItemVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfCatalogItemVersion) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfCatalogItemVersion) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfCatalogItemVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_catalog_source.go b/pkg/models/page_of_catalog_source.go index 6e570b78..d6225d75 100644 --- a/pkg/models/page_of_catalog_source.go +++ b/pkg/models/page_of_catalog_source.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfCatalogSource) Validate(formats strfmt.Registry) error { } func (m *PageOfCatalogSource) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfCatalogSource) validateContent(formats strfmt.Registry) error { } func (m *PageOfCatalogSource) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfCatalogSource) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of catalog source based on the context it is used +func (m *PageOfCatalogSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfCatalogSource) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfCatalogSource) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfCatalogSource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_commit_details.go b/pkg/models/page_of_commit_details.go index bef6f6e0..e9c6cbc0 100644 --- a/pkg/models/page_of_commit_details.go +++ b/pkg/models/page_of_commit_details.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfCommitDetails) Validate(formats strfmt.Registry) error { } func (m *PageOfCommitDetails) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfCommitDetails) validateContent(formats strfmt.Registry) error { } func (m *PageOfCommitDetails) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfCommitDetails) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of commit details based on the context it is used +func (m *PageOfCommitDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfCommitDetails) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfCommitDetails) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfCommitDetails) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_deployment.go b/pkg/models/page_of_deployment.go index 0b1b9d39..29d740a1 100644 --- a/pkg/models/page_of_deployment.go +++ b/pkg/models/page_of_deployment.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfDeployment) Validate(formats strfmt.Registry) error { } func (m *PageOfDeployment) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfDeployment) validateContent(formats strfmt.Registry) error { } func (m *PageOfDeployment) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfDeployment) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of deployment based on the context it is used +func (m *PageOfDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfDeployment) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfDeployment) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfDeployment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_deployment_resource_type.go b/pkg/models/page_of_deployment_resource_type.go index b96cda71..05d320cd 100644 --- a/pkg/models/page_of_deployment_resource_type.go +++ b/pkg/models/page_of_deployment_resource_type.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfDeploymentResourceType) Validate(formats strfmt.Registry) error { } func (m *PageOfDeploymentResourceType) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfDeploymentResourceType) validateContent(formats strfmt.Registry) } func (m *PageOfDeploymentResourceType) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfDeploymentResourceType) validateSort(formats strfmt.Registry) err return nil } +// ContextValidate validate this page of deployment resource type based on the context it is used +func (m *PageOfDeploymentResourceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfDeploymentResourceType) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfDeploymentResourceType) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfDeploymentResourceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_event.go b/pkg/models/page_of_event.go index 208b9e15..cb24cdbe 100644 --- a/pkg/models/page_of_event.go +++ b/pkg/models/page_of_event.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfEvent) Validate(formats strfmt.Registry) error { } func (m *PageOfEvent) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfEvent) validateContent(formats strfmt.Registry) error { } func (m *PageOfEvent) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfEvent) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of event based on the context it is used +func (m *PageOfEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfEvent) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfEvent) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfEvent) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_filter_entry.go b/pkg/models/page_of_filter_entry.go index fcdb500d..a34a936b 100644 --- a/pkg/models/page_of_filter_entry.go +++ b/pkg/models/page_of_filter_entry.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfFilterEntry) Validate(formats strfmt.Registry) error { } func (m *PageOfFilterEntry) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfFilterEntry) validateContent(formats strfmt.Registry) error { } func (m *PageOfFilterEntry) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfFilterEntry) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of filter entry based on the context it is used +func (m *PageOfFilterEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfFilterEntry) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfFilterEntry) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfFilterEntry) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_metering_policy.go b/pkg/models/page_of_metering_policy.go index d3f033f2..f7cc2142 100644 --- a/pkg/models/page_of_metering_policy.go +++ b/pkg/models/page_of_metering_policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfMeteringPolicy) Validate(formats strfmt.Registry) error { } func (m *PageOfMeteringPolicy) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfMeteringPolicy) validateContent(formats strfmt.Registry) error { } func (m *PageOfMeteringPolicy) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfMeteringPolicy) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of metering policy based on the context it is used +func (m *PageOfMeteringPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfMeteringPolicy) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfMeteringPolicy) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfMeteringPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_metering_policy_assignment.go b/pkg/models/page_of_metering_policy_assignment.go index d6a87724..0eb02229 100644 --- a/pkg/models/page_of_metering_policy_assignment.go +++ b/pkg/models/page_of_metering_policy_assignment.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfMeteringPolicyAssignment) Validate(formats strfmt.Registry) error } func (m *PageOfMeteringPolicyAssignment) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfMeteringPolicyAssignment) validateContent(formats strfmt.Registry } func (m *PageOfMeteringPolicyAssignment) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfMeteringPolicyAssignment) validateSort(formats strfmt.Registry) e return nil } +// ContextValidate validate this page of metering policy assignment based on the context it is used +func (m *PageOfMeteringPolicyAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfMeteringPolicyAssignment) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfMeteringPolicyAssignment) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfMeteringPolicyAssignment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_policy.go b/pkg/models/page_of_policy.go index 8c705c7f..e8a4dc23 100644 --- a/pkg/models/page_of_policy.go +++ b/pkg/models/page_of_policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfPolicy) Validate(formats strfmt.Registry) error { } func (m *PageOfPolicy) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfPolicy) validateContent(formats strfmt.Registry) error { } func (m *PageOfPolicy) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfPolicy) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of policy based on the context it is used +func (m *PageOfPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfPolicy) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfPolicy) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_policy_decision_of_object_node.go b/pkg/models/page_of_policy_decision_of_object_node.go index a05619ed..7a28bdb8 100644 --- a/pkg/models/page_of_policy_decision_of_object_node.go +++ b/pkg/models/page_of_policy_decision_of_object_node.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfPolicyDecisionOfObjectNode) Validate(formats strfmt.Registry) err } func (m *PageOfPolicyDecisionOfObjectNode) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfPolicyDecisionOfObjectNode) validateContent(formats strfmt.Regist } func (m *PageOfPolicyDecisionOfObjectNode) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfPolicyDecisionOfObjectNode) validateSort(formats strfmt.Registry) return nil } +// ContextValidate validate this page of policy decision of object node based on the context it is used +func (m *PageOfPolicyDecisionOfObjectNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfPolicyDecisionOfObjectNode) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfPolicyDecisionOfObjectNode) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfPolicyDecisionOfObjectNode) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_policy_type.go b/pkg/models/page_of_policy_type.go index 67c030db..032948e1 100644 --- a/pkg/models/page_of_policy_type.go +++ b/pkg/models/page_of_policy_type.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfPolicyType) Validate(formats strfmt.Registry) error { } func (m *PageOfPolicyType) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfPolicyType) validateContent(formats strfmt.Registry) error { } func (m *PageOfPolicyType) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfPolicyType) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of policy type based on the context it is used +func (m *PageOfPolicyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfPolicyType) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfPolicyType) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfPolicyType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_request.go b/pkg/models/page_of_request.go index 15aad1d1..d0e9319c 100644 --- a/pkg/models/page_of_request.go +++ b/pkg/models/page_of_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfRequest) Validate(formats strfmt.Registry) error { } func (m *PageOfRequest) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfRequest) validateContent(formats strfmt.Registry) error { } func (m *PageOfRequest) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfRequest) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of request based on the context it is used +func (m *PageOfRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfRequest) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfRequest) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_resource.go b/pkg/models/page_of_resource.go index cc6032c9..a4ed7e49 100644 --- a/pkg/models/page_of_resource.go +++ b/pkg/models/page_of_resource.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfResource) Validate(formats strfmt.Registry) error { } func (m *PageOfResource) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfResource) validateContent(formats strfmt.Registry) error { } func (m *PageOfResource) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfResource) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of resource based on the context it is used +func (m *PageOfResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfResource) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfResource) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfResource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_resource_type.go b/pkg/models/page_of_resource_type.go index 86a44714..abdd434f 100644 --- a/pkg/models/page_of_resource_type.go +++ b/pkg/models/page_of_resource_type.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfResourceType) Validate(formats strfmt.Registry) error { } func (m *PageOfResourceType) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfResourceType) validateContent(formats strfmt.Registry) error { } func (m *PageOfResourceType) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfResourceType) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of resource type based on the context it is used +func (m *PageOfResourceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfResourceType) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfResourceType) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfResourceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/page_of_terraform_version.go b/pkg/models/page_of_terraform_version.go index 11d9b548..95766780 100644 --- a/pkg/models/page_of_terraform_version.go +++ b/pkg/models/page_of_terraform_version.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -68,7 +69,6 @@ func (m *PageOfTerraformVersion) Validate(formats strfmt.Registry) error { } func (m *PageOfTerraformVersion) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -93,7 +93,6 @@ func (m *PageOfTerraformVersion) validateContent(formats strfmt.Registry) error } func (m *PageOfTerraformVersion) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -110,6 +109,56 @@ func (m *PageOfTerraformVersion) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this page of terraform version based on the context it is used +func (m *PageOfTerraformVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfTerraformVersion) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfTerraformVersion) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PageOfTerraformVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/photon_model_endpoint_config_request.go b/pkg/models/photon_model_endpoint_config_request.go index c4e6fde8..6e95506d 100644 --- a/pkg/models/photon_model_endpoint_config_request.go +++ b/pkg/models/photon_model_endpoint_config_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -85,7 +86,6 @@ func (m *PhotonModelEndpointConfigRequest) Validate(formats strfmt.Registry) err } func (m *PhotonModelEndpointConfigRequest) validateCustomProperties(formats strfmt.Registry) error { - if swag.IsZero(m.CustomProperties) { // not required return nil } @@ -103,7 +103,6 @@ func (m *PhotonModelEndpointConfigRequest) validateCustomProperties(formats strf } func (m *PhotonModelEndpointConfigRequest) validateEndpointProperties(formats strfmt.Registry) error { - if swag.IsZero(m.EndpointProperties) { // not required return nil } @@ -156,7 +155,6 @@ func (m *PhotonModelEndpointConfigRequest) validateRequestTypeEnum(path, locatio } func (m *PhotonModelEndpointConfigRequest) validateRequestType(formats strfmt.Registry) error { - if swag.IsZero(m.RequestType) { // not required return nil } @@ -170,7 +168,6 @@ func (m *PhotonModelEndpointConfigRequest) validateRequestType(formats strfmt.Re } func (m *PhotonModelEndpointConfigRequest) validateResourceReference(formats strfmt.Registry) error { - if swag.IsZero(m.ResourceReference) { // not required return nil } @@ -188,7 +185,6 @@ func (m *PhotonModelEndpointConfigRequest) validateResourceReference(formats str } func (m *PhotonModelEndpointConfigRequest) validateTaskReference(formats strfmt.Registry) error { - if swag.IsZero(m.TaskReference) { // not required return nil } @@ -205,6 +201,88 @@ func (m *PhotonModelEndpointConfigRequest) validateTaskReference(formats strfmt. return nil } +// ContextValidate validate this photon model endpoint config request based on the context it is used +func (m *PhotonModelEndpointConfigRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEndpointProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResourceReference(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskReference(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PhotonModelEndpointConfigRequest) contextValidateCustomProperties(ctx context.Context, formats strfmt.Registry) error { + + if m.CustomProperties != nil { + if err := m.CustomProperties.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customProperties") + } + return err + } + } + + return nil +} + +func (m *PhotonModelEndpointConfigRequest) contextValidateEndpointProperties(ctx context.Context, formats strfmt.Registry) error { + + if m.EndpointProperties != nil { + if err := m.EndpointProperties.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("endpointProperties") + } + return err + } + } + + return nil +} + +func (m *PhotonModelEndpointConfigRequest) contextValidateResourceReference(ctx context.Context, formats strfmt.Registry) error { + + if m.ResourceReference != nil { + if err := m.ResourceReference.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resourceReference") + } + return err + } + } + + return nil +} + +func (m *PhotonModelEndpointConfigRequest) contextValidateTaskReference(ctx context.Context, formats strfmt.Registry) error { + + if m.TaskReference != nil { + if err := m.TaskReference.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taskReference") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PhotonModelEndpointConfigRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy.go b/pkg/models/policy.go index 9dbda553..d3243c87 100644 --- a/pkg/models/policy.go +++ b/pkg/models/policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -110,7 +111,6 @@ func (m *Policy) Validate(formats strfmt.Registry) error { } func (m *Policy) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -123,7 +123,6 @@ func (m *Policy) validateCreatedAt(formats strfmt.Registry) error { } func (m *Policy) validateCriteria(formats strfmt.Registry) error { - if swag.IsZero(m.Criteria) { // not required return nil } @@ -141,7 +140,6 @@ func (m *Policy) validateCriteria(formats strfmt.Registry) error { } func (m *Policy) validateDefinitionLegend(formats strfmt.Registry) error { - if swag.IsZero(m.DefinitionLegend) { // not required return nil } @@ -192,7 +190,6 @@ func (m *Policy) validateEnforcementTypeEnum(path, location string, value string } func (m *Policy) validateEnforcementType(formats strfmt.Registry) error { - if swag.IsZero(m.EnforcementType) { // not required return nil } @@ -206,7 +203,6 @@ func (m *Policy) validateEnforcementType(formats strfmt.Registry) error { } func (m *Policy) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -219,7 +215,6 @@ func (m *Policy) validateID(formats strfmt.Registry) error { } func (m *Policy) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -232,7 +227,6 @@ func (m *Policy) validateLastUpdatedAt(formats strfmt.Registry) error { } func (m *Policy) validateStatistics(formats strfmt.Registry) error { - if swag.IsZero(m.Statistics) { // not required return nil } @@ -249,6 +243,71 @@ func (m *Policy) validateStatistics(formats strfmt.Registry) error { return nil } +// ContextValidate validate this policy based on the context it is used +func (m *Policy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCriteria(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDefinitionLegend(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatistics(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Policy) contextValidateCriteria(ctx context.Context, formats strfmt.Registry) error { + + if m.Criteria != nil { + if err := m.Criteria.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("criteria") + } + return err + } + } + + return nil +} + +func (m *Policy) contextValidateDefinitionLegend(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.DefinitionLegend { + + if val, ok := m.DefinitionLegend[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *Policy) contextValidateStatistics(ctx context.Context, formats strfmt.Registry) error { + + if m.Statistics != nil { + if err := m.Statistics.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("statistics") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Policy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy_decision_of_object_node.go b/pkg/models/policy_decision_of_object_node.go index 96350ebf..ff5bd5d5 100644 --- a/pkg/models/policy_decision_of_object_node.go +++ b/pkg/models/policy_decision_of_object_node.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -93,7 +94,6 @@ func (m *PolicyDecisionOfObjectNode) Validate(formats strfmt.Registry) error { } func (m *PolicyDecisionOfObjectNode) validateDryRunID(formats strfmt.Registry) error { - if swag.IsZero(m.DryRunID) { // not required return nil } @@ -106,7 +106,6 @@ func (m *PolicyDecisionOfObjectNode) validateDryRunID(formats strfmt.Registry) e } func (m *PolicyDecisionOfObjectNode) validateDryRunSubTaskID(formats strfmt.Registry) error { - if swag.IsZero(m.DryRunSubTaskID) { // not required return nil } @@ -119,7 +118,6 @@ func (m *PolicyDecisionOfObjectNode) validateDryRunSubTaskID(formats strfmt.Regi } func (m *PolicyDecisionOfObjectNode) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -132,7 +130,6 @@ func (m *PolicyDecisionOfObjectNode) validateID(formats strfmt.Registry) error { } func (m *PolicyDecisionOfObjectNode) validatePolicies(formats strfmt.Registry) error { - if swag.IsZero(m.Policies) { // not required return nil } @@ -157,7 +154,6 @@ func (m *PolicyDecisionOfObjectNode) validatePolicies(formats strfmt.Registry) e } func (m *PolicyDecisionOfObjectNode) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.Timestamp) { // not required return nil } @@ -169,6 +165,38 @@ func (m *PolicyDecisionOfObjectNode) validateTimestamp(formats strfmt.Registry) return nil } +// ContextValidate validate this policy decision of object node based on the context it is used +func (m *PolicyDecisionOfObjectNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePolicies(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PolicyDecisionOfObjectNode) contextValidatePolicies(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Policies); i++ { + + if m.Policies[i] != nil { + if err := m.Policies[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policies" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PolicyDecisionOfObjectNode) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy_decision_policy.go b/pkg/models/policy_decision_policy.go index 0f81b318..8c3e320a 100644 --- a/pkg/models/policy_decision_policy.go +++ b/pkg/models/policy_decision_policy.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -95,7 +96,6 @@ func (m *PolicyDecisionPolicy) validateEnforcementTypeEnum(path, location string } func (m *PolicyDecisionPolicy) validateEnforcementType(formats strfmt.Registry) error { - if swag.IsZero(m.EnforcementType) { // not required return nil } @@ -109,7 +109,6 @@ func (m *PolicyDecisionPolicy) validateEnforcementType(formats strfmt.Registry) } func (m *PolicyDecisionPolicy) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -154,7 +153,6 @@ func (m *PolicyDecisionPolicy) validateStatusEnum(path, location string, value s } func (m *PolicyDecisionPolicy) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -167,6 +165,11 @@ func (m *PolicyDecisionPolicy) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this policy decision policy based on context it is used +func (m *PolicyDecisionPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PolicyDecisionPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy_feature_config.go b/pkg/models/policy_feature_config.go index 1bcfb411..a94e639a 100644 --- a/pkg/models/policy_feature_config.go +++ b/pkg/models/policy_feature_config.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *PolicyFeatureConfig) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this policy feature config based on context it is used +func (m *PolicyFeatureConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PolicyFeatureConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy_stats.go b/pkg/models/policy_stats.go index 464f3492..7ac81a43 100644 --- a/pkg/models/policy_stats.go +++ b/pkg/models/policy_stats.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *PolicyStats) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this policy stats based on context it is used +func (m *PolicyStats) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PolicyStats) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/policy_type.go b/pkg/models/policy_type.go index 875bca6c..cb217099 100644 --- a/pkg/models/policy_type.go +++ b/pkg/models/policy_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -78,7 +80,6 @@ func (m *PolicyType) Validate(formats strfmt.Registry) error { } func (m *PolicyType) validateConfig(formats strfmt.Registry) error { - if swag.IsZero(m.Config) { // not required return nil } @@ -97,8 +98,8 @@ func (m *PolicyType) validateConfig(formats strfmt.Registry) error { func (m *PolicyType) validateDefinitionSchema(formats strfmt.Registry) error { - if err := validate.Required("definitionSchema", "body", m.DefinitionSchema); err != nil { - return err + if m.DefinitionSchema == nil { + return errors.Required("definitionSchema", "body", nil) } return nil @@ -133,8 +134,36 @@ func (m *PolicyType) validateName(formats strfmt.Registry) error { func (m *PolicyType) validateTargetSchema(formats strfmt.Registry) error { - if err := validate.Required("targetSchema", "body", m.TargetSchema); err != nil { - return err + if m.TargetSchema == nil { + return errors.Required("targetSchema", "body", nil) + } + + return nil +} + +// ContextValidate validate this policy type based on the context it is used +func (m *PolicyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PolicyType) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.Config != nil { + if err := m.Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } } return nil diff --git a/pkg/models/project.go b/pkg/models/project.go index 1fdb97f6..455746fd 100644 --- a/pkg/models/project.go +++ b/pkg/models/project.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,70 @@ type Project struct { Links map[string]Href `json:"_links"` // List of administrator users associated with the project. Only administrators can manage project's configuration. + // Example: [ { \"email\":\"administrator@vmware.com\" } ] Administrators []*User `json:"administrators"` // List of storage, network and extensibility constraints to be applied when provisioning through this project. + // Example: {\"network\":[{\"mandatory\": \"true\", \"expression\": \"env:dev\"}],\"storage\":[{\"mandatory\": \"false\", \"expression\": \"gold\"}],\"extensibility\":[{\"mandatory\": \"false\", \"expression\": \"key:value\"}]} Constraints map[string][]Constraint `json:"constraints,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` + // The project custom properties which are added to all requests in this project + // Example: { \"property\" : \"value\" } + CustomProperties map[string]string `json:"customProperties,omitempty"` + // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // The naming template to be used for machines provisioned in this project + // Example: ${project.name}-test-${####} MachineNamingTemplate string `json:"machineNamingTemplate,omitempty"` // List of member users associated with the project. + // Example: [ { \"email\":\"member@vmware.com\" } ] Members []*User `json:"members"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The timeout that should be used for Blueprint operations and Provisioning tasks. The timeout is in seconds OperationTimeout int64 `json:"operationTimeout,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` + // Placement policy for the project. Determines how a zone will be selected for provisioning. DEFAULT or SPREAD. + // Example: DEFAULT + PlacementPolicy string `json:"placementPolicy,omitempty"` + // Specifies whether the resources in this projects are shared or not. SharedResources bool `json:"sharedResources,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` // List of viewer users associated with the project. + // Example: [ { \"email\":\"viewer@vmware.com\" } ] Viewers []*User `json:"viewers"` // List of Cloud Zones assigned to this project. You can limit deployment to a single region or allow multi-region placement by adding more than one cloud zone to a project. A cloud zone lists available resources. Use tags on resources to control workload placement. @@ -113,6 +135,10 @@ func (m *Project) Validate(formats strfmt.Registry) error { func (m *Project) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -130,7 +156,6 @@ func (m *Project) validateLinks(formats strfmt.Registry) error { } func (m *Project) validateAdministrators(formats strfmt.Registry) error { - if swag.IsZero(m.Administrators) { // not required return nil } @@ -155,7 +180,6 @@ func (m *Project) validateAdministrators(formats strfmt.Registry) error { } func (m *Project) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -192,7 +216,6 @@ func (m *Project) validateID(formats strfmt.Registry) error { } func (m *Project) validateMembers(formats strfmt.Registry) error { - if swag.IsZero(m.Members) { // not required return nil } @@ -217,7 +240,6 @@ func (m *Project) validateMembers(formats strfmt.Registry) error { } func (m *Project) validateViewers(formats strfmt.Registry) error { - if swag.IsZero(m.Viewers) { // not required return nil } @@ -242,7 +264,6 @@ func (m *Project) validateViewers(formats strfmt.Registry) error { } func (m *Project) validateZones(formats strfmt.Registry) error { - if swag.IsZero(m.Zones) { // not required return nil } @@ -266,6 +287,151 @@ func (m *Project) validateZones(formats strfmt.Registry) error { return nil } +// ContextValidate validate this project based on the context it is used +func (m *Project) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAdministrators(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateViewers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateZones(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Project) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *Project) contextValidateAdministrators(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Administrators); i++ { + + if m.Administrators[i] != nil { + if err := m.Administrators[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("administrators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Project) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Constraints { + + for i := 0; i < len(m.Constraints[k]); i++ { + + if err := m.Constraints[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *Project) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Project) contextValidateViewers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Viewers); i++ { + + if m.Viewers[i] != nil { + if err := m.Viewers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("viewers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Project) contextValidateZones(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Zones); i++ { + + if m.Zones[i] != nil { + if err := m.Zones[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("zones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Project) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/project_resource_metadata.go b/pkg/models/project_resource_metadata.go index 482765c3..fe652de7 100644 --- a/pkg/models/project_resource_metadata.go +++ b/pkg/models/project_resource_metadata.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type ProjectResourceMetadata struct { // A list of keys and optional values to be applied to compute resources provisioned in a project + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` } @@ -37,7 +39,6 @@ func (m *ProjectResourceMetadata) Validate(formats strfmt.Registry) error { } func (m *ProjectResourceMetadata) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -61,6 +62,38 @@ func (m *ProjectResourceMetadata) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this project resource metadata based on the context it is used +func (m *ProjectResourceMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProjectResourceMetadata) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ProjectResourceMetadata) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/project_resource_metadata_specification.go b/pkg/models/project_resource_metadata_specification.go index e7a48817..88cde160 100644 --- a/pkg/models/project_resource_metadata_specification.go +++ b/pkg/models/project_resource_metadata_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type ProjectResourceMetadataSpecification struct { // A list of keys and optional values to be applied to compute resources provisioned in a project + // Example: [ { \"key\" : \"env\", \"value\": \"dev\" } ] Tags []*Tag `json:"tags"` } @@ -37,7 +39,6 @@ func (m *ProjectResourceMetadataSpecification) Validate(formats strfmt.Registry) } func (m *ProjectResourceMetadataSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -61,6 +62,38 @@ func (m *ProjectResourceMetadataSpecification) validateTags(formats strfmt.Regis return nil } +// ContextValidate validate this project resource metadata specification based on the context it is used +func (m *ProjectResourceMetadataSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProjectResourceMetadataSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ProjectResourceMetadataSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/project_result.go b/pkg/models/project_result.go index 41400060..bf26c067 100644 --- a/pkg/models/project_result.go +++ b/pkg/models/project_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ProjectResult State object representing a query result of projects. @@ -23,10 +25,12 @@ type ProjectResult struct { Content []*Project `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ProjectResult) Validate(formats strfmt.Registry) error { } func (m *ProjectResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ProjectResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this project result based on the context it is used +func (m *ProjectResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProjectResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Project(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProjectResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ProjectResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ProjectResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/project_specification.go b/pkg/models/project_specification.go index 2d8d3212..55fced68 100644 --- a/pkg/models/project_specification.go +++ b/pkg/models/project_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,18 +21,26 @@ import ( type ProjectSpecification struct { // List of administrator users associated with the project. Only administrators can manage project's configuration. + // Example: [{ \"email\":\"administrator@vmware.com\" }] Administrators []*User `json:"administrators"` // List of storage, network and extensibility constraints to be applied when provisioning through this project. + // Example: {\"network\":[{\"mandatory\": \"true\", \"expression\": \"env:dev\"}],\"storage\":[{\"mandatory\": \"false\", \"expression\": \"gold\"}],\"extensibility\":[{\"mandatory\": \"false\", \"expression\": \"key:value\"}]} Constraints map[string][]Constraint `json:"constraints,omitempty"` + // The project custom properties which are added to all requests in this project + // Example: { \"property\" : \"value\" } + CustomProperties map[string]string `json:"customProperties,omitempty"` + // A human-friendly description. Description string `json:"description,omitempty"` // The naming template to be used for machines provisioned in this project + // Example: ${project.name}-test-${####} MachineNamingTemplate string `json:"machineNamingTemplate,omitempty"` // List of member users associated with the project. + // Example: [{ \"email\":\"member@vmware.com\" }] Members []*User `json:"members"` // A human-friendly name used as an identifier in APIs that support this option. @@ -39,12 +48,19 @@ type ProjectSpecification struct { Name *string `json:"name"` // The timeout that should be used for Blueprint operations and Provisioning tasks. The timeout is in seconds + // Example: 30 OperationTimeout int64 `json:"operationTimeout,omitempty"` + // Placement policy for the project. Determines how a zone will be selected for provisioning. DEFAULT or SPREAD. + // Example: DEFAULT + PlacementPolicy string `json:"placementPolicy,omitempty"` + // Specifies whether the resources in this projects are shared or not. If not set default will be used. + // Example: true SharedResources *bool `json:"sharedResources,omitempty"` // List of viewer users associated with the project. + // Example: [{ \"email\":\"viewer@vmware.com\" }] Viewers []*User `json:"viewers"` // List of configurations for zone assignment to a project. @@ -86,7 +102,6 @@ func (m *ProjectSpecification) Validate(formats strfmt.Registry) error { } func (m *ProjectSpecification) validateAdministrators(formats strfmt.Registry) error { - if swag.IsZero(m.Administrators) { // not required return nil } @@ -111,7 +126,6 @@ func (m *ProjectSpecification) validateAdministrators(formats strfmt.Registry) e } func (m *ProjectSpecification) validateConstraints(formats strfmt.Registry) error { - if swag.IsZero(m.Constraints) { // not required return nil } @@ -139,7 +153,6 @@ func (m *ProjectSpecification) validateConstraints(formats strfmt.Registry) erro } func (m *ProjectSpecification) validateMembers(formats strfmt.Registry) error { - if swag.IsZero(m.Members) { // not required return nil } @@ -173,7 +186,6 @@ func (m *ProjectSpecification) validateName(formats strfmt.Registry) error { } func (m *ProjectSpecification) validateViewers(formats strfmt.Registry) error { - if swag.IsZero(m.Viewers) { // not required return nil } @@ -198,7 +210,6 @@ func (m *ProjectSpecification) validateViewers(formats strfmt.Registry) error { } func (m *ProjectSpecification) validateZoneAssignmentConfigurations(formats strfmt.Registry) error { - if swag.IsZero(m.ZoneAssignmentConfigurations) { // not required return nil } @@ -222,6 +233,128 @@ func (m *ProjectSpecification) validateZoneAssignmentConfigurations(formats strf return nil } +// ContextValidate validate this project specification based on the context it is used +func (m *ProjectSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdministrators(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateViewers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateZoneAssignmentConfigurations(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProjectSpecification) contextValidateAdministrators(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Administrators); i++ { + + if m.Administrators[i] != nil { + if err := m.Administrators[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("administrators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProjectSpecification) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Constraints { + + for i := 0; i < len(m.Constraints[k]); i++ { + + if err := m.Constraints[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraints" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *ProjectSpecification) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProjectSpecification) contextValidateViewers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Viewers); i++ { + + if m.Viewers[i] != nil { + if err := m.Viewers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("viewers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProjectSpecification) contextValidateZoneAssignmentConfigurations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ZoneAssignmentConfigurations); i++ { + + if m.ZoneAssignmentConfigurations[i] != nil { + if err := m.ZoneAssignmentConfigurations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("zoneAssignmentConfigurations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ProjectSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/property_definition.go b/pkg/models/property_definition.go index 9031f203..fe99e9e2 100644 --- a/pkg/models/property_definition.go +++ b/pkg/models/property_definition.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -147,7 +148,6 @@ func (m *PropertyDefinition) Validate(formats strfmt.Registry) error { } func (m *PropertyDefinition) validateAllOf(formats strfmt.Registry) error { - if swag.IsZero(m.AllOf) { // not required return nil } @@ -172,7 +172,6 @@ func (m *PropertyDefinition) validateAllOf(formats strfmt.Registry) error { } func (m *PropertyDefinition) validateItems(formats strfmt.Registry) error { - if swag.IsZero(m.Items) { // not required return nil } @@ -190,7 +189,6 @@ func (m *PropertyDefinition) validateItems(formats strfmt.Registry) error { } func (m *PropertyDefinition) validateNot(formats strfmt.Registry) error { - if swag.IsZero(m.Not) { // not required return nil } @@ -208,7 +206,6 @@ func (m *PropertyDefinition) validateNot(formats strfmt.Registry) error { } func (m *PropertyDefinition) validateOneOf(formats strfmt.Registry) error { - if swag.IsZero(m.OneOf) { // not required return nil } @@ -233,7 +230,6 @@ func (m *PropertyDefinition) validateOneOf(formats strfmt.Registry) error { } func (m *PropertyDefinition) validateProperties(formats strfmt.Registry) error { - if swag.IsZero(m.Properties) { // not required return nil } @@ -254,6 +250,115 @@ func (m *PropertyDefinition) validateProperties(formats strfmt.Registry) error { return nil } +// ContextValidate validate this property definition based on the context it is used +func (m *PropertyDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAllOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOneOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PropertyDefinition) contextValidateAllOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AllOf); i++ { + + if m.AllOf[i] != nil { + if err := m.AllOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("allOf" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PropertyDefinition) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { + + if m.Items != nil { + if err := m.Items.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items") + } + return err + } + } + + return nil +} + +func (m *PropertyDefinition) contextValidateNot(ctx context.Context, formats strfmt.Registry) error { + + if m.Not != nil { + if err := m.Not.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("not") + } + return err + } + } + + return nil +} + +func (m *PropertyDefinition) contextValidateOneOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OneOf); i++ { + + if m.OneOf[i] != nil { + if err := m.OneOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oneOf" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PropertyDefinition) contextValidateProperties(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Properties { + + if val, ok := m.Properties[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PropertyDefinition) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/provider.go b/pkg/models/provider.go index 7e17d3f4..76354bdd 100644 --- a/pkg/models/provider.go +++ b/pkg/models/provider.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *Provider) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this provider based on context it is used +func (m *Provider) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Provider) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/rate_factor.go b/pkg/models/rate_factor.go index 5e013b0d..297b17e8 100644 --- a/pkg/models/rate_factor.go +++ b/pkg/models/rate_factor.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *RateFactor) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this rate factor based on context it is used +func (m *RateFactor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *RateFactor) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/rate_factor_item.go b/pkg/models/rate_factor_item.go index b270273e..00d1acff 100644 --- a/pkg/models/rate_factor_item.go +++ b/pkg/models/rate_factor_item.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -41,7 +43,6 @@ func (m *RateFactorItem) Validate(formats strfmt.Registry) error { } func (m *RateFactorItem) validateRateFactor(formats strfmt.Registry) error { - if swag.IsZero(m.RateFactor) { // not required return nil } @@ -58,6 +59,34 @@ func (m *RateFactorItem) validateRateFactor(formats strfmt.Registry) error { return nil } +// ContextValidate validate this rate factor item based on the context it is used +func (m *RateFactorItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRateFactor(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RateFactorItem) contextValidateRateFactor(ctx context.Context, formats strfmt.Registry) error { + + if m.RateFactor != nil { + if err := m.RateFactor.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rateFactor") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *RateFactorItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/reconfigure_compute_gateway_specification.go b/pkg/models/reconfigure_compute_gateway_specification.go new file mode 100644 index 00000000..7c098123 --- /dev/null +++ b/pkg/models/reconfigure_compute_gateway_specification.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReconfigureComputeGatewaySpecification Specification for a Compute Gateway Reconfigure operation for NAT rules +// +// swagger:model ReconfigureComputeGatewaySpecification +type ReconfigureComputeGatewaySpecification struct { + + // List of NAT rules to be applied on this Compute Gateway. + // Required: true + NatRules []*NatRule `json:"natRules"` +} + +// Validate validates this reconfigure compute gateway specification +func (m *ReconfigureComputeGatewaySpecification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNatRules(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReconfigureComputeGatewaySpecification) validateNatRules(formats strfmt.Registry) error { + + if err := validate.Required("natRules", "body", m.NatRules); err != nil { + return err + } + + for i := 0; i < len(m.NatRules); i++ { + if swag.IsZero(m.NatRules[i]) { // not required + continue + } + + if m.NatRules[i] != nil { + if err := m.NatRules[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this reconfigure compute gateway specification based on the context it is used +func (m *ReconfigureComputeGatewaySpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReconfigureComputeGatewaySpecification) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReconfigureComputeGatewaySpecification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReconfigureComputeGatewaySpecification) UnmarshalBinary(b []byte) error { + var res ReconfigureComputeGatewaySpecification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/reconfigure_compute_nat_specification.go b/pkg/models/reconfigure_compute_nat_specification.go new file mode 100644 index 00000000..8a38d6ac --- /dev/null +++ b/pkg/models/reconfigure_compute_nat_specification.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReconfigureComputeNatSpecification Specification for a Compute Nat Reconfigure operation for NAT rules +// +// swagger:model ReconfigureComputeNatSpecification +type ReconfigureComputeNatSpecification struct { + + // List of NAT rules to be applied on this Compute Nat. + // Required: true + NatRules []*NatRule `json:"natRules"` +} + +// Validate validates this reconfigure compute nat specification +func (m *ReconfigureComputeNatSpecification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNatRules(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReconfigureComputeNatSpecification) validateNatRules(formats strfmt.Registry) error { + + if err := validate.Required("natRules", "body", m.NatRules); err != nil { + return err + } + + for i := 0; i < len(m.NatRules); i++ { + if swag.IsZero(m.NatRules[i]) { // not required + continue + } + + if m.NatRules[i] != nil { + if err := m.NatRules[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this reconfigure compute nat specification based on the context it is used +func (m *ReconfigureComputeNatSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNatRules(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReconfigureComputeNatSpecification) contextValidateNatRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NatRules); i++ { + + if m.NatRules[i] != nil { + if err := m.NatRules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("natRules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReconfigureComputeNatSpecification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReconfigureComputeNatSpecification) UnmarshalBinary(b []byte) error { + var res ReconfigureComputeNatSpecification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/region.go b/pkg/models/region.go index 201327d9..b1322719 100644 --- a/pkg/models/region.go +++ b/pkg/models/region.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,32 +24,41 @@ type Region struct { Links map[string]Href `json:"_links"` // The id of the cloud account this region belongs to. + // Example: 9e49 CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Unique identifier of region on the provider side. + // Example: us-west // Required: true ExternalRegionID *string `json:"externalRegionId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // Name of region on the provider side. In vSphere, the name of the region is different from its id. + // Example: us-west Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -75,6 +86,10 @@ func (m *Region) Validate(formats strfmt.Registry) error { func (m *Region) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -109,6 +124,39 @@ func (m *Region) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this region based on the context it is used +func (m *Region) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Region) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Region) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/region_result.go b/pkg/models/region_result.go index eae9df9b..cce5f4b4 100644 --- a/pkg/models/region_result.go +++ b/pkg/models/region_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // RegionResult State object representing a query result of regions. @@ -23,10 +25,12 @@ type RegionResult struct { Content []*Region `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *RegionResult) Validate(formats strfmt.Registry) error { } func (m *RegionResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *RegionResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this region result based on the context it is used +func (m *RegionResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegionResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Region(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegionResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *RegionResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *RegionResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/remote_access_specification.go b/pkg/models/remote_access_specification.go index ed8a4e2d..c1435b57 100644 --- a/pkg/models/remote_access_specification.go +++ b/pkg/models/remote_access_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,6 +24,7 @@ type RemoteAccessSpecification struct { // `publicPrivateKey`: The user enters the private key in the SSH command. See remoteAccess.sshKey. // `usernamePassword`: The user enters a username and password for remote access. // `keyPairName`: The user enters an already existing keyPair name. See remoteAccess.keyPair + // Example: publicPrivateKey // Required: true Authentication *string `json:"authentication"` @@ -34,6 +37,7 @@ type RemoteAccessSpecification struct { // In key pair authentication, the public key on the provisioned machine. Users are expected to log in with their private key and a default username from the cloud provider. An AWS Ubuntu image comes with default user ubuntu, and Azure comes with default user azureuser. To log in by SSH: // `ssh -i ubuntu@52.90.80.153` // `ssh -i azureuser@40.76.14.255` + // Example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCu74dLkAGGYIgNuszEAM0HaS2Y6boTPw+HqsFmtPSOpxPQoosws/OWGZlW1uue6Y4lIvdRqZOaLK+2di5512etY67ZwFHc5h1kx4az433DsnoZhIzXEKKI+EXfH/w72CIyG/uVhIzmA4FvRVQKXinE1vaVen6v1CBQEZibx9RXrVRP1VRibsKFRXYxywNEl1VtPK7KaxCEYO9IXi4SKVulSAhOVequwjlo5E8bKNT61/g/YyMvwCbaTTPPeCpS/7i+JHYY3QZ8fQY/Syn+bOFpKCCHl+7VpsL8gjWe6fI4bUp6KUiW7ZkQpL/47rxawKnRMKKEU9P0ICp3RRB39lXT SSHKey string `json:"sshKey,omitempty"` // Remote access username for the Azure machine. @@ -63,6 +67,11 @@ func (m *RemoteAccessSpecification) validateAuthentication(formats strfmt.Regist return nil } +// ContextValidate validates this remote access specification based on context it is used +func (m *RemoteAccessSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *RemoteAccessSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/request.go b/pkg/models/request.go index fd302f77..7f63da0d 100644 --- a/pkg/models/request.go +++ b/pkg/models/request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -152,7 +153,6 @@ func (m *Request) Validate(formats strfmt.Registry) error { } func (m *Request) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required return nil } @@ -165,7 +165,6 @@ func (m *Request) validateApprovedAt(formats strfmt.Registry) error { } func (m *Request) validateCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CompletedAt) { // not required return nil } @@ -200,7 +199,6 @@ func (m *Request) validateCreatedAt(formats strfmt.Registry) error { } func (m *Request) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -213,7 +211,6 @@ func (m *Request) validateID(formats strfmt.Registry) error { } func (m *Request) validateInitializedAt(formats strfmt.Registry) error { - if swag.IsZero(m.InitializedAt) { // not required return nil } @@ -300,7 +297,6 @@ func (m *Request) validateStatusEnum(path, location string, value string) error } func (m *Request) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -323,7 +319,6 @@ func (m *Request) validateTotalTasks(formats strfmt.Registry) error { } func (m *Request) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -335,6 +330,11 @@ func (m *Request) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validates this request based on context it is used +func (m *Request) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Request) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/request_tracker.go b/pkg/models/request_tracker.go index 497dc5af..2ed1e1ac 100644 --- a/pkg/models/request_tracker.go +++ b/pkg/models/request_tracker.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -20,30 +21,38 @@ import ( type RequestTracker struct { // ID of the deployment, this request is connected to. + // Example: 123e4567-e89b-12d3-a456-426614174000 DeploymentID string `json:"deploymentId,omitempty"` // ID of this request. + // Example: we655aew4e8e // Required: true ID *string `json:"id"` // Status message of the request. + // Example: In Progress Message string `json:"message,omitempty"` // Name of the operation. + // Example: Power-off Name string `json:"name,omitempty"` // Progress of the request as percentage. + // Example: 90 // Required: true Progress *int32 `json:"progress"` // Collection of resources. + // Example: [\"/resources/i-0be3655a12fd28e8e\", \"/resources/i-0be234a15ft8det3\"] Resources []string `json:"resources"` // Self link of this request. + // Example: /.../request-tracker/we655aew4e8e // Required: true SelfLink *string `json:"selfLink"` // Status of the request. + // Example: FINISHED // Required: true // Enum: [FINISHED INPROGRESS FAILED] Status *string `json:"status"` @@ -148,6 +157,11 @@ func (m *RequestTracker) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this request tracker based on context it is used +func (m *RequestTracker) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *RequestTracker) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/request_tracker_result.go b/pkg/models/request_tracker_result.go index f18d8752..6378340c 100644 --- a/pkg/models/request_tracker_result.go +++ b/pkg/models/request_tracker_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // RequestTrackerResult State object representing a query result of request tracker objects. @@ -23,10 +25,12 @@ type RequestTrackerResult struct { Content []*RequestTracker `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *RequestTrackerResult) Validate(formats strfmt.Registry) error { } func (m *RequestTrackerResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *RequestTrackerResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this request tracker result based on the context it is used +func (m *RequestTrackerResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestTrackerResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*RequestTracker(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RequestTrackerResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *RequestTrackerResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *RequestTrackerResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/resource.go b/pkg/models/resource.go index 014bdef5..947f9bc3 100644 --- a/pkg/models/resource.go +++ b/pkg/models/resource.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -98,7 +99,6 @@ func (m *Resource) Validate(formats strfmt.Registry) error { } func (m *Resource) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -111,7 +111,6 @@ func (m *Resource) validateCreatedAt(formats strfmt.Registry) error { } func (m *Resource) validateExpense(formats strfmt.Registry) error { - if swag.IsZero(m.Expense) { // not required return nil } @@ -129,7 +128,6 @@ func (m *Resource) validateExpense(formats strfmt.Registry) error { } func (m *Resource) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -183,7 +181,6 @@ func (m *Resource) validateStateEnum(path, location string, value string) error } func (m *Resource) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required return nil } @@ -229,7 +226,6 @@ func (m *Resource) validateSyncStatusEnum(path, location string, value string) e } func (m *Resource) validateSyncStatus(formats strfmt.Registry) error { - if swag.IsZero(m.SyncStatus) { // not required return nil } @@ -251,6 +247,34 @@ func (m *Resource) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this resource based on the context it is used +func (m *Resource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExpense(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Resource) contextValidateExpense(ctx context.Context, formats strfmt.Registry) error { + + if m.Expense != nil { + if err := m.Expense.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("expense") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Resource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/resource_action.go b/pkg/models/resource_action.go index 1093ae15..f5d0d934 100644 --- a/pkg/models/resource_action.go +++ b/pkg/models/resource_action.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -102,7 +103,6 @@ func (m *ResourceAction) validateActionTypeEnum(path, location string, value str } func (m *ResourceAction) validateActionType(formats strfmt.Registry) error { - if swag.IsZero(m.ActionType) { // not required return nil } @@ -116,7 +116,6 @@ func (m *ResourceAction) validateActionType(formats strfmt.Registry) error { } func (m *ResourceAction) validateFormDefinition(formats strfmt.Registry) error { - if swag.IsZero(m.FormDefinition) { // not required return nil } @@ -133,6 +132,34 @@ func (m *ResourceAction) validateFormDefinition(formats strfmt.Registry) error { return nil } +// ContextValidate validate this resource action based on the context it is used +func (m *ResourceAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFormDefinition(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResourceAction) contextValidateFormDefinition(ctx context.Context, formats strfmt.Registry) error { + + if m.FormDefinition != nil { + if err := m.FormDefinition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("formDefinition") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ResourceAction) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/resource_action_request.go b/pkg/models/resource_action_request.go index 9c7128fb..0a5719f4 100644 --- a/pkg/models/resource_action_request.go +++ b/pkg/models/resource_action_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -32,6 +34,11 @@ func (m *ResourceActionRequest) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this resource action request based on context it is used +func (m *ResourceActionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ResourceActionRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/resource_reference.go b/pkg/models/resource_reference.go index 686bb43b..152551ed 100644 --- a/pkg/models/resource_reference.go +++ b/pkg/models/resource_reference.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -33,6 +35,11 @@ func (m *ResourceReference) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this resource reference based on context it is used +func (m *ResourceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ResourceReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/resource_type.go b/pkg/models/resource_type.go index 7bf37ab7..f6604d7b 100644 --- a/pkg/models/resource_type.go +++ b/pkg/models/resource_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -103,7 +105,6 @@ func (m *ResourceType) Validate(formats strfmt.Registry) error { } func (m *ResourceType) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -116,7 +117,6 @@ func (m *ResourceType) validateCreatedAt(formats strfmt.Registry) error { } func (m *ResourceType) validateSchema(formats strfmt.Registry) error { - if swag.IsZero(m.Schema) { // not required return nil } @@ -134,7 +134,6 @@ func (m *ResourceType) validateSchema(formats strfmt.Registry) error { } func (m *ResourceType) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -146,6 +145,212 @@ func (m *ResourceType) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this resource type based on the context it is used +func (m *ResourceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDescription(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplayName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEndpointType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOperations(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProviderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProviderName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProviderVersion(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSchema(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResourceType) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateDescription(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "description", "body", string(m.Description)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateDisplayName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "displayName", "body", string(m.DisplayName)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateEndpointType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "endpointType", "body", string(m.EndpointType)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "name", "body", string(m.Name)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateOperations(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *ResourceType) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateProviderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "providerId", "body", string(m.ProviderID)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateProviderName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "providerName", "body", string(m.ProviderName)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateProviderVersion(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "providerVersion", "body", string(m.ProviderVersion)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateSchema(ctx context.Context, formats strfmt.Registry) error { + + if m.Schema != nil { + if err := m.Schema.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schema") + } + return err + } + } + + return nil +} + +func (m *ResourceType) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ResourceType) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ResourceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/route_configuration.go b/pkg/models/route_configuration.go index 74f5cb31..09e223ee 100644 --- a/pkg/models/route_configuration.go +++ b/pkg/models/route_configuration.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,27 +20,33 @@ import ( type RouteConfiguration struct { // Algorithm employed for load balancing. + // Example: ROUND_ROBIN Algorithm string `json:"algorithm,omitempty"` // Parameters need for load balancing algorithm.Use newline to separate multiple parameters. + // Example: uriLength=10\nurlParam=section AlgorithmParameters string `json:"algorithmParameters,omitempty"` // Health check configuration for this route configuration. HealthCheckConfiguration *HealthCheckConfiguration `json:"healthCheckConfiguration,omitempty"` // Member port where the traffic is routed to. + // Example: 80 // Required: true MemberPort *string `json:"memberPort"` // The protocol of the member traffic. + // Example: TCP, UDP // Required: true MemberProtocol *string `json:"memberProtocol"` // Port which the load balancer is listening to. + // Example: 80 // Required: true Port *string `json:"port"` // The protocol of the incoming load balancer requests. + // Example: TCP, UDP // Required: true Protocol *string `json:"protocol"` } @@ -74,7 +82,6 @@ func (m *RouteConfiguration) Validate(formats strfmt.Registry) error { } func (m *RouteConfiguration) validateHealthCheckConfiguration(formats strfmt.Registry) error { - if swag.IsZero(m.HealthCheckConfiguration) { // not required return nil } @@ -127,6 +134,34 @@ func (m *RouteConfiguration) validateProtocol(formats strfmt.Registry) error { return nil } +// ContextValidate validate this route configuration based on the context it is used +func (m *RouteConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHealthCheckConfiguration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RouteConfiguration) contextValidateHealthCheckConfiguration(ctx context.Context, formats strfmt.Registry) error { + + if m.HealthCheckConfiguration != nil { + if err := m.HealthCheckConfiguration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("healthCheckConfiguration") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *RouteConfiguration) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/rule.go b/pkg/models/rule.go index 61862e40..6e2d6881 100644 --- a/pkg/models/rule.go +++ b/pkg/models/rule.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -20,30 +21,37 @@ import ( type Rule struct { // Type of access (Allow, Deny or Drop) for the security rule. Allow is default. Traffic that does not match any rules will be denied. + // Example: Allow // Required: true // Enum: [Allow Deny Drop] Access *string `json:"access"` // Direction of the security rule (inbound or outboud). + // Example: Outbound // Required: true // Enum: [Inbound Outbound] Direction *string `json:"direction"` // IP address(es) in CIDR format which the security rule applies to. + // Example: 66.170.99.2/32 // Required: true IPRangeCidr *string `json:"ipRangeCidr"` // Name of security rule. + // Example: 5756f7e2 Name string `json:"name,omitempty"` // Ports the security rule applies to. + // Example: 443, 1-655535 // Required: true Ports *string `json:"ports"` // Protocol the security rule applies to. + // Example: ANY, TCP, UDP Protocol string `json:"protocol,omitempty"` // Service defined by the provider (such as: SSH, HTTPS). Either service or protocol have to be specified. + // Example: HTTPS, SSH Service string `json:"service,omitempty"` } @@ -180,6 +188,11 @@ func (m *Rule) validatePorts(formats strfmt.Registry) error { return nil } +// ContextValidate validates this rule based on context it is used +func (m *Rule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Rule) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/security_group.go b/pkg/models/security_group.go index f35d9d7d..4d11483f 100644 --- a/pkg/models/security_group.go +++ b/pkg/models/security_group.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,63 @@ type SecurityGroup struct { Links map[string]Href `json:"_links"` // Set of ids of the cloud accounts this resource belongs to. + // Example: [9e49] // Unique: true CloudAccountIds []string `json:"cloudAccountIds"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional properties that may be used to extend the base resource. + // Example: { \"property\" : \"value\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // Deployment id that is associated with this resource. + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // External entity Id on the provider side. + // Example: i-cfe4-e241-e53b-756a9a2e25d2 ExternalID string `json:"externalId,omitempty"` // The external regionId of the resource. + // Example: us-east-1 // Required: true ExternalRegionID *string `json:"externalRegionId"` // The external zoneId of the resource. + // Example: us-east-1a // Required: true ExternalZoneID *string `json:"externalZoneId"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // The id of the project this resource belongs to. + // Example: 9e49 ProjectID string `json:"projectId,omitempty"` // List of security rules. @@ -74,9 +89,11 @@ type SecurityGroup struct { Rules []*Rule `json:"rules"` // A set of tag keys and optional values that were set on this resource. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -120,6 +137,10 @@ func (m *SecurityGroup) Validate(formats strfmt.Registry) error { func (m *SecurityGroup) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -137,7 +158,6 @@ func (m *SecurityGroup) validateLinks(formats strfmt.Registry) error { } func (m *SecurityGroup) validateCloudAccountIds(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountIds) { // not required return nil } @@ -202,7 +222,6 @@ func (m *SecurityGroup) validateRules(formats strfmt.Registry) error { } func (m *SecurityGroup) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -226,6 +245,83 @@ func (m *SecurityGroup) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this security group based on the context it is used +func (m *SecurityGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRules(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecurityGroup) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *SecurityGroup) contextValidateRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Rules); i++ { + + if m.Rules[i] != nil { + if err := m.Rules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SecurityGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *SecurityGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/security_group_result.go b/pkg/models/security_group_result.go index 79784e11..62cbbd67 100644 --- a/pkg/models/security_group_result.go +++ b/pkg/models/security_group_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // SecurityGroupResult State object representing a query result of security groups. @@ -23,10 +25,12 @@ type SecurityGroupResult struct { Content []*SecurityGroup `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *SecurityGroupResult) Validate(formats strfmt.Registry) error { } func (m *SecurityGroupResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *SecurityGroupResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this security group result based on the context it is used +func (m *SecurityGroupResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecurityGroupResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*SecurityGroup(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SecurityGroupResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *SecurityGroupResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *SecurityGroupResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/security_group_specification.go b/pkg/models/security_group_specification.go index b0ed7c10..5522fab2 100644 --- a/pkg/models/security_group_specification.go +++ b/pkg/models/security_group_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,10 +20,11 @@ import ( // swagger:model SecurityGroupSpecification type SecurityGroupSpecification struct { - // Additional custom properties that may be used to extend the group. + // Additional custom properties that may be used to extend this resource. CustomProperties map[string]string `json:"customProperties,omitempty"` // The id of the deployment that is associated with this resource + // Example: 123e4567-e89b-12d3-a456-426655440000 DeploymentID string `json:"deploymentId,omitempty"` // A human-friendly description. @@ -33,6 +35,7 @@ type SecurityGroupSpecification struct { Name *string `json:"name"` // The id of the project the current user belongs to. + // Example: e058 // Required: true ProjectID *string `json:"projectId"` @@ -40,6 +43,7 @@ type SecurityGroupSpecification struct { Rules []*Rule `json:"rules"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"group\", \"value\": \"ssh\" } ] Tags []*Tag `json:"tags"` } @@ -88,7 +92,6 @@ func (m *SecurityGroupSpecification) validateProjectID(formats strfmt.Registry) } func (m *SecurityGroupSpecification) validateRules(formats strfmt.Registry) error { - if swag.IsZero(m.Rules) { // not required return nil } @@ -113,7 +116,6 @@ func (m *SecurityGroupSpecification) validateRules(formats strfmt.Registry) erro } func (m *SecurityGroupSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -137,6 +139,60 @@ func (m *SecurityGroupSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this security group specification based on the context it is used +func (m *SecurityGroupSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRules(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecurityGroupSpecification) contextValidateRules(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Rules); i++ { + + if m.Rules[i] != nil { + if err := m.Rules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SecurityGroupSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *SecurityGroupSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/service_account_request.go b/pkg/models/service_account_request.go index bd1ce7e8..6f5067e1 100644 --- a/pkg/models/service_account_request.go +++ b/pkg/models/service_account_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *ServiceAccountRequest) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this service account request based on context it is used +func (m *ServiceAccountRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceAccountRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/service_error_response.go b/pkg/models/service_error_response.go new file mode 100644 index 00000000..ffdbe698 --- /dev/null +++ b/pkg/models/service_error_response.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceErrorResponse service error response +// +// swagger:model ServiceErrorResponse +type ServiceErrorResponse struct { + + // details + Details []string `json:"details"` + + // document kind + DocumentKind string `json:"documentKind,omitempty"` + + // error code + ErrorCode int32 `json:"errorCode,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // message Id + MessageID string `json:"messageId,omitempty"` + + // server error Id + ServerErrorID string `json:"serverErrorId,omitempty"` + + // stack trace + StackTrace []string `json:"stackTrace"` + + // status code + StatusCode int32 `json:"statusCode,omitempty"` +} + +// Validate validates this service error response +func (m *ServiceErrorResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var serviceErrorResponseDetailsItemsEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SHOULD_RETRY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceErrorResponseDetailsItemsEnum = append(serviceErrorResponseDetailsItemsEnum, v) + } +} + +func (m *ServiceErrorResponse) validateDetailsItemsEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, serviceErrorResponseDetailsItemsEnum, true); err != nil { + return err + } + return nil +} + +func (m *ServiceErrorResponse) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(m.Details) { // not required + return nil + } + + for i := 0; i < len(m.Details); i++ { + + // value enum + if err := m.validateDetailsItemsEnum("details"+"."+strconv.Itoa(i), "body", m.Details[i]); err != nil { + return err + } + + } + + return nil +} + +// ContextValidate validates this service error response based on context it is used +func (m *ServiceErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceErrorResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceErrorResponse) UnmarshalBinary(b []byte) error { + var res ServiceErrorResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/slice_of_event_log.go b/pkg/models/slice_of_event_log.go index dd539038..cfcd3220 100644 --- a/pkg/models/slice_of_event_log.go +++ b/pkg/models/slice_of_event_log.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -62,7 +63,6 @@ func (m *SliceOfEventLog) Validate(formats strfmt.Registry) error { } func (m *SliceOfEventLog) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -87,7 +87,6 @@ func (m *SliceOfEventLog) validateContent(formats strfmt.Registry) error { } func (m *SliceOfEventLog) validateSort(formats strfmt.Registry) error { - if swag.IsZero(m.Sort) { // not required return nil } @@ -104,6 +103,56 @@ func (m *SliceOfEventLog) validateSort(formats strfmt.Registry) error { return nil } +// ContextValidate validate this slice of event log based on the context it is used +func (m *SliceOfEventLog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSort(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SliceOfEventLog) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SliceOfEventLog) contextValidateSort(ctx context.Context, formats strfmt.Registry) error { + + if m.Sort != nil { + if err := m.Sort.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sort") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SliceOfEventLog) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/snapshot.go b/pkg/models/snapshot.go index 8c5041c8..51fd2e0a 100644 --- a/pkg/models/snapshot.go +++ b/pkg/models/snapshot.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,28 +24,40 @@ type Snapshot struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` + // Indicates if the snapshot is the current snapshot for machine + // Example: false + IsCurrent bool `json:"isCurrent,omitempty"` + // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -67,6 +81,10 @@ func (m *Snapshot) Validate(formats strfmt.Registry) error { func (m *Snapshot) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -92,6 +110,39 @@ func (m *Snapshot) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this snapshot based on the context it is used +func (m *Snapshot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Snapshot) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Snapshot) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/snapshot_specification.go b/pkg/models/snapshot_specification.go index 3cd69e23..4c1aab20 100644 --- a/pkg/models/snapshot_specification.go +++ b/pkg/models/snapshot_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -22,34 +24,42 @@ type SnapshotSpecification struct { Links map[string]Href `json:"_links"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Additional custom properties that may be used to extend the snapshot. CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Captures the full state of a running virtual machine, including the memory. SnapshotMemory bool `json:"snapshotMemory,omitempty"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -73,6 +83,10 @@ func (m *SnapshotSpecification) Validate(formats strfmt.Registry) error { func (m *SnapshotSpecification) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -98,6 +112,39 @@ func (m *SnapshotSpecification) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this snapshot specification based on the context it is used +func (m *SnapshotSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SnapshotSpecification) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *SnapshotSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/sort.go b/pkg/models/sort.go index 635b4b36..d1293f2c 100644 --- a/pkg/models/sort.go +++ b/pkg/models/sort.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *Sort) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this sort based on context it is used +func (m *Sort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Sort) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/source_control_sync_all_request.go b/pkg/models/source_control_sync_all_request.go index 8d950c8c..ca4975d2 100644 --- a/pkg/models/source_control_sync_all_request.go +++ b/pkg/models/source_control_sync_all_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *SourceControlSyncAllRequest) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this source control sync all request based on context it is used +func (m *SourceControlSyncAllRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SourceControlSyncAllRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/source_control_sync_history.go b/pkg/models/source_control_sync_history.go index b1cc071e..33da5231 100644 --- a/pkg/models/source_control_sync_history.go +++ b/pkg/models/source_control_sync_history.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *SourceControlSyncHistory) Validate(formats strfmt.Registry) error { } func (m *SourceControlSyncHistory) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *SourceControlSyncHistory) validateContent(formats strfmt.Registry) erro } func (m *SourceControlSyncHistory) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *SourceControlSyncHistory) validateLinks(formats strfmt.Registry) error } func (m *SourceControlSyncHistory) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *SourceControlSyncHistory) validatePage(formats strfmt.Registry) error { return nil } +// ContextValidate validate this source control sync history based on the context it is used +func (m *SourceControlSyncHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SourceControlSyncHistory) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SourceControlSyncHistory) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SourceControlSyncHistory) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SourceControlSyncHistory) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/source_control_sync_history_item.go b/pkg/models/source_control_sync_history_item.go index f9830826..9d66a93b 100644 --- a/pkg/models/source_control_sync_history_item.go +++ b/pkg/models/source_control_sync_history_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -137,7 +138,6 @@ func (m *SourceControlSyncHistoryItem) validateContentTypeEnum(path, location st } func (m *SourceControlSyncHistoryItem) validateContentType(formats strfmt.Registry) error { - if swag.IsZero(m.ContentType) { // not required return nil } @@ -151,7 +151,6 @@ func (m *SourceControlSyncHistoryItem) validateContentType(formats strfmt.Regist } func (m *SourceControlSyncHistoryItem) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -164,7 +163,6 @@ func (m *SourceControlSyncHistoryItem) validateID(formats strfmt.Registry) error } func (m *SourceControlSyncHistoryItem) validateRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RequestID) { // not required return nil } @@ -177,7 +175,6 @@ func (m *SourceControlSyncHistoryItem) validateRequestID(formats strfmt.Registry } func (m *SourceControlSyncHistoryItem) validateSourceID(formats strfmt.Registry) error { - if swag.IsZero(m.SourceID) { // not required return nil } @@ -190,7 +187,6 @@ func (m *SourceControlSyncHistoryItem) validateSourceID(formats strfmt.Registry) } func (m *SourceControlSyncHistoryItem) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.Timestamp) { // not required return nil } @@ -202,6 +198,146 @@ func (m *SourceControlSyncHistoryItem) validateTimestamp(formats strfmt.Registry return nil } +// ContextValidate validate this source control sync history item based on the context it is used +func (m *SourceControlSyncHistoryItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContentFullPath(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIntegrationID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSourceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimestamp(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateContentFullPath(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentFullPath", "body", string(m.ContentFullPath)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateContentName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentName", "body", string(m.ContentName)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateContentType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentType", "body", string(m.ContentType)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "details", "body", []string(m.Details)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateIntegrationID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "integrationId", "body", string(m.IntegrationID)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateProjectID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectId", "body", string(m.ProjectID)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateProjectName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectName", "body", string(m.ProjectName)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateSourceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "sourceId", "body", strfmt.UUID(m.SourceID)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncHistoryItem) contextValidateTimestamp(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "timestamp", "body", strfmt.DateTime(m.Timestamp)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *SourceControlSyncHistoryItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/source_control_sync_request.go b/pkg/models/source_control_sync_request.go index 2fe2403e..35e7dc02 100644 --- a/pkg/models/source_control_sync_request.go +++ b/pkg/models/source_control_sync_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -83,7 +84,6 @@ func (m *SourceControlSyncRequest) Validate(formats strfmt.Registry) error { } func (m *SourceControlSyncRequest) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -96,7 +96,6 @@ func (m *SourceControlSyncRequest) validateCreatedAt(formats strfmt.Registry) er } func (m *SourceControlSyncRequest) validateLastUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdatedAt) { // not required return nil } @@ -109,7 +108,6 @@ func (m *SourceControlSyncRequest) validateLastUpdatedAt(formats strfmt.Registry } func (m *SourceControlSyncRequest) validateRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RequestID) { // not required return nil } @@ -122,7 +120,6 @@ func (m *SourceControlSyncRequest) validateRequestID(formats strfmt.Registry) er } func (m *SourceControlSyncRequest) validateSourceID(formats strfmt.Registry) error { - if swag.IsZero(m.SourceID) { // not required return nil } @@ -176,7 +173,6 @@ func (m *SourceControlSyncRequest) validateStatusEnum(path, location string, val } func (m *SourceControlSyncRequest) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -189,6 +185,94 @@ func (m *SourceControlSyncRequest) validateStatus(formats strfmt.Registry) error return nil } +// ContextValidate validate this source control sync request based on the context it is used +func (m *SourceControlSyncRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SourceControlSyncRequest) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncRequest) contextValidateLastUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastUpdatedAt", "body", strfmt.DateTime(m.LastUpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncRequest) contextValidateMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "message", "body", string(m.Message)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncRequest) contextValidateProjectID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectId", "body", string(m.ProjectID)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncRequest) contextValidateRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestId", "body", strfmt.UUID(m.RequestID)); err != nil { + return err + } + + return nil +} + +func (m *SourceControlSyncRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *SourceControlSyncRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/source_control_sync_requests.go b/pkg/models/source_control_sync_requests.go index 90ee8c66..db558b02 100644 --- a/pkg/models/source_control_sync_requests.go +++ b/pkg/models/source_control_sync_requests.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -51,7 +52,6 @@ func (m *SourceControlSyncRequests) Validate(formats strfmt.Registry) error { } func (m *SourceControlSyncRequests) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -76,7 +76,6 @@ func (m *SourceControlSyncRequests) validateContent(formats strfmt.Registry) err } func (m *SourceControlSyncRequests) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } @@ -101,7 +100,6 @@ func (m *SourceControlSyncRequests) validateLinks(formats strfmt.Registry) error } func (m *SourceControlSyncRequests) validatePage(formats strfmt.Registry) error { - if swag.IsZero(m.Page) { // not required return nil } @@ -118,6 +116,78 @@ func (m *SourceControlSyncRequests) validatePage(formats strfmt.Registry) error return nil } +// ContextValidate validate this source control sync requests based on the context it is used +func (m *SourceControlSyncRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SourceControlSyncRequests) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SourceControlSyncRequests) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SourceControlSyncRequests) contextValidatePage(ctx context.Context, formats strfmt.Registry) error { + + if m.Page != nil { + if err := m.Page.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("page") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SourceControlSyncRequests) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile.go b/pkg/models/storage_profile.go index 3636cd75..ec6ee6cc 100644 --- a/pkg/models/storage_profile.go +++ b/pkg/models/storage_profile.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,9 +25,11 @@ type StorageProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this storage profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Indicates if a storage profile is default profile or not. @@ -34,37 +37,47 @@ type StorageProfile struct { DefaultItem *bool `json:"defaultItem"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // Map of storage properties that are to be applied on disk while provisioning. + // Example: { \"diskProperties\": {\n \"provisioningType\": \"thin\",\n \"sharesLevel\": \"low\",\n \"shares\": \"500\",\n \"limitIops\": \"500\",\n \"diskType\": \"firstClass\"\n } } DiskProperties map[string]string `json:"diskProperties,omitempty"` // The id of the region for which this profile is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Indicates whether this storage profile supports encryption or not. SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -96,6 +109,10 @@ func (m *StorageProfile) Validate(formats strfmt.Registry) error { func (m *StorageProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -131,7 +148,6 @@ func (m *StorageProfile) validateID(formats strfmt.Registry) error { } func (m *StorageProfile) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -155,6 +171,61 @@ func (m *StorageProfile) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this storage profile based on the context it is used +func (m *StorageProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *StorageProfile) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_aws_result.go b/pkg/models/storage_profile_aws_result.go index 52b21542..1f56aa7a 100644 --- a/pkg/models/storage_profile_aws_result.go +++ b/pkg/models/storage_profile_aws_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // StorageProfileAwsResult State object representing a query result of Aws storage profiles. @@ -23,10 +25,12 @@ type StorageProfileAwsResult struct { Content []*AwsStorageProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *StorageProfileAwsResult) Validate(formats strfmt.Registry) error { } func (m *StorageProfileAwsResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *StorageProfileAwsResult) validateContent(formats strfmt.Registry) error return nil } +// ContextValidate validate this storage profile aws result based on the context it is used +func (m *StorageProfileAwsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileAwsResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*AwsStorageProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StorageProfileAwsResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *StorageProfileAwsResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileAwsResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_aws_specification.go b/pkg/models/storage_profile_aws_specification.go index 63668c97..ad241230 100644 --- a/pkg/models/storage_profile_aws_specification.go +++ b/pkg/models/storage_profile_aws_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,16 +21,19 @@ import ( type StorageProfileAwsSpecification struct { // Indicates if a storage profile is default or not. + // Example: true DefaultItem bool `json:"defaultItem,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // Indicates the type of storage. + // Example: ebs / instance-store // Required: true DeviceType *string `json:"deviceType"` // Indicates maximum I/O operations per second in range(1-20,000). + // Example: 2000 Iops string `json:"iops,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -37,16 +41,20 @@ type StorageProfileAwsSpecification struct { Name *string `json:"name"` // A link to the region that is associated with the storage profile. + // Example: 31186 // Required: true RegionID *string `json:"regionId"` // Indicates whether this storage profile supports encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` // Indicates the type of volume associated with type of storage. + // Example: gp2 / io1 / sc1 / st1 / standard VolumeType string `json:"volumeType,omitempty"` } @@ -104,7 +112,6 @@ func (m *StorageProfileAwsSpecification) validateRegionID(formats strfmt.Registr } func (m *StorageProfileAwsSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -128,6 +135,38 @@ func (m *StorageProfileAwsSpecification) validateTags(formats strfmt.Registry) e return nil } +// ContextValidate validate this storage profile aws specification based on the context it is used +func (m *StorageProfileAwsSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileAwsSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileAwsSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_azure_result.go b/pkg/models/storage_profile_azure_result.go index fde95ecc..6b8591a2 100644 --- a/pkg/models/storage_profile_azure_result.go +++ b/pkg/models/storage_profile_azure_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // StorageProfileAzureResult State object representing a query result of Azure storage profiles. @@ -23,10 +25,12 @@ type StorageProfileAzureResult struct { Content []*AzureStorageProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *StorageProfileAzureResult) Validate(formats strfmt.Registry) error { } func (m *StorageProfileAzureResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *StorageProfileAzureResult) validateContent(formats strfmt.Registry) err return nil } +// ContextValidate validate this storage profile azure result based on the context it is used +func (m *StorageProfileAzureResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileAzureResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*AzureStorageProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StorageProfileAzureResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *StorageProfileAzureResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileAzureResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_azure_specification.go b/pkg/models/storage_profile_azure_specification.go index e4f43340..e32be605 100644 --- a/pkg/models/storage_profile_azure_specification.go +++ b/pkg/models/storage_profile_azure_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,15 +21,22 @@ import ( type StorageProfileAzureSpecification struct { // Indicates the caching mechanism for additional disk. + // Example: None / ReadOnly / ReadWrite DataDiskCaching string `json:"dataDiskCaching,omitempty"` // Indicates if a storage policy contains default storage properties. + // Example: true DefaultItem bool `json:"defaultItem,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` + // Indicates the id of disk encryption set. + // Example: /subscriptions/b8ef63/resourceGroups/DiskEncryptionSets/providers/Microsoft.Compute/diskEncryptionSets/MyDES + DiskEncryptionSetID string `json:"diskEncryptionSetId,omitempty"` + // Indicates the performance tier for the storage type. Premium disks are SSD backed and Standard disks are HDD backed. + // Example: Standard_LRS / Premium_LRS DiskType string `json:"diskType,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -36,19 +44,24 @@ type StorageProfileAzureSpecification struct { Name *string `json:"name"` // Indicates the caching mechanism for OS disk. Default policy for OS disks is Read/Write. + // Example: None / ReadOnly / ReadWrite OsDiskCaching string `json:"osDiskCaching,omitempty"` // The If of the region that is associated with the storage profile. + // Example: 31186 // Required: true RegionID *string `json:"regionId"` // Id of a storage account where in the disk is placed. + // Example: aaa82 StorageAccountID string `json:"storageAccountId,omitempty"` // Indicates whether this storage policy should support encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A set of tag keys and optional values for a storage policy which define set of specifications for creating a disk. + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` } @@ -93,7 +106,6 @@ func (m *StorageProfileAzureSpecification) validateRegionID(formats strfmt.Regis } func (m *StorageProfileAzureSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -117,6 +129,38 @@ func (m *StorageProfileAzureSpecification) validateTags(formats strfmt.Registry) return nil } +// ContextValidate validate this storage profile azure specification based on the context it is used +func (m *StorageProfileAzureSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileAzureSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileAzureSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_result.go b/pkg/models/storage_profile_result.go index d2fadbe8..ce6b46aa 100644 --- a/pkg/models/storage_profile_result.go +++ b/pkg/models/storage_profile_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // StorageProfileResult State object representing a query result of storage profiles. @@ -23,10 +25,12 @@ type StorageProfileResult struct { Content []*StorageProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *StorageProfileResult) Validate(formats strfmt.Registry) error { } func (m *StorageProfileResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *StorageProfileResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this storage profile result based on the context it is used +func (m *StorageProfileResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*StorageProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StorageProfileResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *StorageProfileResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_specification.go b/pkg/models/storage_profile_specification.go index 3e86f129..4cac0e14 100644 --- a/pkg/models/storage_profile_specification.go +++ b/pkg/models/storage_profile_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -27,9 +28,11 @@ type StorageProfileSpecification struct { Description string `json:"description,omitempty"` // Map of storage properties that are to be applied on disk while provisioning. + // Example: { \"diskProperties\": {\n \"provisioningType\": \"thin\",\n \"sharesLevel\": \"low\",\n \"shares\": \"500\",\n \"limitIops\": \"500\"\n \"diskType\": \"firstClass\"\n \"deviceType\": \"ebs\"\n \"volumeType\": \"gp2\"\n \"azureDataDiskCaching\": \"ReadWrite\"\n \"azureOsDiskCaching\": \"ReadWrite\"\n \"azureManagedDiskType\": \"Standard_LRS\"\n } } DiskProperties map[string]string `json:"diskProperties,omitempty"` // Map of storage placements to know where the disk is provisioned. + // Example: { \"diskTargetProperties\": {\n \"storageAccountId\": \"27dhbf7\",\n \"storagePolicyId\": \"7fhfj9f\",\n \"datastoreId\": \"638nfjd8\",\n } } DiskTargetProperties map[string]string `json:"diskTargetProperties,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -37,6 +40,7 @@ type StorageProfileSpecification struct { Name *string `json:"name"` // The Id of the region that is associated with the storage profile. + // Example: 31186 // Required: true RegionID *string `json:"regionId"` @@ -44,6 +48,7 @@ type StorageProfileSpecification struct { SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` } @@ -101,7 +106,6 @@ func (m *StorageProfileSpecification) validateRegionID(formats strfmt.Registry) } func (m *StorageProfileSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -125,6 +129,38 @@ func (m *StorageProfileSpecification) validateTags(formats strfmt.Registry) erro return nil } +// ContextValidate validate this storage profile specification based on the context it is used +func (m *StorageProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_vsphere_result.go b/pkg/models/storage_profile_vsphere_result.go index 1d3966fb..4fc517a1 100644 --- a/pkg/models/storage_profile_vsphere_result.go +++ b/pkg/models/storage_profile_vsphere_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // StorageProfileVsphereResult State object representing a query result of vShpere storage profiles. @@ -23,10 +25,12 @@ type StorageProfileVsphereResult struct { Content []*VsphereStorageProfile `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *StorageProfileVsphereResult) Validate(formats strfmt.Registry) error { } func (m *StorageProfileVsphereResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *StorageProfileVsphereResult) validateContent(formats strfmt.Registry) e return nil } +// ContextValidate validate this storage profile vsphere result based on the context it is used +func (m *StorageProfileVsphereResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileVsphereResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*VsphereStorageProfile(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StorageProfileVsphereResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *StorageProfileVsphereResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileVsphereResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/storage_profile_vsphere_specification.go b/pkg/models/storage_profile_vsphere_specification.go index 12c7e5e9..1ae5a94d 100644 --- a/pkg/models/storage_profile_vsphere_specification.go +++ b/pkg/models/storage_profile_vsphere_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -20,9 +21,11 @@ import ( type StorageProfileVsphereSpecification struct { // Id of the vSphere Datastore for placing disk and VM. + // Example: 08d28 DatastoreID string `json:"datastoreId,omitempty"` // Indicates if a storage profile acts as a default storage profile for a disk. + // Example: true // Required: true DefaultItem *bool `json:"defaultItem"` @@ -30,6 +33,7 @@ type StorageProfileVsphereSpecification struct { Description string `json:"description,omitempty"` // Type of mode for the disk + // Example: undefined / independent-persistent / independent-nonpersistent DiskMode string `json:"diskMode,omitempty"` // Disk types are specified as @@ -38,9 +42,11 @@ type StorageProfileVsphereSpecification struct { // First Class - Improved version of standard virtual disks, designed to be fully mananged independent storage objects. // // Empty value is considered as Standard + // Example: standard / firstClass DiskType string `json:"diskType,omitempty"` // The upper bound for the I/O operations per second allocated for each virtual disk. + // Example: 1000 LimitIops string `json:"limitIops,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -48,25 +54,32 @@ type StorageProfileVsphereSpecification struct { Name *string `json:"name"` // Type of provisioning policy for the disk. + // Example: thin / thick / eagerZeroedThick ProvisioningType string `json:"provisioningType,omitempty"` // The Id of the region that is associated with the storage profile. + // Example: 31186 // Required: true RegionID *string `json:"regionId"` // A specific number of shares assigned to each virtual machine. + // Example: 2000 Shares string `json:"shares,omitempty"` // Shares are specified as High, Normal, Low or Custom and these values specify share values with a 4:2:1 ratio, respectively. + // Example: low / normal / high / custom SharesLevel string `json:"sharesLevel,omitempty"` // Id of the vSphere Storage Policy to be applied. + // Example: 6b59743af31d StoragePolicyID string `json:"storagePolicyId,omitempty"` // Indicates whether this storage profile supports encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile. + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` } @@ -124,7 +137,6 @@ func (m *StorageProfileVsphereSpecification) validateRegionID(formats strfmt.Reg } func (m *StorageProfileVsphereSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -148,6 +160,38 @@ func (m *StorageProfileVsphereSpecification) validateTags(formats strfmt.Registr return nil } +// ContextValidate validate this storage profile vsphere specification based on the context it is used +func (m *StorageProfileVsphereSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageProfileVsphereSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *StorageProfileVsphereSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/support.go b/pkg/models/support.go index ada58d5e..d8cd87a7 100644 --- a/pkg/models/support.go +++ b/pkg/models/support.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -36,6 +38,11 @@ func (m *Support) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this support based on context it is used +func (m *Support) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Support) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/supported_api.go b/pkg/models/supported_api.go index 977c566a..590db0dd 100644 --- a/pkg/models/supported_api.go +++ b/pkg/models/supported_api.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *SupportedAPI) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this supported Api based on context it is used +func (m *SupportedAPI) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SupportedAPI) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag.go b/pkg/models/tag.go index d7455091..0a6c967a 100644 --- a/pkg/models/tag.go +++ b/pkg/models/tag.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -62,6 +64,11 @@ func (m *Tag) validateValue(formats strfmt.Registry) error { return nil } +// ContextValidate validates this tag based on context it is used +func (m *Tag) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Tag) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_based_metering.go b/pkg/models/tag_based_metering.go index c71b3764..d8d6bf55 100644 --- a/pkg/models/tag_based_metering.go +++ b/pkg/models/tag_based_metering.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -41,7 +43,6 @@ func (m *TagBasedMetering) Validate(formats strfmt.Registry) error { } func (m *TagBasedMetering) validateMetering(formats strfmt.Registry) error { - if swag.IsZero(m.Metering) { // not required return nil } @@ -58,6 +59,34 @@ func (m *TagBasedMetering) validateMetering(formats strfmt.Registry) error { return nil } +// ContextValidate validate this tag based metering based on the context it is used +func (m *TagBasedMetering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMetering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagBasedMetering) contextValidateMetering(ctx context.Context, formats strfmt.Registry) error { + + if m.Metering != nil { + if err := m.Metering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metering") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *TagBasedMetering) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_based_metering_item.go b/pkg/models/tag_based_metering_item.go index 858070fc..6836884a 100644 --- a/pkg/models/tag_based_metering_item.go +++ b/pkg/models/tag_based_metering_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,6 @@ func (m *TagBasedMeteringItem) Validate(formats strfmt.Registry) error { } func (m *TagBasedMeteringItem) validateTagBasedMeterings(formats strfmt.Registry) error { - if swag.IsZero(m.TagBasedMeterings) { // not required return nil } @@ -64,6 +64,38 @@ func (m *TagBasedMeteringItem) validateTagBasedMeterings(formats strfmt.Registry return nil } +// ContextValidate validate this tag based metering item based on the context it is used +func (m *TagBasedMeteringItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTagBasedMeterings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagBasedMeteringItem) contextValidateTagBasedMeterings(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagBasedMeterings); i++ { + + if m.TagBasedMeterings[i] != nil { + if err := m.TagBasedMeterings[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagBasedMeterings" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *TagBasedMeteringItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_based_one_time_metering.go b/pkg/models/tag_based_one_time_metering.go index 8fa40ae2..47947a4f 100644 --- a/pkg/models/tag_based_one_time_metering.go +++ b/pkg/models/tag_based_one_time_metering.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -41,7 +43,6 @@ func (m *TagBasedOneTimeMetering) Validate(formats strfmt.Registry) error { } func (m *TagBasedOneTimeMetering) validateOneTimeMetering(formats strfmt.Registry) error { - if swag.IsZero(m.OneTimeMetering) { // not required return nil } @@ -58,6 +59,34 @@ func (m *TagBasedOneTimeMetering) validateOneTimeMetering(formats strfmt.Registr return nil } +// ContextValidate validate this tag based one time metering based on the context it is used +func (m *TagBasedOneTimeMetering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOneTimeMetering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagBasedOneTimeMetering) contextValidateOneTimeMetering(ctx context.Context, formats strfmt.Registry) error { + + if m.OneTimeMetering != nil { + if err := m.OneTimeMetering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oneTimeMetering") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *TagBasedOneTimeMetering) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_based_one_time_metering_item.go b/pkg/models/tag_based_one_time_metering_item.go index a35fc4fb..1fb638dc 100644 --- a/pkg/models/tag_based_one_time_metering_item.go +++ b/pkg/models/tag_based_one_time_metering_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,6 @@ func (m *TagBasedOneTimeMeteringItem) Validate(formats strfmt.Registry) error { } func (m *TagBasedOneTimeMeteringItem) validateOneTimeMeterings(formats strfmt.Registry) error { - if swag.IsZero(m.OneTimeMeterings) { // not required return nil } @@ -64,6 +64,38 @@ func (m *TagBasedOneTimeMeteringItem) validateOneTimeMeterings(formats strfmt.Re return nil } +// ContextValidate validate this tag based one time metering item based on the context it is used +func (m *TagBasedOneTimeMeteringItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOneTimeMeterings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagBasedOneTimeMeteringItem) contextValidateOneTimeMeterings(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OneTimeMeterings); i++ { + + if m.OneTimeMeterings[i] != nil { + if err := m.OneTimeMeterings[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oneTimeMeterings" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *TagBasedOneTimeMeteringItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_based_rate_factor_item.go b/pkg/models/tag_based_rate_factor_item.go index 7acefcd3..21c81834 100644 --- a/pkg/models/tag_based_rate_factor_item.go +++ b/pkg/models/tag_based_rate_factor_item.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,6 @@ func (m *TagBasedRateFactorItem) Validate(formats strfmt.Registry) error { } func (m *TagBasedRateFactorItem) validateRateFactors(formats strfmt.Registry) error { - if swag.IsZero(m.RateFactors) { // not required return nil } @@ -64,6 +64,38 @@ func (m *TagBasedRateFactorItem) validateRateFactors(formats strfmt.Registry) er return nil } +// ContextValidate validate this tag based rate factor item based on the context it is used +func (m *TagBasedRateFactorItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRateFactors(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagBasedRateFactorItem) contextValidateRateFactors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.RateFactors); i++ { + + if m.RateFactors[i] != nil { + if err := m.RateFactors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rateFactors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *TagBasedRateFactorItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/tag_result.go b/pkg/models/tag_result.go index 67380d33..90cdfbe8 100644 --- a/pkg/models/tag_result.go +++ b/pkg/models/tag_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // TagResult State object representing a query result of tags. @@ -23,10 +25,12 @@ type TagResult struct { Content []*Tag `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *TagResult) Validate(formats strfmt.Registry) error { } func (m *TagResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *TagResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this tag result based on the context it is used +func (m *TagResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Tag(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TagResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *TagResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *TagResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/terraform_blueprint_config.go b/pkg/models/terraform_blueprint_config.go index 5b3dadc1..14af44f7 100644 --- a/pkg/models/terraform_blueprint_config.go +++ b/pkg/models/terraform_blueprint_config.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -86,7 +88,6 @@ func (m *TerraformBlueprintConfig) Validate(formats strfmt.Registry) error { } func (m *TerraformBlueprintConfig) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -99,7 +100,6 @@ func (m *TerraformBlueprintConfig) validateCreatedAt(formats strfmt.Registry) er } func (m *TerraformBlueprintConfig) validateTerraformToBlueprintMapping(formats strfmt.Registry) error { - if swag.IsZero(m.TerraformToBlueprintMapping) { // not required return nil } @@ -117,7 +117,6 @@ func (m *TerraformBlueprintConfig) validateTerraformToBlueprintMapping(formats s } func (m *TerraformBlueprintConfig) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -129,6 +128,125 @@ func (m *TerraformBlueprintConfig) validateUpdatedAt(formats strfmt.Registry) er return nil } +// ContextValidate validate this terraform blueprint config based on the context it is used +func (m *TerraformBlueprintConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProjectName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTerraformToBlueprintMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateProjectName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "projectName", "body", string(m.ProjectName)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateTerraformToBlueprintMapping(ctx context.Context, formats strfmt.Registry) error { + + if m.TerraformToBlueprintMapping != nil { + if err := m.TerraformToBlueprintMapping.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("terraformToBlueprintMapping") + } + return err + } + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TerraformBlueprintConfig) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *TerraformBlueprintConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/terraform_configuration_source_reference.go b/pkg/models/terraform_configuration_source_reference.go index 4edcbedf..161488f7 100644 --- a/pkg/models/terraform_configuration_source_reference.go +++ b/pkg/models/terraform_configuration_source_reference.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,7 +47,6 @@ func (m *TerraformConfigurationSourceReference) Validate(formats strfmt.Registry } func (m *TerraformConfigurationSourceReference) validateRepositoryID(formats strfmt.Registry) error { - if swag.IsZero(m.RepositoryID) { // not required return nil } @@ -57,6 +58,11 @@ func (m *TerraformConfigurationSourceReference) validateRepositoryID(formats str return nil } +// ContextValidate validates this terraform configuration source reference based on context it is used +func (m *TerraformConfigurationSourceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *TerraformConfigurationSourceReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/terraform_to_blueprint_mapping.go b/pkg/models/terraform_to_blueprint_mapping.go index 5498f23a..22854740 100644 --- a/pkg/models/terraform_to_blueprint_mapping.go +++ b/pkg/models/terraform_to_blueprint_mapping.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -66,7 +67,6 @@ func (m *TerraformToBlueprintMapping) Validate(formats strfmt.Registry) error { } func (m *TerraformToBlueprintMapping) validateConfigurationSourceReference(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigurationSourceReference) { // not required return nil } @@ -84,7 +84,6 @@ func (m *TerraformToBlueprintMapping) validateConfigurationSourceReference(forma } func (m *TerraformToBlueprintMapping) validateOutputValues(formats strfmt.Registry) error { - if swag.IsZero(m.OutputValues) { // not required return nil } @@ -109,7 +108,6 @@ func (m *TerraformToBlueprintMapping) validateOutputValues(formats strfmt.Regist } func (m *TerraformToBlueprintMapping) validateProviders(formats strfmt.Registry) error { - if swag.IsZero(m.Providers) { // not required return nil } @@ -134,7 +132,6 @@ func (m *TerraformToBlueprintMapping) validateProviders(formats strfmt.Registry) } func (m *TerraformToBlueprintMapping) validateVariables(formats strfmt.Registry) error { - if swag.IsZero(m.Variables) { // not required return nil } @@ -158,6 +155,100 @@ func (m *TerraformToBlueprintMapping) validateVariables(formats strfmt.Registry) return nil } +// ContextValidate validate this terraform to blueprint mapping based on the context it is used +func (m *TerraformToBlueprintMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConfigurationSourceReference(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOutputValues(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProviders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVariables(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TerraformToBlueprintMapping) contextValidateConfigurationSourceReference(ctx context.Context, formats strfmt.Registry) error { + + if m.ConfigurationSourceReference != nil { + if err := m.ConfigurationSourceReference.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("configurationSourceReference") + } + return err + } + } + + return nil +} + +func (m *TerraformToBlueprintMapping) contextValidateOutputValues(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OutputValues); i++ { + + if m.OutputValues[i] != nil { + if err := m.OutputValues[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outputValues" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TerraformToBlueprintMapping) contextValidateProviders(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Providers); i++ { + + if m.Providers[i] != nil { + if err := m.Providers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("providers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TerraformToBlueprintMapping) contextValidateVariables(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Variables); i++ { + + if m.Variables[i] != nil { + if err := m.Variables[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("variables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *TerraformToBlueprintMapping) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/terraform_version.go b/pkg/models/terraform_version.go index 2210cfa6..6c07d32c 100644 --- a/pkg/models/terraform_version.go +++ b/pkg/models/terraform_version.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -83,7 +85,6 @@ func (m *TerraformVersion) Validate(formats strfmt.Registry) error { } func (m *TerraformVersion) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -96,7 +97,6 @@ func (m *TerraformVersion) validateCreatedAt(formats strfmt.Registry) error { } func (m *TerraformVersion) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required return nil } @@ -109,7 +109,6 @@ func (m *TerraformVersion) validateID(formats strfmt.Registry) error { } func (m *TerraformVersion) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -121,6 +120,94 @@ func (m *TerraformVersion) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this terraform version based on the context it is used +func (m *TerraformVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrgID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TerraformVersion) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TerraformVersion) contextValidateCreatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdBy", "body", string(m.CreatedBy)); err != nil { + return err + } + + return nil +} + +func (m *TerraformVersion) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *TerraformVersion) contextValidateOrgID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "orgId", "body", string(m.OrgID)); err != nil { + return err + } + + return nil +} + +func (m *TerraformVersion) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TerraformVersion) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedBy", "body", string(m.UpdatedBy)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *TerraformVersion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/time_series_value.go b/pkg/models/time_series_value.go index 12871d6e..2ef035d3 100644 --- a/pkg/models/time_series_value.go +++ b/pkg/models/time_series_value.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -44,7 +46,6 @@ func (m *TimeSeriesValue) Validate(formats strfmt.Registry) error { } func (m *TimeSeriesValue) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.Timestamp) { // not required return nil } @@ -56,6 +57,42 @@ func (m *TimeSeriesValue) validateTimestamp(formats strfmt.Registry) error { return nil } +// ContextValidate validate this time series value based on the context it is used +func (m *TimeSeriesValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTimestamp(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValue(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TimeSeriesValue) contextValidateTimestamp(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "timestamp", "body", strfmt.DateTime(m.Timestamp)); err != nil { + return err + } + + return nil +} + +func (m *TimeSeriesValue) contextValidateValue(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "value", "body", float64(m.Value)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *TimeSeriesValue) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_aws_specification.go b/pkg/models/update_cloud_account_aws_specification.go index a3e5d6da..b6a447d7 100644 --- a/pkg/models/update_cloud_account_aws_specification.go +++ b/pkg/models/update_cloud_account_aws_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -18,7 +19,11 @@ import ( // swagger:model UpdateCloudAccountAwsSpecification type UpdateCloudAccountAwsSpecification struct { + // access key Id + AccessKeyID string `json:"accessKeyId,omitempty"` + // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -28,9 +33,14 @@ type UpdateCloudAccountAwsSpecification struct { Name string `json:"name,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"us-east-1\", \"us-west-1\"] RegionIds []string `json:"regionIds"` + // secret access key + SecretAccessKey string `json:"secretAccessKey,omitempty"` + // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -49,7 +59,6 @@ func (m *UpdateCloudAccountAwsSpecification) Validate(formats strfmt.Registry) e } func (m *UpdateCloudAccountAwsSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -73,6 +82,38 @@ func (m *UpdateCloudAccountAwsSpecification) validateTags(formats strfmt.Registr return nil } +// ContextValidate validate this update cloud account aws specification based on the context it is used +func (m *UpdateCloudAccountAwsSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountAwsSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountAwsSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_azure_specification.go b/pkg/models/update_cloud_account_azure_specification.go index 6355d0a7..b909956b 100644 --- a/pkg/models/update_cloud_account_azure_specification.go +++ b/pkg/models/update_cloud_account_azure_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -18,7 +19,14 @@ import ( // swagger:model UpdateCloudAccountAzureSpecification type UpdateCloudAccountAzureSpecification struct { + // client application Id + ClientApplicationID string `json:"clientApplicationId,omitempty"` + + // client application secret key + ClientApplicationSecretKey string `json:"clientApplicationSecretKey,omitempty"` + // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -28,9 +36,11 @@ type UpdateCloudAccountAzureSpecification struct { Name string `json:"name,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"westus\", \"eastus\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -49,7 +59,6 @@ func (m *UpdateCloudAccountAzureSpecification) Validate(formats strfmt.Registry) } func (m *UpdateCloudAccountAzureSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -73,6 +82,38 @@ func (m *UpdateCloudAccountAzureSpecification) validateTags(formats strfmt.Regis return nil } +// ContextValidate validate this update cloud account azure specification based on the context it is used +func (m *UpdateCloudAccountAzureSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountAzureSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountAzureSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_gcp_specification.go b/pkg/models/update_cloud_account_gcp_specification.go index f864e133..dd6cbdcf 100644 --- a/pkg/models/update_cloud_account_gcp_specification.go +++ b/pkg/models/update_cloud_account_gcp_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateCloudAccountGcpSpecification struct { // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -28,9 +30,11 @@ type UpdateCloudAccountGcpSpecification struct { Name string `json:"name,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"us-east1\", \"northamerica-northeast1\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -49,7 +53,6 @@ func (m *UpdateCloudAccountGcpSpecification) Validate(formats strfmt.Registry) e } func (m *UpdateCloudAccountGcpSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -73,6 +76,38 @@ func (m *UpdateCloudAccountGcpSpecification) validateTags(formats strfmt.Registr return nil } +// ContextValidate validate this update cloud account gcp specification based on the context it is used +func (m *UpdateCloudAccountGcpSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountGcpSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountGcpSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_nsx_t_specification.go b/pkg/models/update_cloud_account_nsx_t_specification.go index 4d92acca..b5179ee5 100644 --- a/pkg/models/update_cloud_account_nsx_t_specification.go +++ b/pkg/models/update_cloud_account_nsx_t_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateCloudAccountNsxTSpecification struct { // vSphere cloud accounts associated with this NSX-T cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // A human-friendly description. @@ -28,12 +30,15 @@ type UpdateCloudAccountNsxTSpecification struct { Name string `json:"name,omitempty"` // Password to authenticate with the cloud account + // Example: LVJbZNAkPCJs Password string `json:"password,omitempty"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` // Username to authenticate with the cloud account + // Example: administrator@csp.local Username string `json:"username,omitempty"` } @@ -52,7 +57,6 @@ func (m *UpdateCloudAccountNsxTSpecification) Validate(formats strfmt.Registry) } func (m *UpdateCloudAccountNsxTSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -76,6 +80,38 @@ func (m *UpdateCloudAccountNsxTSpecification) validateTags(formats strfmt.Regist return nil } +// ContextValidate validate this update cloud account nsx t specification based on the context it is used +func (m *UpdateCloudAccountNsxTSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountNsxTSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountNsxTSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_nsx_v_specification.go b/pkg/models/update_cloud_account_nsx_v_specification.go index cbff2760..7e0f72cf 100644 --- a/pkg/models/update_cloud_account_nsx_v_specification.go +++ b/pkg/models/update_cloud_account_nsx_v_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateCloudAccountNsxVSpecification struct { // vSphere cloud account associated with this NSX-V cloud account. NSX-V cloud account can be associated with a single vSphere cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // A human-friendly description. @@ -28,6 +30,7 @@ type UpdateCloudAccountNsxVSpecification struct { Name string `json:"name,omitempty"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -46,7 +49,6 @@ func (m *UpdateCloudAccountNsxVSpecification) Validate(formats strfmt.Registry) } func (m *UpdateCloudAccountNsxVSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -70,6 +72,38 @@ func (m *UpdateCloudAccountNsxVSpecification) validateTags(formats strfmt.Regist return nil } +// ContextValidate validate this update cloud account nsx v specification based on the context it is used +func (m *UpdateCloudAccountNsxVSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountNsxVSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountNsxVSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_specification.go b/pkg/models/update_cloud_account_specification.go index 96759de4..dc57a0bb 100644 --- a/pkg/models/update_cloud_account_specification.go +++ b/pkg/models/update_cloud_account_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,12 +20,15 @@ import ( type UpdateCloudAccountSpecification struct { // Cloud accounts to associate with this cloud account + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // Additional custom properties that may be used to extend the Cloud Account. + // Example: { \"sampleadapterProjectId\" : \"projectId\" } CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. @@ -34,15 +38,19 @@ type UpdateCloudAccountSpecification struct { Name string `json:"name,omitempty"` // Secret access key or password to be used to authenticate with the cloud account + // Example: [ \"LVJbZNAkPCJs\" ] PrivateKey string `json:"privateKey,omitempty"` // Access key id or username to be used to authenticate with the cloud account + // Example: [ \"ACDC55DB4MFH6ADG75KK\" ] PrivateKeyID string `json:"privateKeyId,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"us-east-1\", \"ap-northeast-1\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -61,7 +69,6 @@ func (m *UpdateCloudAccountSpecification) Validate(formats strfmt.Registry) erro } func (m *UpdateCloudAccountSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -85,6 +92,38 @@ func (m *UpdateCloudAccountSpecification) validateTags(formats strfmt.Registry) return nil } +// ContextValidate validate this update cloud account specification based on the context it is used +func (m *UpdateCloudAccountSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_vcf_specification.go b/pkg/models/update_cloud_account_vcf_specification.go index e564501c..5be0d2fa 100644 --- a/pkg/models/update_cloud_account_vcf_specification.go +++ b/pkg/models/update_cloud_account_vcf_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateCloudAccountVcfSpecification struct { // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -28,9 +30,11 @@ type UpdateCloudAccountVcfSpecification struct { Name string `json:"name,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"Datacenter:datacenter-2\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -49,7 +53,6 @@ func (m *UpdateCloudAccountVcfSpecification) Validate(formats strfmt.Registry) e } func (m *UpdateCloudAccountVcfSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -73,6 +76,38 @@ func (m *UpdateCloudAccountVcfSpecification) validateTags(formats strfmt.Registr return nil } +// ContextValidate validate this update cloud account vcf specification based on the context it is used +func (m *UpdateCloudAccountVcfSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountVcfSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountVcfSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_vmc_specification.go b/pkg/models/update_cloud_account_vmc_specification.go index 70978ccd..4299e479 100644 --- a/pkg/models/update_cloud_account_vmc_specification.go +++ b/pkg/models/update_cloud_account_vmc_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateCloudAccountVmcSpecification struct { // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -28,9 +30,11 @@ type UpdateCloudAccountVmcSpecification struct { Name string `json:"name,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"us-east-1\", \"us-west-1\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` } @@ -49,7 +53,6 @@ func (m *UpdateCloudAccountVmcSpecification) Validate(formats strfmt.Registry) e } func (m *UpdateCloudAccountVmcSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -73,6 +76,38 @@ func (m *UpdateCloudAccountVmcSpecification) validateTags(formats strfmt.Registr return nil } +// ContextValidate validate this update cloud account vmc specification based on the context it is used +func (m *UpdateCloudAccountVmcSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountVmcSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountVmcSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_cloud_account_vsphere_specification.go b/pkg/models/update_cloud_account_vsphere_specification.go index 57a4fbad..81dcd631 100644 --- a/pkg/models/update_cloud_account_vsphere_specification.go +++ b/pkg/models/update_cloud_account_vsphere_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,9 +20,11 @@ import ( type UpdateCloudAccountVsphereSpecification struct { // NSX-V or NSX-T account to associate with this vSphere cloud account. vSphere cloud account can be a single NSX-V cloud account or a single NSX-T cloud account. + // Example: [ \"42f3e0d199d134755684cd935435a\" ] AssociatedCloudAccountIds []string `json:"associatedCloudAccountIds"` // Create default cloud zones for the enabled regions. + // Example: true CreateDefaultZones bool `json:"createDefaultZones,omitempty"` // A human-friendly description. @@ -31,15 +34,19 @@ type UpdateCloudAccountVsphereSpecification struct { Name string `json:"name,omitempty"` // Password to authenticate with the cloud account + // Example: LVJbZNAkPCJs Password string `json:"password,omitempty"` // A set of Region names to enable provisioning on. + // Example: [\"Datacenter:datacenter-2\"] RegionIds []string `json:"regionIds"` // A set of tag keys and optional values to set on the Cloud Account + // Example: [{\"key\": \"env\", \"value\": \"dev\"}] Tags []*Tag `json:"tags"` // Username to authenticate with the cloud account + // Example: administrator@csp.local Username string `json:"username,omitempty"` } @@ -58,7 +65,6 @@ func (m *UpdateCloudAccountVsphereSpecification) Validate(formats strfmt.Registr } func (m *UpdateCloudAccountVsphereSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -82,6 +88,38 @@ func (m *UpdateCloudAccountVsphereSpecification) validateTags(formats strfmt.Reg return nil } +// ContextValidate validate this update cloud account vsphere specification based on the context it is used +func (m *UpdateCloudAccountVsphereSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCloudAccountVsphereSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateCloudAccountVsphereSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_external_network_ip_range_specification.go b/pkg/models/update_external_network_ip_range_specification.go index 5ef9b334..20a58d24 100644 --- a/pkg/models/update_external_network_ip_range_specification.go +++ b/pkg/models/update_external_network_ip_range_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *UpdateExternalNetworkIPRangeSpecification) Validate(formats strfmt.Regi return nil } +// ContextValidate validates this update external network IP range specification based on context it is used +func (m *UpdateExternalNetworkIPRangeSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *UpdateExternalNetworkIPRangeSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_flavor_profile_specification.go b/pkg/models/update_flavor_profile_specification.go index 8f1fbfdc..1e05ed93 100644 --- a/pkg/models/update_flavor_profile_specification.go +++ b/pkg/models/update_flavor_profile_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,6 +23,7 @@ type UpdateFlavorProfileSpecification struct { Description string `json:"description,omitempty"` // Map between global fabric flavor keys and fabric flavor descriptions + // Example: { \"small\": { \"name\": \"t2.small\" }, \"medium\": { \"name\": \"t2.medium\"}}, \"vSphere_small\": { \"cpuCount\": \"2\", \"memoryInMB\": \"2048\"}, \"vSphere_medium\": { \"cpuCount\": \"4\", \"memoryInMB\": \"4096\"}} // Required: true FlavorMapping map[string]FabricFlavorDescription `json:"flavorMapping"` @@ -49,6 +52,10 @@ func (m *UpdateFlavorProfileSpecification) Validate(formats strfmt.Registry) err func (m *UpdateFlavorProfileSpecification) validateFlavorMapping(formats strfmt.Registry) error { + if err := validate.Required("flavorMapping", "body", m.FlavorMapping); err != nil { + return err + } + for k := range m.FlavorMapping { if err := validate.Required("flavorMapping"+"."+k, "body", m.FlavorMapping[k]); err != nil { @@ -74,6 +81,39 @@ func (m *UpdateFlavorProfileSpecification) validateName(formats strfmt.Registry) return nil } +// ContextValidate validate this update flavor profile specification based on the context it is used +func (m *UpdateFlavorProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFlavorMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFlavorProfileSpecification) contextValidateFlavorMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("flavorMapping", "body", m.FlavorMapping); err != nil { + return err + } + + for k := range m.FlavorMapping { + + if val, ok := m.FlavorMapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateFlavorProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_image_profile_specification.go b/pkg/models/update_image_profile_specification.go index 451bc897..5d1d3240 100644 --- a/pkg/models/update_image_profile_specification.go +++ b/pkg/models/update_image_profile_specification.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,6 +23,7 @@ type UpdateImageProfileSpecification struct { Description string `json:"description,omitempty"` // Image mapping defined for the corresponding region. + // Example: { \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"centos\": { \"id\": \"9e50\", \"name\": \"ami-centos-7-1.13.0-00-1543963388\"}} // Required: true ImageMapping map[string]FabricImageDescription `json:"imageMapping"` @@ -49,6 +52,10 @@ func (m *UpdateImageProfileSpecification) Validate(formats strfmt.Registry) erro func (m *UpdateImageProfileSpecification) validateImageMapping(formats strfmt.Registry) error { + if err := validate.Required("imageMapping", "body", m.ImageMapping); err != nil { + return err + } + for k := range m.ImageMapping { if err := validate.Required("imageMapping"+"."+k, "body", m.ImageMapping[k]); err != nil { @@ -74,6 +81,39 @@ func (m *UpdateImageProfileSpecification) validateName(formats strfmt.Registry) return nil } +// ContextValidate validate this update image profile specification based on the context it is used +func (m *UpdateImageProfileSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImageMapping(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateImageProfileSpecification) contextValidateImageMapping(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("imageMapping", "body", m.ImageMapping); err != nil { + return err + } + + for k := range m.ImageMapping { + + if val, ok := m.ImageMapping[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateImageProfileSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_machine_specification.go b/pkg/models/update_machine_specification.go index 60e01fd7..7f2cd0dc 100644 --- a/pkg/models/update_machine_specification.go +++ b/pkg/models/update_machine_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -18,13 +19,14 @@ import ( // swagger:model UpdateMachineSpecification type UpdateMachineSpecification struct { - // Additional custom properties that may be used to extend the machine. Custom properties prefixed with: "__" are discarded. + // Additional custom properties that may be used to extend the machine. Internal custom properties (for example, prefixed with: "__") can not be updated. CustomProperties map[string]string `json:"customProperties,omitempty"` // Describes machine within the scope of your organization and is not propagated to the cloud Description string `json:"description,omitempty"` // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` } @@ -43,7 +45,6 @@ func (m *UpdateMachineSpecification) Validate(formats strfmt.Registry) error { } func (m *UpdateMachineSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -67,6 +68,38 @@ func (m *UpdateMachineSpecification) validateTags(formats strfmt.Registry) error return nil } +// ContextValidate validate this update machine specification based on the context it is used +func (m *UpdateMachineSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMachineSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateMachineSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/update_security_group_specification.go b/pkg/models/update_security_group_specification.go index 89694d4b..efdf8db3 100644 --- a/pkg/models/update_security_group_specification.go +++ b/pkg/models/update_security_group_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,7 @@ import ( type UpdateSecurityGroupSpecification struct { // A set of tag keys and optional values that should be set on any resource that is produced from this specification. + // Example: [ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ] Tags []*Tag `json:"tags"` } @@ -37,7 +39,6 @@ func (m *UpdateSecurityGroupSpecification) Validate(formats strfmt.Registry) err } func (m *UpdateSecurityGroupSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -61,6 +62,38 @@ func (m *UpdateSecurityGroupSpecification) validateTags(formats strfmt.Registry) return nil } +// ContextValidate validate this update security group specification based on the context it is used +func (m *UpdateSecurityGroupSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSecurityGroupSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateSecurityGroupSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/uri.go b/pkg/models/uri.go index fa9af556..7312b634 100644 --- a/pkg/models/uri.go +++ b/pkg/models/uri.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -72,6 +74,11 @@ func (m *URI) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this URI based on context it is used +func (m *URI) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *URI) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/user.go b/pkg/models/user.go index 28ea77bf..9f890ab7 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -18,10 +20,12 @@ import ( type User struct { // The email of the user or name of the group. + // Example: administrator@vmware.com // Required: true Email *string `json:"email"` // Type of the principal. Currently supported 'user' (default) and 'group'. + // Example: user Type string `json:"type,omitempty"` } @@ -48,6 +52,11 @@ func (m *User) validateEmail(formats strfmt.Registry) error { return nil } +// ContextValidate validates this user based on context it is used +func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *User) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/variable.go b/pkg/models/variable.go index 4f61143f..2d2acd85 100644 --- a/pkg/models/variable.go +++ b/pkg/models/variable.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -89,7 +90,6 @@ func (m *Variable) validateTypeEnum(path, location string, value string) error { } func (m *Variable) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -102,6 +102,11 @@ func (m *Variable) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this variable based on context it is used +func (m *Variable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Variable) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_credential_requests.go b/pkg/models/vcf_credential_requests.go index f60a0445..3cee430f 100644 --- a/pkg/models/vcf_credential_requests.go +++ b/pkg/models/vcf_credential_requests.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,7 +38,6 @@ func (m *VcfCredentialRequests) Validate(formats strfmt.Registry) error { } func (m *VcfCredentialRequests) validateCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.Credentials) { // not required return nil } @@ -61,6 +61,38 @@ func (m *VcfCredentialRequests) validateCredentials(formats strfmt.Registry) err return nil } +// ContextValidate validate this vcf credential requests based on the context it is used +func (m *VcfCredentialRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCredentials(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VcfCredentialRequests) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Credentials); i++ { + + if m.Credentials[i] != nil { + if err := m.Credentials[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credentials" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VcfCredentialRequests) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_domain.go b/pkg/models/vcf_domain.go index cd5dd237..d604cb4b 100644 --- a/pkg/models/vcf_domain.go +++ b/pkg/models/vcf_domain.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -62,7 +63,6 @@ func (m *VcfDomain) Validate(formats strfmt.Registry) error { } func (m *VcfDomain) validateNsxResource(formats strfmt.Registry) error { - if swag.IsZero(m.NsxResource) { // not required return nil } @@ -115,7 +115,6 @@ func (m *VcfDomain) validateStatusEnum(path, location string, value string) erro } func (m *VcfDomain) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -129,7 +128,6 @@ func (m *VcfDomain) validateStatus(formats strfmt.Registry) error { } func (m *VcfDomain) validateVsphere(formats strfmt.Registry) error { - if swag.IsZero(m.Vsphere) { // not required return nil } @@ -146,6 +144,52 @@ func (m *VcfDomain) validateVsphere(formats strfmt.Registry) error { return nil } +// ContextValidate validate this vcf domain based on the context it is used +func (m *VcfDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNsxResource(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVsphere(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VcfDomain) contextValidateNsxResource(ctx context.Context, formats strfmt.Registry) error { + + if m.NsxResource != nil { + if err := m.NsxResource.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nsxResource") + } + return err + } + } + + return nil +} + +func (m *VcfDomain) contextValidateVsphere(ctx context.Context, formats strfmt.Registry) error { + + if m.Vsphere != nil { + if err := m.Vsphere.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vsphere") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VcfDomain) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_domains.go b/pkg/models/vcf_domains.go index 0557e73f..969d8e0e 100644 --- a/pkg/models/vcf_domains.go +++ b/pkg/models/vcf_domains.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,7 +38,6 @@ func (m *VcfDomains) Validate(formats strfmt.Registry) error { } func (m *VcfDomains) validateDomains(formats strfmt.Registry) error { - if swag.IsZero(m.Domains) { // not required return nil } @@ -61,6 +61,38 @@ func (m *VcfDomains) validateDomains(formats strfmt.Registry) error { return nil } +// ContextValidate validate this vcf domains based on the context it is used +func (m *VcfDomains) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDomains(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VcfDomains) contextValidateDomains(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Domains); i++ { + + if m.Domains[i] != nil { + if err := m.Domains[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("domains" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VcfDomains) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_service_account.go b/pkg/models/vcf_service_account.go index 5180e4fb..db024c98 100644 --- a/pkg/models/vcf_service_account.go +++ b/pkg/models/vcf_service_account.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -45,6 +47,11 @@ func (m *VcfServiceAccount) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this vcf service account based on context it is used +func (m *VcfServiceAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VcfServiceAccount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_service_credential.go b/pkg/models/vcf_service_credential.go index 04f387a4..16f0e75d 100644 --- a/pkg/models/vcf_service_credential.go +++ b/pkg/models/vcf_service_credential.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -57,6 +59,11 @@ func (m *VcfServiceCredential) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this vcf service credential based on context it is used +func (m *VcfServiceCredential) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VcfServiceCredential) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vcf_service_credential_creation_response.go b/pkg/models/vcf_service_credential_creation_response.go index 46e8001c..7972a142 100644 --- a/pkg/models/vcf_service_credential_creation_response.go +++ b/pkg/models/vcf_service_credential_creation_response.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -56,7 +57,6 @@ func (m *VcfServiceCredentialCreationResponse) Validate(formats strfmt.Registry) } func (m *VcfServiceCredentialCreationResponse) validateCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.Credentials) { // not required return nil } @@ -113,7 +113,6 @@ func (m *VcfServiceCredentialCreationResponse) validateStatusEnum(path, location } func (m *VcfServiceCredentialCreationResponse) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required return nil } @@ -126,6 +125,38 @@ func (m *VcfServiceCredentialCreationResponse) validateStatus(formats strfmt.Reg return nil } +// ContextValidate validate this vcf service credential creation response based on the context it is used +func (m *VcfServiceCredentialCreationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCredentials(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VcfServiceCredentialCreationResponse) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Credentials); i++ { + + if m.Credentials[i] != nil { + if err := m.Credentials[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credentials" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VcfServiceCredentialCreationResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/volume_type_list.go b/pkg/models/volume_type_list.go index 0896394a..13cf9f49 100644 --- a/pkg/models/volume_type_list.go +++ b/pkg/models/volume_type_list.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *VolumeTypeList) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volume type list based on context it is used +func (m *VolumeTypeList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumeTypeList) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vsphere_account.go b/pkg/models/vsphere_account.go index e14243dd..37456c53 100644 --- a/pkg/models/vsphere_account.go +++ b/pkg/models/vsphere_account.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *VsphereAccount) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this vsphere account based on context it is used +func (m *VsphereAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VsphereAccount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/vsphere_storage_profile.go b/pkg/models/vsphere_storage_profile.go index 18ebb544..73702b2f 100644 --- a/pkg/models/vsphere_storage_profile.go +++ b/pkg/models/vsphere_storage_profile.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,19 +25,24 @@ type VsphereStorageProfile struct { Links map[string]Href `json:"_links"` // Id of the cloud account this storage profile belongs to. + // Example: [9e49] CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // Indicates if a storage profile contains default storage properties. + // Example: false // Required: true DefaultItem *bool `json:"defaultItem"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // Type of mode for the disk + // Example: undefined / independent-persistent / independent-nonpersistent DiskMode string `json:"diskMode,omitempty"` // Disk types are specified as @@ -44,46 +50,60 @@ type VsphereStorageProfile struct { // First Class - Improved version of standard virtual disks, designed to be fully mananged // independent storage objects. // Empty value is considered as Standard + // Example: firstClass / standard DiskType string `json:"diskType,omitempty"` // The id of the region for which this profile is defined + // Example: Datacenter:datacenter-2 ExternalRegionID string `json:"externalRegionId,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // The upper bound for the I/O operations per second allocated for each disk. + // Example: 1000 LimitIops string `json:"limitIops,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // Type of format for the disk. + // Example: thin / thick / eagerZeroedThick ProvisioningType string `json:"provisioningType,omitempty"` // A specific number of shares assigned to each virtual machine. + // Example: 2000 Shares string `json:"shares,omitempty"` // Shares level are specified as High, Normal, Low or Custom. + // Example: low / normal / high / custom SharesLevel string `json:"sharesLevel,omitempty"` // Indicates whether this storage profile should support encryption or not. + // Example: false SupportsEncryption bool `json:"supportsEncryption,omitempty"` // A list of tags that represent the capabilities of this storage profile + // Example: [ { \"key\" : \"tier\", \"value\": \"silver\" } ] Tags []*Tag `json:"tags"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -115,6 +135,10 @@ func (m *VsphereStorageProfile) Validate(formats strfmt.Registry) error { func (m *VsphereStorageProfile) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -150,7 +174,6 @@ func (m *VsphereStorageProfile) validateID(formats strfmt.Registry) error { } func (m *VsphereStorageProfile) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -174,6 +197,61 @@ func (m *VsphereStorageProfile) validateTags(formats strfmt.Registry) error { return nil } +// ContextValidate validate this vsphere storage profile based on the context it is used +func (m *VsphereStorageProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VsphereStorageProfile) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *VsphereStorageProfile) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VsphereStorageProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/zone.go b/pkg/models/zone.go index 6550b950..369c6ca1 100644 --- a/pkg/models/zone.go +++ b/pkg/models/zone.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -24,49 +25,64 @@ type Zone struct { Links map[string]Href `json:"_links"` // Cloud account this zone belongs to. + // Example: 9e49 CloudAccountID string `json:"cloudAccountId,omitempty"` // Date when the entity was created. The date is in ISO 8601 and UTC. + // Example: 2012-09-27 CreatedAt string `json:"createdAt,omitempty"` // A list of key value pair of properties that will be used + // Example: {\"__isDefaultPlacementZone\": \"true\"} CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. + // Example: my-description Description string `json:"description,omitempty"` // The id of the region for which this zone is defined + // Example: us-east-1 ExternalRegionID string `json:"externalRegionId,omitempty"` // The folder relative path to the datacenter where resources are deployed to. (only applicable for vSphere cloud zones) + // Example: test-folder Folder string `json:"folder,omitempty"` // The id of this resource instance + // Example: 9e49 // Required: true ID *string `json:"id"` // A human-friendly name used as an identifier in APIs that support this option. + // Example: my-name Name string `json:"name,omitempty"` // The id of the organization this entity belongs to. + // Example: 9e49 OrgID string `json:"orgId,omitempty"` // This field is deprecated. Use orgId instead. The id of the organization this entity belongs to. + // Example: deprecated OrganizationID string `json:"organizationId,omitempty"` // Email of the user that owns the entity. + // Example: csp@vmware.com Owner string `json:"owner,omitempty"` // The placement policy for the zone. + // Example: DEFAULT, SPREAD, BINPACK PlacementPolicy string `json:"placementPolicy,omitempty"` // A set of tag keys and optional values that were set on this placement. + // Example: [ { \"key\" : \"dev\", \"value\": \" \" } ] Tags []*Tag `json:"tags"` // A set of tag keys and optional values for compute resource filtering. + // Example: [ { \"key\" : \"compliance\", \"value\": \"pci\" } ] TagsToMatch []*Tag `json:"tagsToMatch"` // Date when the entity was last updated. The date is ISO 8601 and UTC. + // Example: 2012-09-27 UpdatedAt string `json:"updatedAt,omitempty"` } @@ -98,6 +114,10 @@ func (m *Zone) Validate(formats strfmt.Registry) error { func (m *Zone) validateLinks(formats strfmt.Registry) error { + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + for k := range m.Links { if err := validate.Required("_links"+"."+k, "body", m.Links[k]); err != nil { @@ -124,7 +144,6 @@ func (m *Zone) validateID(formats strfmt.Registry) error { } func (m *Zone) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -149,7 +168,6 @@ func (m *Zone) validateTags(formats strfmt.Registry) error { } func (m *Zone) validateTagsToMatch(formats strfmt.Registry) error { - if swag.IsZero(m.TagsToMatch) { // not required return nil } @@ -173,6 +191,83 @@ func (m *Zone) validateTagsToMatch(formats strfmt.Registry) error { return nil } +// ContextValidate validate this zone based on the context it is used +func (m *Zone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagsToMatch(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Zone) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("_links", "body", m.Links); err != nil { + return err + } + + for k := range m.Links { + + if val, ok := m.Links[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *Zone) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Zone) contextValidateTagsToMatch(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagsToMatch); i++ { + + if m.TagsToMatch[i] != nil { + if err := m.TagsToMatch[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagsToMatch" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Zone) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/zone_assignment_config.go b/pkg/models/zone_assignment_config.go index 4d447c3b..70c39d2e 100644 --- a/pkg/models/zone_assignment_config.go +++ b/pkg/models/zone_assignment_config.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -16,21 +18,27 @@ import ( type ZoneAssignmentConfig struct { // The maximum amount of cpus that can be used by this cloud zone. Default is 0 (unlimited cpu). + // Example: 2048 CPULimit int64 `json:"cpuLimit,omitempty"` // The maximum number of instances that can be provisioned in this cloud zone. Default is 0 (unlimited instances). + // Example: 50 MaxNumberInstances int64 `json:"maxNumberInstances,omitempty"` // The maximum amount of memory that can be used by this cloud zone. Default is 0 (unlimited memory). + // Example: 2048 MemoryLimitMB int64 `json:"memoryLimitMB,omitempty"` // The priority of this zone in the current project. Lower numbers mean higher priority. Default is 0 (highest) + // Example: 1 Priority int32 `json:"priority,omitempty"` // Defines an upper limit on storage that can be requested from a cloud zone which is part of this project. Default is 0 (unlimited storage). Please note that this feature is supported only for vSphere cloud zones. Not valid for other cloud zone types. + // Example: 20 StorageLimitGB int64 `json:"storageLimitGB,omitempty"` // The Cloud Zone Id + // Example: 77ee1 ZoneID string `json:"zoneId,omitempty"` } @@ -39,6 +47,11 @@ func (m *ZoneAssignmentConfig) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this zone assignment config based on context it is used +func (m *ZoneAssignmentConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ZoneAssignmentConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/zone_result.go b/pkg/models/zone_result.go index 41707145..af16316b 100644 --- a/pkg/models/zone_result.go +++ b/pkg/models/zone_result.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ZoneResult State object representing a query result of Zones. @@ -23,10 +25,12 @@ type ZoneResult struct { Content []*Zone `json:"content"` // Number of elements in the current page + // Example: 1 // Read Only: true NumberOfElements int64 `json:"numberOfElements,omitempty"` // Total number of elements. In some cases the field may not be populated + // Example: 1 // Read Only: true TotalElements int64 `json:"totalElements,omitempty"` } @@ -46,7 +50,6 @@ func (m *ZoneResult) Validate(formats strfmt.Registry) error { } func (m *ZoneResult) validateContent(formats strfmt.Registry) error { - if swag.IsZero(m.Content) { // not required return nil } @@ -70,6 +73,68 @@ func (m *ZoneResult) validateContent(formats strfmt.Registry) error { return nil } +// ContextValidate validate this zone result based on the context it is used +func (m *ZoneResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumberOfElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTotalElements(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ZoneResult) contextValidateContent(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "content", "body", []*Zone(m.Content)); err != nil { + return err + } + + for i := 0; i < len(m.Content); i++ { + + if m.Content[i] != nil { + if err := m.Content[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ZoneResult) contextValidateNumberOfElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfElements", "body", int64(m.NumberOfElements)); err != nil { + return err + } + + return nil +} + +func (m *ZoneResult) contextValidateTotalElements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "totalElements", "body", int64(m.TotalElements)); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ZoneResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/models/zone_specification.go b/pkg/models/zone_specification.go index df7bec7a..fefb66ad 100644 --- a/pkg/models/zone_specification.go +++ b/pkg/models/zone_specification.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,13 +20,19 @@ import ( // swagger:model ZoneSpecification type ZoneSpecification struct { + // The ids of the compute resources that will be explicitly assigned to this zone + // Example: [ab12c] + ComputeIds []string `json:"computeIds"` + // A list of key value pair of properties that will be used + // Example: {\"__isDefaultPlacementZone\": \"true\"} CustomProperties map[string]string `json:"customProperties,omitempty"` // A human-friendly description. Description string `json:"description,omitempty"` // The folder relative path to the datacenter where resources are deployed to. (only applicable for vSphere cloud zones) + // Example: test-folder Folder string `json:"folder,omitempty"` // A human-friendly name used as an identifier in APIs that support this option. @@ -33,16 +40,20 @@ type ZoneSpecification struct { Name *string `json:"name"` // Placement policy for the zone. One of DEFAULT, SPREAD or BINPACK. + // Example: DEFAULT PlacementPolicy string `json:"placementPolicy,omitempty"` // The id of the region for which this profile is created + // Example: 9e49 // Required: true RegionID *string `json:"regionId"` // A set of tag keys and optional values that are effectively applied to all compute resources in this zone, but only in the context of this zone. + // Example: [ { \"key\" : \"production\", \"value\": \" \" } ] Tags []*Tag `json:"tags"` // A set of tag keys and optional values that will be used + // Example: [ { \"key\" : \"compliance\", \"value\": \"pci\" } ] TagsToMatch []*Tag `json:"tagsToMatch"` } @@ -91,7 +102,6 @@ func (m *ZoneSpecification) validateRegionID(formats strfmt.Registry) error { } func (m *ZoneSpecification) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } @@ -116,7 +126,6 @@ func (m *ZoneSpecification) validateTags(formats strfmt.Registry) error { } func (m *ZoneSpecification) validateTagsToMatch(formats strfmt.Registry) error { - if swag.IsZero(m.TagsToMatch) { // not required return nil } @@ -140,6 +149,60 @@ func (m *ZoneSpecification) validateTagsToMatch(formats strfmt.Registry) error { return nil } +// ContextValidate validate this zone specification based on the context it is used +func (m *ZoneSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagsToMatch(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ZoneSpecification) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ZoneSpecification) contextValidateTagsToMatch(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TagsToMatch); i++ { + + if m.TagsToMatch[i] != nil { + if err := m.TagsToMatch[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagsToMatch" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ZoneSpecification) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/swagger/vra-iaas.json b/swagger/vra-iaas.json index f19c7ec3..2b331493 100644 --- a/swagger/vra-iaas.json +++ b/swagger/vra-iaas.json @@ -18,6 +18,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -66,9 +69,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -135,7 +144,7 @@ "application/json", "app/json" ], - "description": "Second day promote operation on disk", + "description": "Second day promote operation on disk. Applicable for vSphere Block Devices only", "operationId": "PromoteDisk", "responses": { "202": { @@ -145,9 +154,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -189,9 +204,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -233,6 +254,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -267,6 +291,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -301,6 +328,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -320,13 +350,13 @@ }, "/iaas/api/block-devices/{id}/operations/snapshots": { "post": { - "summary": "Create snapshot operation for first class disk", + "summary": "Create snapshot operation for Block Device", "produces": [ "application/json", "app/json" ], - "description": "Second day create snapshot operation for first class disk", - "operationId": "createFirstClassDiskSnapshot", + "description": "Second day create snapshot operation for Block device", + "operationId": "createBlockDeviceSnapshot", "responses": { "202": { "schema": { @@ -338,6 +368,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -388,9 +421,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -432,6 +471,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -466,9 +508,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -517,9 +565,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -556,6 +610,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -597,9 +654,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -617,6 +680,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -641,9 +711,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -685,6 +761,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -754,9 +833,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -798,6 +883,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -832,9 +920,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -852,6 +946,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -876,9 +977,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -927,9 +1034,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -972,6 +1085,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1020,9 +1136,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1064,9 +1186,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1108,6 +1236,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1118,6 +1249,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -1142,12 +1308,21 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Input(s) not Found" } }, @@ -1189,6 +1364,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1223,9 +1401,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1265,6 +1449,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1313,9 +1500,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1357,9 +1550,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1401,6 +1600,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1415,20 +1617,20 @@ { "in": "query", "name": "$top", - "description": "Number of records you want", + "description": "Number of records you want to get.", "type": "integer", "required": false }, { "in": "query", "name": "$skip", - "description": "Number of records you want to skip", + "description": "Number of records you want to skip.", "type": "integer", "required": false }, { "in": "query", - "name": "orderBy", + "name": "$orderBy", "description": "Sorting criteria in the format: property (asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", "type": "string", "required": false @@ -1436,7 +1638,7 @@ { "in": "query", "name": "$count", - "description": "Total number of records. If the collection has a filter, the number of records matching the filter", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", "type": "boolean", "required": false }, @@ -1444,7 +1646,7 @@ "in": "query", "name": "$filter", "description": "Filter the results by a specified predicate expression. A set of operators and functions are defined for use:\nOperators: eq, ne, gt, ge, lt, le, and, or, not.\nFunctions:\nbool substringof(string p0, string p1)\nbool endswith(string p0, string p1)\nbool startswith(string p0, string p1)\nint length(string p0)\nint indexof(string p0, string p1)\nstring replace(string p0, string find, string replace)\nstring substring(string p0, int pos)\nstring substring(string p0, int pos, int length)\nstring tolower(string p0)\nstring toupper(string p0)\nstring trim(string p0)\nstring concat(string p0, string p1)", - "type": "boolean", + "type": "string", "required": false } ], @@ -1470,9 +1672,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1514,6 +1722,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1524,6 +1735,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -1548,9 +1794,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1599,9 +1851,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1619,6 +1877,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -1641,6 +1906,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1689,9 +1957,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1735,9 +2009,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1779,6 +2059,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1813,12 +2096,21 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1867,9 +2159,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1911,6 +2209,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -1921,6 +2222,34 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -1936,14 +2265,20 @@ "responses": { "200": { "schema": { - "$ref": "#/definitions/BlockDevice" + "$ref": "#/definitions/DiskSnapshot" }, "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -1951,7 +2286,7 @@ { "in": "path", "name": "id", - "description": "The ID of the machine.", + "description": "The ID of the disk.", "type": "string", "required": true }, @@ -1975,13 +2310,13 @@ ] }, "delete": { - "summary": "Delete snapshot operation for first class disk", + "summary": "Delete snapshot operation for Block device", "produces": [ "application/json", "app/json" ], - "description": "Second day delete snapshot operation for first class disk", - "operationId": "deleteFirstClassDiskSnapshot", + "description": "Second day delete snapshot operation for Block device", + "operationId": "deleteBlockDeviceSnapshot", "responses": { "202": { "schema": { @@ -1993,6 +2328,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2041,6 +2379,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2075,9 +2416,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2126,9 +2473,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2165,6 +2518,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2206,12 +2562,21 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2257,9 +2622,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2302,6 +2673,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2336,9 +2710,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2371,6 +2751,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2410,9 +2793,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2463,9 +2852,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2502,6 +2897,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2543,6 +2941,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2577,9 +2978,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2621,9 +3028,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2665,6 +3078,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2699,9 +3115,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2743,6 +3165,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2777,9 +3202,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2828,9 +3259,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2867,6 +3304,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2908,6 +3348,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -2918,6 +3361,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -2942,12 +3420,21 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Change security groups action is not supported for a machine cluster" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -2999,9 +3486,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3050,9 +3543,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3089,6 +3588,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3130,9 +3632,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3181,9 +3689,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3220,6 +3734,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3292,9 +3809,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3344,9 +3867,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3395,9 +3924,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3415,6 +3950,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -3434,6 +3976,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3458,6 +4003,65 @@ ] } }, + "/iaas/api/security-groups/{id}/operations/reconfigure": { + "post": { + "summary": "Reconfigure operation for security group", + "produces": [ + "application/json", + "app/json" + ], + "description": "Day-2 reconfigure operation for new security groups provisioned by vRA. This is not supported for 'existing' security groups", + "operationId": "reconfigureSecurityGroup", + "responses": { + "202": { + "schema": { + "$ref": "#/definitions/RequestTracker" + }, + "description": "successful operation" + }, + "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Reconfigure is not supported for 'existing' type of security group." + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "schema": { + "$ref": "#/definitions/SecurityGroupSpecification" + }, + "in": "body", + "name": "body", + "description": "Security group Specification instance", + "required": true + }, + { + "in": "path", + "name": "id", + "description": "The ID of the security group.", + "type": "string", + "required": true + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Security Group" + ] + } + }, "/iaas/api/deployments": { "post": { "summary": "Create deployment", @@ -3475,9 +4079,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3522,6 +4132,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3532,6 +4145,34 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -3556,6 +4197,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3590,9 +4234,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3641,9 +4291,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3676,6 +4332,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3717,9 +4376,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3768,9 +4433,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -3807,6 +4478,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3848,9 +4522,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3892,6 +4572,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3926,9 +4609,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -3977,9 +4666,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4012,6 +4707,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4053,9 +4751,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4088,6 +4792,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4114,12 +4821,12 @@ }, "/iaas/api/block-devices/{id}/operations/revert": { "post": { - "summary": "Revert snapshot operation for disk", + "summary": "Revert snapshot operation for Block device", "produces": [ "application/json", "app/json" ], - "description": "Second day revert snapshot operation for disk", + "description": "Second day revert snapshot operation for Block device", "operationId": "revertDiskSnapshot", "responses": { "202": { @@ -4129,9 +4836,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4180,9 +4893,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4222,6 +4941,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4270,9 +4992,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4316,9 +5044,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4367,9 +5101,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4411,9 +5151,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4455,6 +5201,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4489,9 +5238,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4540,9 +5295,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4579,6 +5340,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4603,6 +5367,65 @@ ] } }, + "/iaas/api/compute-gateways/{id}/operations/reconfigure": { + "post": { + "summary": "Deprecated: Reconfigure operation for compute gateway", + "produces": [ + "application/json", + "app/json" + ], + "description": "Deprecated: Day-2 reconfigure operation for compute gateway. Use Day-2 reconfigure operation on compute nat resource instead.", + "operationId": "reconfigureComputeGateway", + "responses": { + "202": { + "schema": { + "$ref": "#/definitions/RequestTracker" + }, + "description": "successful operation" + }, + "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "NAT rules cannot be null" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "schema": { + "$ref": "#/definitions/ReconfigureComputeGatewaySpecification" + }, + "in": "body", + "name": "body", + "description": "Reconfigure Compute Gateway Specification instance", + "required": true + }, + { + "in": "path", + "name": "id", + "description": "The ID of the Compute Gateway", + "type": "string", + "required": true + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Compute Gateway" + ] + } + }, "/iaas/api/machines/{id}/disks/{id1}": { "get": { "summary": "Get machine disk", @@ -4616,9 +5439,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -4662,6 +5491,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4711,9 +5543,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4755,6 +5593,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4789,9 +5630,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4835,9 +5682,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4879,6 +5732,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4913,9 +5769,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4957,6 +5819,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -4967,6 +5832,34 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Only 'ne', 'eq', 'and' & 'or' are supported at this time", + "type": "boolean", + "required": false } ], "tags": [ @@ -4991,9 +5884,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5035,6 +5934,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5052,6 +5954,65 @@ ] } }, + "/iaas/api/compute-nats/{id}/operations/reconfigure": { + "post": { + "summary": "Reconfigure operation for nat", + "produces": [ + "application/json", + "app/json" + ], + "description": "Day-2 reconfigure operation for nat", + "operationId": "reconfigureNat", + "responses": { + "202": { + "schema": { + "$ref": "#/definitions/RequestTracker" + }, + "description": "successful operation" + }, + "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "NAT rules cannot be null" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "schema": { + "$ref": "#/definitions/ReconfigureComputeNatSpecification" + }, + "in": "body", + "name": "body", + "description": "Reconfigure compute nat specification instance", + "required": true + }, + { + "in": "path", + "name": "id", + "description": "The ID of the Compute Nat", + "type": "string", + "required": true + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Compute Nat" + ] + } + }, "/iaas/api/machines/{id}/operations/restart": { "post": { "summary": "Restart operation for machine", @@ -5069,9 +6030,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5113,9 +6080,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5164,9 +6137,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5203,6 +6182,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5244,9 +6226,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5295,9 +6283,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5315,6 +6309,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -5374,9 +6375,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5427,9 +6434,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5506,9 +6519,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5557,9 +6576,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5596,6 +6621,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5636,9 +6664,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5683,6 +6717,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5730,9 +6767,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5775,6 +6818,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5830,9 +6876,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5874,9 +6926,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -5920,9 +6978,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -5940,6 +7004,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -5947,6 +7018,105 @@ ] } }, + "/iaas/api/compute-nats/{id}": { + "get": { + "summary": "Get a Compute Nat", + "produces": [ + "application/json", + "app/json" + ], + "description": "Get Compute Nat with a given id", + "operationId": "getComputeNat", + "responses": { + "200": { + "schema": { + "$ref": "#/definitions/ComputeNat" + }, + "description": "successful operation" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + }, + "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Not Found" + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "description": "The ID of the Compute Nat resource.", + "type": "string", + "required": true + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Compute Nat" + ] + }, + "delete": { + "summary": "Delete a compute nat", + "produces": [ + "application/json", + "app/json" + ], + "description": "Delete compute nat with a given id", + "operationId": "deleteComputeNat", + "responses": { + "202": { + "schema": { + "$ref": "#/definitions/RequestTracker" + }, + "description": "successful operation" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "description": "The ID of the compute nat resource.", + "type": "string", + "required": true + }, + { + "in": "query", + "name": "forceDelete", + "description": "Controls whether this is a force delete operation. If true, best effort is made for deleting this nat. Use with caution as force deleting may cause inconsistencies between the cloud provider and vRA.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Compute Nat" + ] + } + }, "/iaas/api/machines/{id}/operations/snapshots": { "post": { "summary": "Create snapshot operation for machine", @@ -5964,9 +7134,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6017,9 +7193,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6068,9 +7250,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6107,6 +7295,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6148,9 +7339,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6192,6 +7389,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6226,9 +7426,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6268,6 +7474,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6279,6 +7488,13 @@ "type": "string", "required": true }, + { + "in": "query", + "name": "forceDelete", + "description": "If true, best effort is made for deleting this deployment and all related resources. In some situations, this may leave provisioned infrastructure resources behind. Please ensure you remove them manually. If false, a standard delete action will be executed.", + "type": "boolean", + "required": false + }, { "in": "query", "name": "apiVersion", @@ -6309,9 +7525,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6351,6 +7573,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6399,9 +7624,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6445,9 +7676,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6489,6 +7726,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6523,9 +7763,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6604,6 +7850,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6614,6 +7863,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -6638,9 +7922,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6682,9 +7972,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6726,6 +8022,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6760,9 +8059,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6811,9 +8116,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6831,6 +8142,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -6855,9 +8173,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -6899,6 +8223,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6924,9 +8251,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6968,6 +8301,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -6998,9 +8334,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7047,6 +8389,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7130,9 +8475,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7181,9 +8532,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7220,6 +8577,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7261,6 +8621,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7271,6 +8634,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -7295,9 +8693,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7339,6 +8743,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7373,9 +8780,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7424,9 +8837,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7468,9 +8887,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7512,6 +8937,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7539,16 +8967,22 @@ "description": "Creates an internal network IP range.", "operationId": "createInternalNetworkIPRange", "responses": { - "202": { + "201": { "schema": { - "$ref": "#/definitions/RequestTracker" + "$ref": "#/definitions/NetworkIPRange" }, "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7590,9 +9024,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7627,9 +9067,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7673,6 +9119,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7707,9 +9156,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7727,6 +9182,13 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false } ], "tags": [ @@ -7751,6 +9213,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7761,6 +9226,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -7785,9 +9285,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7836,9 +9342,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -7875,6 +9387,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7916,9 +9431,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -7967,9 +9488,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8002,6 +9529,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8043,9 +9573,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8087,6 +9623,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8121,9 +9660,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8172,9 +9717,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8207,6 +9758,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8248,6 +9802,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8258,6 +9815,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -8282,9 +9874,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8326,9 +9924,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8372,9 +9976,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8416,6 +10026,96 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Cloud Account" + ] + } + }, + "/iaas/api/compute-nats": { + "post": { + "summary": "Create a Compute Nat", + "produces": [ + "application/json", + "app/json" + ], + "description": "Create a new Compute Nat. ", + "operationId": "createComputeNat", + "responses": { + "202": { + "schema": { + "$ref": "#/definitions/RequestTracker" + }, + "description": "successful operation" + }, + "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Invalid Request - bad data" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, + "description": "Forbidden" + } + }, + "parameters": [ + { + "schema": { + "$ref": "#/definitions/ComputeNatSpecification" + }, + "in": "body", + "name": "body", + "description": "Compute Nat Specification instance", + "required": true + }, + { + "in": "query", + "name": "apiVersion", + "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", + "type": "string", + "required": false + } + ], + "tags": [ + "Compute Nat" + ] + }, + "get": { + "summary": "Get Compute Nats", + "produces": [ + "application/json", + "app/json" + ], + "description": "Get all Compute Nats", + "operationId": "getComputeNats", + "responses": { + "200": { + "schema": { + "$ref": "#/definitions/ComputeNatResult" + }, + "description": "successful operation" + }, + "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8429,7 +10129,7 @@ } ], "tags": [ - "Cloud Account" + "Compute Nat" ] } }, @@ -8485,9 +10185,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8529,6 +10235,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8563,9 +10272,15 @@ "description": "successful operation" }, "400": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Invalid Request - bad data" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8614,9 +10329,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8653,9 +10374,15 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "409": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Conflict, when the project is in use" } }, @@ -8697,6 +10424,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8731,6 +10461,9 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8741,6 +10474,41 @@ "description": "The version of the API in yyyy-MM-dd format (UTC). For versioning information refer to /iaas/api/about", "type": "string", "required": false + }, + { + "in": "query", + "name": "$top", + "description": "Number of records you want to get.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$skip", + "description": "Number of records you want to skip.", + "type": "integer", + "required": false + }, + { + "in": "query", + "name": "$count", + "description": "Flag which when specified shows the total number of records. If the collection has a filter it shows the number of records matching the filter.", + "type": "boolean", + "required": false + }, + { + "in": "query", + "name": "$select", + "description": "Select a subset of properties to include in the response.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "$filter", + "description": "Filter the results by a specified predicate expression. Operators: eq, ne, and, or.", + "type": "string", + "required": false } ], "tags": [ @@ -8761,9 +10529,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8811,9 +10585,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8855,9 +10635,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8906,9 +10692,15 @@ "description": "successful operation" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" }, "404": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Not Found" } }, @@ -8945,6 +10737,9 @@ "description": "No Content" }, "403": { + "schema": { + "$ref": "#/definitions/ServiceErrorResponse" + }, "description": "Forbidden" } }, @@ -8970,7 +10765,7 @@ } } }, - "host": "api.mgmt.cloud.vmware.com", + "host": "cava-r-90-055.eng.vmware.com", "schemes": [ "https" ], @@ -9072,7 +10867,7 @@ "$ref": "#/definitions/FabricImageDescription" }, "type": "object", - "example": "{ \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"coreos\": { \"id\": \"9e50\", \"name\": \"ami-coreos-26.04-1.9.1-00-543254235\"}}" + "example": "{ \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"centos\": { \"id\": \"9e50\", \"name\": \"ami-centos-7-1.13.0-00-1543963388\"}}" }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", @@ -9088,10 +10883,21 @@ "description": "Specification for Disk Snapshot creation request.", "type": "object", "properties": { + "name": { + "description": "A human-friendly name used as an identifier in APIs that support this option.", + "type": "string" + }, "description": { "description": "A human-friendly description.", - "type": "string", - "example": "a snapshot description" + "type": "string" + }, + "snapshotProperties": { + "description": "Cloud specific snapshot properties supplied in as name value pairs", + "additionalProperties": { + "type": "string" + }, + "type": "object", + "example": "{\"incremental\": \"true\"," } } }, @@ -9257,6 +11063,12 @@ "UpdateCloudAccountAwsSpecification": { "type": "object", "properties": { + "accessKeyId": { + "type": "string" + }, + "secretAccessKey": { + "type": "string" + }, "createDefaultZones": { "description": "Create default cloud zones for the enabled regions.", "type": "boolean", @@ -9300,6 +11112,11 @@ "type": "string", "example": "1298765" }, + "scsiController": { + "description": "The SCSI controller to be assigned", + "type": "string", + "example": "SCSI_Controller_0, SCSI_Controller_1, SCSI_Controller_2, SCSI_Controller_3" + }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", "type": "string" @@ -9307,6 +11124,11 @@ "description": { "description": "A human-friendly description.", "type": "string" + }, + "unitNumber": { + "description": "The Unit Number to be assigned", + "type": "string", + "example": "0" } } }, @@ -9559,6 +11381,49 @@ } } }, + "ComputeNatSpecification": { + "type": "object", + "required": [ + "gateway", + "name", + "natRules", + "projectId" + ], + "properties": { + "customProperties": { + "description": "Additional custom properties that may be used to extend this resource.", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "deploymentId": { + "description": "The id of the deployment that is associated with this resource", + "type": "string", + "example": "123e4567-e89b-12d3-a456-426655440000" + }, + "name": { + "description": "A human-friendly name used as an identifier in APIs that support this option.", + "type": "string" + }, + "natRules": { + "description": "List of NAT Rules", + "type": "array", + "items": { + "$ref": "#/definitions/NatRule" + } + }, + "projectId": { + "description": "The id of the project the current user belongs to.", + "type": "string", + "example": "e058" + }, + "gateway": { + "description": "Id of the Compute Gateway to which the Compute Nat resource will be attached", + "type": "string" + } + } + }, "UpdateCloudAccountNsxVSpecification": { "type": "object", "properties": { @@ -9773,7 +11638,7 @@ "type": "string" }, "dcId": { - "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors", + "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors.\nNote: Data collector endpoints are not available in vRA on-prem release.", "type": "string", "example": "23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4" }, @@ -9805,7 +11670,7 @@ } }, "customProperties": { - "description": "Additional custom properties that may be used to extend the load balancer.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, @@ -10085,7 +11950,7 @@ "example": true }, "dcid": { - "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors", + "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors.\nNote: Data collector endpoints are not available in vRA on-prem release.", "type": "string", "example": "23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4" }, @@ -10252,6 +12117,14 @@ "type": "string", "example": "${project.name}-test-${####}" }, + "customProperties": { + "description": "The project custom properties which are added to all requests in this project", + "additionalProperties": { + "type": "string" + }, + "type": "object", + "example": "{ \"property\" : \"value\" }" + }, "sharedResources": { "description": "Specifies whether the resources in this projects are shared or not.", "type": "boolean" @@ -10269,6 +12142,11 @@ "type": "string", "example": "my-name" }, + "placementPolicy": { + "description": "Placement policy for the project. Determines how a zone will be selected for provisioning. DEFAULT or SPREAD.", + "type": "string", + "example": "DEFAULT" + }, "id": { "description": "The id of this resource instance", "type": "string", @@ -10312,6 +12190,11 @@ "type": "string", "example": "2012-09-27" }, + "isCurrent": { + "description": "Indicates if the snapshot is the current snapshot for machine ", + "type": "boolean", + "example": false + }, "_links": { "description": "HATEOAS of the entity", "additionalProperties": { @@ -10664,73 +12547,195 @@ "ports": { "description": "Ports the security rule applies to.", "type": "string", - "example": "443, 1-655535" + "example": "443, 1-655535" + }, + "direction": { + "description": "Direction of the security rule (inbound or outboud). ", + "type": "string", + "enum": [ + "Inbound", + "Outbound" + ], + "example": "Outbound" + } + } + }, + "StorageProfileAwsSpecification": { + "description": "Represents a specification of AWS storage profile.", + "type": "object", + "required": [ + "deviceType", + "name", + "regionId" + ], + "properties": { + "deviceType": { + "description": "Indicates the type of storage.", + "type": "string", + "example": "ebs / instance-store" + }, + "volumeType": { + "description": "Indicates the type of volume associated with type of storage.", + "type": "string", + "example": "gp2 / io1 / sc1 / st1 / standard" + }, + "supportsEncryption": { + "description": "Indicates whether this storage profile supports encryption or not.", + "type": "boolean", + "example": false + }, + "regionId": { + "description": "A link to the region that is associated with the storage profile.", + "type": "string", + "example": "31186" + }, + "name": { + "description": "A human-friendly name used as an identifier in APIs that support this option.", + "type": "string" + }, + "iops": { + "description": "Indicates maximum I/O operations per second in range(1-20,000).", + "type": "string", + "example": "2000" + }, + "description": { + "description": "A human-friendly description.", + "type": "string" + }, + "defaultItem": { + "description": "Indicates if a storage profile is default or not.", + "type": "boolean", + "example": true + }, + "tags": { + "description": "A list of tags that represent the capabilities of this storage profile", + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "example": "[ { \"key\" : \"tier\", \"value\": \"silver\" } ]" + } + } + }, + "ComputeNat": { + "description": "The compute nat object is used to configure NAT rules on the Edge Gateway or Tier-1 logical router in NSX to enable port forwarding.
**HATEOAS** links:
**self** - Nat - Self link to this nat", + "type": "object", + "required": [ + "_links", + "externalRegionId", + "externalZoneId", + "gateway", + "id", + "natRules" + ], + "properties": { + "owner": { + "description": "Email of the user that owns the entity.", + "type": "string", + "example": "csp@vmware.com" + }, + "_links": { + "description": "HATEOAS of the entity", + "additionalProperties": { + "$ref": "#/definitions/Href" + }, + "type": "object" + }, + "externalZoneId": { + "description": "The external zoneId of the resource.", + "type": "string", + "example": "us-east-1a" + }, + "externalRegionId": { + "description": "The external regionId of the resource.", + "type": "string", + "example": "us-east-1" + }, + "description": { + "description": "A human-friendly description.", + "type": "string", + "example": "my-description" + }, + "externalId": { + "description": "External entity Id on the provider side.", + "type": "string", + "example": "i-cfe4-e241-e53b-756a9a2e25d2" }, - "direction": { - "description": "Direction of the security rule (inbound or outboud). ", + "orgId": { + "description": "The id of the organization this entity belongs to.", "type": "string", - "enum": [ - "Inbound", - "Outbound" - ], - "example": "Outbound" - } - } - }, - "StorageProfileAwsSpecification": { - "description": "Represents a specification of AWS storage profile.", - "type": "object", - "required": [ - "deviceType", - "name", - "regionId" - ], - "properties": { - "deviceType": { - "description": "Indicates the type of storage.", + "example": "9e49" + }, + "tags": { + "description": "A set of tag keys and optional values that were set on this resource.", + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "example": "[ { \"key\" : \"ownedBy\", \"value\": \"Rainpole\" } ]" + }, + "organizationId": { + "description": "This field is deprecated. Use orgId instead. The id of the organization this entity belongs to.", "type": "string", - "example": "ebs / instance-store" + "example": "deprecated" }, - "volumeType": { - "description": "Indicates the type of volume associated with type of storage.", + "createdAt": { + "description": "Date when the entity was created. The date is in ISO 8601 and UTC.", "type": "string", - "example": "gp2 / io1 / sc1 / st1 / standard" + "example": "2012-09-27" }, - "supportsEncryption": { - "description": "Indicates whether this storage profile supports encryption or not.", - "type": "boolean", - "example": false + "cloudAccountIds": { + "uniqueItems": true, + "description": "Set of ids of the cloud accounts this resource belongs to.", + "type": "array", + "items": { + "type": "string" + }, + "example": "[9e49]" }, - "regionId": { - "description": "A link to the region that is associated with the storage profile.", + "customProperties": { + "description": "Additional properties that may be used to extend the base resource.", + "additionalProperties": { + "type": "string" + }, + "type": "object", + "example": "{ \"property\" : \"value\" }" + }, + "deploymentId": { + "description": "Deployment id that is associated with this resource.", "type": "string", - "example": "31186" + "example": "123e4567-e89b-12d3-a456-426655440000" }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", - "type": "string" - }, - "iops": { - "description": "Indicates maximum I/O operations per second in range(1-20,000).", "type": "string", - "example": "2000" - }, - "description": { - "description": "A human-friendly description.", - "type": "string" + "example": "my-name" }, - "defaultItem": { - "description": "Indicates if a storage profile is default or not.", - "type": "boolean", - "example": true + "id": { + "description": "The id of this resource instance", + "type": "string", + "example": "9e49" }, - "tags": { - "description": "A list of tags that represent the capabilities of this storage profile", + "natRules": { + "description": "A list of NAT rule(s) to be created on the NSX network", "type": "array", "items": { - "$ref": "#/definitions/Tag" - }, - "example": "[ { \"key\" : \"tier\", \"value\": \"silver\" } ]" + "$ref": "#/definitions/NatRule" + } + }, + "projectId": { + "description": "The id of the project this resource belongs to.", + "type": "string", + "example": "9e49" + }, + "gateway": { + "description": "The compute gateway to which the compute nat is attached", + "type": "string" + }, + "updatedAt": { + "description": "Date when the entity was last updated. The date is ISO 8601 and UTC.", + "type": "string", + "example": "2012-09-27" } } }, @@ -11189,6 +13194,34 @@ } } }, + "ComputeNatResult": { + "description": "State object representing a query result of compute-nats.", + "type": "object", + "properties": { + "numberOfElements": { + "format": "int64", + "description": "Number of elements in the current page", + "readOnly": true, + "type": "integer", + "example": 1 + }, + "content": { + "description": "List of content items", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ComputeNat" + } + }, + "totalElements": { + "format": "int64", + "description": "Total number of elements. In some cases the field may not be populated", + "readOnly": true, + "type": "integer", + "example": 1 + } + } + }, "AwsStorageProfile": { "description": "Defines a structure that holds list of storage policies defined for AWS for a specific region.**HATEOAS** links:
**region** - Region - Region for the profile.
**self** - AwsStorageProfile - Self link to this aws Storage Profile", "type": "object", @@ -11370,6 +13403,10 @@ }, "example": "[9e49]" }, + "hostname": { + "description": "Hostname associated with this machine instance.", + "type": "string" + }, "customProperties": { "description": "Additional properties that may be used to extend the base resource.", "additionalProperties": { @@ -11395,6 +13432,10 @@ "type": "string", "example": "123e4567-e89b-12d3-a456-426655440000" }, + "bootConfig": { + "description": "The cloud config data in json-escaped yaml syntax", + "$ref": "#/definitions/MachineBootConfig" + }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", "type": "string", @@ -11437,12 +13478,11 @@ "example": "ami-0d4cfd66" }, "customProperties": { - "description": "Additional custom properties that may be used to extend the block device.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, - "type": "object", - "example": "{ \"key\" : \"type\", \"value\": \"HDD\" }" + "type": "object" }, "encrypted": { "description": "Indicates whether the block device should be encrypted or not.", @@ -11495,6 +13535,22 @@ } } }, + "ReconfigureComputeGatewaySpecification": { + "description": "Specification for a Compute Gateway Reconfigure operation for NAT rules", + "type": "object", + "required": [ + "natRules" + ], + "properties": { + "natRules": { + "description": "List of NAT rules to be applied on this Compute Gateway.", + "type": "array", + "items": { + "$ref": "#/definitions/NatRule" + } + } + } + }, "CloudAccountAwsSpecification": { "description": "Specification for a Amazon cloud account.

A cloud account identifies a cloud account type and an account-specific deployment region or data center where the associated cloud account resources are hosted.", "type": "object", @@ -11742,7 +13798,7 @@ ], "properties": { "customProperties": { - "description": "Additional custom properties that may be used to extend the network.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, @@ -11766,6 +13822,11 @@ "description": "A human-friendly description.", "type": "string" }, + "createGateway": { + "description": "Flag to indicate if the network creation should create a gateway. Default is true.", + "type": "boolean", + "example": true + }, "projectId": { "description": "The id of the project the current user belongs to.", "type": "string", @@ -11936,7 +13997,7 @@ ], "properties": { "customProperties": { - "description": "Additional custom properties that may be used to extend the group.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, @@ -12012,7 +14073,7 @@ "example": "[ \"42f3e0d199d134755684cd935435a\" ]" }, "dcid": { - "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors", + "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors.\nNote: Data collector endpoints are not available in vRA on-prem release and hence the data collector Id is optional for vRA on-prem.", "type": "string", "example": "23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4" }, @@ -12119,6 +14180,12 @@ "type": "boolean", "example": true }, + "clientApplicationId": { + "type": "string" + }, + "clientApplicationSecretKey": { + "type": "string" + }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", "type": "string" @@ -12199,7 +14266,7 @@ "example": "[ \"42f3e0d199d134755684cd935435a\" ]" }, "dcid": { - "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors", + "description": "Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors.\nNote: Data collector endpoints are not available in vRA on-prem release and hence the data collector Id is optional for vRA on-prem.", "type": "string", "example": "23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4" }, @@ -12216,6 +14283,11 @@ "description": "A human-friendly description.", "type": "string" }, + "isGlobalManager": { + "description": "Indicates whether this is an NSX-T Global Manager cloud account. NSX-T Global Manager can only be associated with NSX-T cloud accounts. Default value: false.", + "type": "boolean", + "example": true + }, "username": { "description": "Username to authenticate with the cloud account", "type": "string", @@ -12323,6 +14395,22 @@ } } }, + "ReconfigureComputeNatSpecification": { + "description": "Specification for a Compute Nat Reconfigure operation for NAT rules", + "type": "object", + "required": [ + "natRules" + ], + "properties": { + "natRules": { + "description": "List of NAT rules to be applied on this Compute Nat.", + "type": "array", + "items": { + "$ref": "#/definitions/NatRule" + } + } + } + }, "ZoneAssignmentConfig": { "description": "A zone assignment configuration", "type": "object", @@ -12443,6 +14531,11 @@ "type": "string", "example": "None / ReadOnly / ReadWrite" }, + "diskEncryptionSetId": { + "description": "Indicates the id of disk encryption set. ", + "type": "string", + "example": "/subscriptions/b8ef63/resourceGroups/DiskEncryptionSets/providers/Microsoft.Compute/diskEncryptionSets/MyDES" + }, "tags": { "description": "A set of tag keys and optional values for a storage policy which define set of specifications for creating a disk.", "type": "array", @@ -12669,7 +14762,7 @@ "$ref": "#/definitions/FabricImageDescription" }, "type": "object", - "example": "{ \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"coreos\": { \"id\": \"9e50\", \"name\": \"ami-coreos-26.04-1.9.1-00-543254235\"}}" + "example": "{ \"ubuntu\": { \"id\": \"9e49\", \"name\": \"ami-ubuntu-16.04-1.9.1-00-1516139717\"}, \"centos\": { \"id\": \"9e50\", \"name\": \"ami-centos-7-1.13.0-00-1543963388\"}}" }, "name": { "description": "A human-friendly name used as an identifier in APIs that support this option.", @@ -12939,6 +15032,46 @@ } } }, + "ServiceErrorResponse": { + "type": "object", + "properties": { + "documentKind": { + "type": "string" + }, + "messageId": { + "type": "string" + }, + "errorCode": { + "format": "int32", + "type": "integer" + }, + "details": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "SHOULD_RETRY" + ] + } + }, + "serverErrorId": { + "type": "string" + }, + "stackTrace": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string" + }, + "statusCode": { + "format": "int32", + "type": "integer" + } + } + }, "BlockDevice": { "description": "State object representing a block device.
**HATEOAS** links:
**cloud-accounts** - array[CloudAccount] - Cloud accounts where this disk is provisioned.
**self** - BlockDevice - Self link to this block device", "type": "object", @@ -13391,10 +15524,8 @@ "description": "NAT Rule", "type": "object", "required": [ - "destinationPorts", "index", - "targetLink", - "translatedPorts" + "targetLink" ], "properties": { "protocol": { @@ -13408,22 +15539,28 @@ "example": "any, 10.20.156.101" }, "translatedPorts": { - "description": "The machine port where the request will be forwarded", + "description": "The machine port where the request will be forwarded. Default is `any`", "type": "string", "example": "any, 80, 5000-5100" }, + "destinationAddress": { + "description": "The external IP address of the outbound or routed network", + "readOnly": true, + "type": "string", + "example": "any, 10.20.156.101" + }, "kind": { - "description": "Kind of NAT: NAT44/NAT64/NAT66. Only NAT44 is supported currently", + "description": "Kind of NAT: NAT44/NAT64/NAT66. Only NAT44 is supported currently and it is the default value", "type": "string", - "example": "NAT, NAT64,IPV6" + "example": "NAT44" }, "targetLink": { "description": "A links to target load balancer or a machine's network interface where the request will be forwarded.", "type": "string", - "example": "/resource/load-balancers/{id}, /resources/network-interfaces/{id}" + "example": "/iaas/api/load-balancers/try6-45ef, /iaas/api/machines/ht54-a472/network-interfaces/dyd6-d67e" }, "destinationPorts": { - "description": "The edge gateway port", + "description": "The edge gateway port. Default is `any`", "type": "string", "example": "any, 80, 5000-5100" }, @@ -13441,10 +15578,15 @@ "description": "Description of the NAT rule.", "type": "string" }, + "ruleId": { + "description": "Unique ID of the NAT Rule", + "readOnly": true, + "type": "string" + }, "type": { "description": "Type of the NAT rule. Only DNAT is supported currently.", "type": "string", - "example": "DNAT, SNAT" + "example": "DNAT" } } }, @@ -14118,10 +16260,6 @@ "HealthCheckConfiguration": { "description": "Load balancer health check configuration.", "type": "object", - "required": [ - "port", - "protocol" - ], "properties": { "protocol": { "description": "The protocol used for the health check.", @@ -15091,7 +17229,7 @@ "example": "2012-09-27" }, "isCurrent": { - "description": "A human-friendly description.", + "description": "Specifies if the snapshot is the current snapshot for the block device. Valid only for vSphere First Class Disks", "type": "boolean", "example": false }, @@ -15112,6 +17250,14 @@ "type": "string", "example": "9e49" }, + "snapshotProperties": { + "description": "Snapshot specific properties", + "additionalProperties": { + "type": "string" + }, + "type": "object", + "example": "{ \"incremental\": \"false\" }" + }, "orgId": { "description": "The id of the organization this entity belongs to.", "type": "string", @@ -15435,7 +17581,7 @@ "example": "small, medium, large" }, "customProperties": { - "description": "Additional custom properties that may be used to extend the machine.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, @@ -15713,6 +17859,11 @@ "type": "string", "example": "csp@vmware.com" }, + "lifecycleState": { + "description": "Lifecycle status of the compute instance", + "type": "string", + "example": "PROVISIONING, READY, SUSPEND, STOPPED, RETIRED" + }, "_links": { "description": "HATEOAS of the entity", "additionalProperties": { @@ -15767,6 +17918,11 @@ "type": "string", "example": "2012-09-27" }, + "powerState": { + "description": "Power state of compute instance", + "type": "string", + "example": "ON, OFF, GUEST_OFF, UNKNOWN, SUSPEND" + }, "customProperties": { "description": "Custom properties of the compute instance", "additionalProperties": { @@ -16080,6 +18236,14 @@ "type": "string", "example": "test-folder" }, + "computeIds": { + "description": "The ids of the compute resources that will be explicitly assigned to this zone", + "type": "array", + "items": { + "type": "string" + }, + "example": "[ab12c]" + }, "regionId": { "description": "The id of the region for which this profile is created", "type": "string", @@ -16563,6 +18727,11 @@ "type": "string", "example": "None / ReadOnly / ReadWrite" }, + "diskEncryptionSetId": { + "description": "Indicates the id of disk encryption set. ", + "type": "string", + "example": "/subscriptions/b8ef63/resourceGroups/DiskEncryptionSets/providers/Microsoft.Compute/diskEncryptionSets/MyDES" + }, "updatedAt": { "description": "Date when the entity was last updated. The date is ISO 8601 and UTC.", "type": "string", @@ -16743,6 +18912,11 @@ "type": "string", "example": "9e49" }, + "isGlobalManager": { + "description": "Indicates whether this is an NSX-T Global Manager cloud account. NSX-T global manager cloud account can be associated with NSX-T local manager cloud accounts. It cannot be associated with vSphere cloud accounts. Default value: false.", + "type": "boolean", + "example": true + }, "updatedAt": { "description": "Date when the entity was last updated. The date is ISO 8601 and UTC.", "type": "string", @@ -16876,6 +19050,14 @@ "type": "string", "example": "${project.name}-test-${####}" }, + "customProperties": { + "description": "The project custom properties which are added to all requests in this project", + "additionalProperties": { + "type": "string" + }, + "type": "object", + "example": "{ \"property\" : \"value\" }" + }, "sharedResources": { "description": "Specifies whether the resources in this projects are shared or not. If not set default will be used.", "type": "boolean", @@ -16910,6 +19092,11 @@ "description": "A human-friendly description.", "type": "string" }, + "placementPolicy": { + "description": "Placement policy for the project. Determines how a zone will be selected for provisioning. DEFAULT or SPREAD.", + "type": "string", + "example": "DEFAULT" + }, "constraints": { "description": "List of storage, network and extensibility constraints to be applied when provisioning through this project.", "additionalProperties": { @@ -16991,7 +19178,7 @@ "type": "object", "properties": { "customProperties": { - "description": "Additional custom properties that may be used to extend the machine. Custom properties prefixed with: \"__\" are discarded.", + "description": "Additional custom properties that may be used to extend the machine. Internal custom properties (for example, prefixed with: \"__\") can not be updated.", "additionalProperties": { "type": "string" }, @@ -17236,7 +19423,7 @@ ], "properties": { "customProperties": { - "description": "Additional custom properties that may be used to extend the compute gateway.", + "description": "Additional custom properties that may be used to extend this resource.", "additionalProperties": { "type": "string" }, @@ -17408,6 +19595,9 @@ { "name": "Compute Gateway" }, + { + "name": "Compute Nat" + }, { "name": "Data Collector" },