From 3a6dbab598f6d08edda589c24840650b8761f795 Mon Sep 17 00:00:00 2001 From: HashiCorp Cloud Services Date: Wed, 22 Nov 2023 10:08:55 +0000 Subject: [PATCH] Update cloud-resource-manager SDK --- .../organization_service_create_responses.go | 15 +- ...zation_service_get_iam_policy_responses.go | 15 +- .../organization_service_get_responses.go | 15 +- ...organization_service_get_role_responses.go | 15 +- .../organization_service_list_responses.go | 15 +- ...ganization_service_list_roles_responses.go | 15 +- ...zation_service_set_iam_policy_responses.go | 20 +- ...organization_service_set_name_responses.go | 15 +- ..._service_test_iam_permissions_responses.go | 15 +- .../project_service/project_service_client.go | 2 +- .../project_service_create_responses.go | 15 +- .../project_service_delete_responses.go | 15 +- ...roject_service_get_iam_policy_responses.go | 15 +- ...ct_service_get_projects_count_responses.go | 15 +- .../project_service_get_responses.go | 15 +- .../project_service_list_responses.go | 15 +- ...oject_service_set_description_responses.go | 15 +- ...roject_service_set_iam_policy_responses.go | 20 +- .../project_service_set_name_responses.go | 15 +- ..._service_test_iam_permissions_responses.go | 15 +- .../resource_service_client.go | 120 +++++++++++ ...ource_service_get_iam_policy_parameters.go | 197 ++++++++++++++++++ ...source_service_get_iam_policy_responses.go | 183 ++++++++++++++++ .../resource_service_list_responses.go | 15 +- ...ource_service_set_iam_policy_parameters.go | 150 +++++++++++++ ...source_service_set_iam_policy_responses.go | 183 ++++++++++++++++ ...service_test_iam_permissions_parameters.go | 150 +++++++++++++ ..._service_test_iam_permissions_responses.go | 183 ++++++++++++++++ ...corp_cloud_resourcemanager_organization.go | 10 + ...rcemanager_organization_create_response.go | 5 + ...er_organization_get_iam_policy_response.go | 5 + ...sourcemanager_organization_get_response.go | 5 + ...emanager_organization_get_role_response.go | 5 + ...ourcemanager_organization_list_response.go | 10 + ...anager_organization_list_roles_response.go | 10 + ...loud_resourcemanager_organization_owner.go | 2 +- ...er_organization_set_iam_policy_response.go | 5 + ...emanager_organization_set_name_response.go | 5 + .../hashicorp_cloud_resourcemanager_policy.go | 5 + ...rp_cloud_resourcemanager_policy_binding.go | 5 + ...d_resourcemanager_policy_binding_member.go | 5 + ...hashicorp_cloud_resourcemanager_project.go | 10 + ..._resourcemanager_project_create_request.go | 5 + ...resourcemanager_project_create_response.go | 5 + ...resourcemanager_project_delete_response.go | 5 + ...manager_project_get_iam_policy_response.go | 5 + ...ud_resourcemanager_project_get_response.go | 5 + ...d_resourcemanager_project_list_response.go | 10 + ...manager_project_set_iam_policy_response.go | 5 + ...ashicorp_cloud_resourcemanager_resource.go | 5 + ...anager_resource_get_iam_policy_response.go | 109 ++++++++++ ...icorp_cloud_resourcemanager_resource_id.go | 5 + ..._resourcemanager_resource_list_response.go | 10 + ...manager_resource_set_iam_policy_request.go | 117 +++++++++++ ...anager_resource_set_iam_policy_response.go | 109 ++++++++++ ...r_resource_test_iam_permissions_request.go | 112 ++++++++++ ..._resource_test_iam_permissions_response.go | 50 +++++ 57 files changed, 2020 insertions(+), 102 deletions(-) create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_parameters.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_responses.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_parameters.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_responses.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_parameters.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_responses.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_get_iam_policy_response.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_request.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_response.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_request.go create mode 100644 clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_response.go diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_create_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_create_responses.go index e5d8e40b..b37886b5 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_create_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_create_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceCreateOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service create o k response +func (o *OrganizationServiceCreateOK) Code() int { + return 200 +} + func (o *OrganizationServiceCreateOK) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/organizations][%d] organizationServiceCreateOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceCreateDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service create default response -func (o *OrganizationServiceCreateDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service create default response has a 2xx status code func (o *OrganizationServiceCreateDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceCreateDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service create default response +func (o *OrganizationServiceCreateDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceCreateDefault) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/organizations][%d] OrganizationService_Create default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_iam_policy_responses.go index fafa5cb1..edb2ee63 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_iam_policy_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_iam_policy_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceGetIamPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service get iam policy o k response +func (o *OrganizationServiceGetIamPolicyOK) Code() int { + return 200 +} + func (o *OrganizationServiceGetIamPolicyOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/iam-policy][%d] organizationServiceGetIamPolicyOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceGetIamPolicyDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service get iam policy default response -func (o *OrganizationServiceGetIamPolicyDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service get iam policy default response has a 2xx status code func (o *OrganizationServiceGetIamPolicyDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceGetIamPolicyDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service get iam policy default response +func (o *OrganizationServiceGetIamPolicyDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceGetIamPolicyDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/iam-policy][%d] OrganizationService_GetIamPolicy default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_responses.go index 9e198322..f256c2d2 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceGetOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service get o k response +func (o *OrganizationServiceGetOK) Code() int { + return 200 +} + func (o *OrganizationServiceGetOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}][%d] organizationServiceGetOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceGetDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service get default response -func (o *OrganizationServiceGetDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service get default response has a 2xx status code func (o *OrganizationServiceGetDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceGetDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service get default response +func (o *OrganizationServiceGetDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceGetDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}][%d] OrganizationService_Get default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_role_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_role_responses.go index abb2288e..3f1e2c21 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_role_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_get_role_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceGetRoleOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service get role o k response +func (o *OrganizationServiceGetRoleOK) Code() int { + return 200 +} + func (o *OrganizationServiceGetRoleOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/{role_id}][%d] organizationServiceGetRoleOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceGetRoleDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service get role default response -func (o *OrganizationServiceGetRoleDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service get role default response has a 2xx status code func (o *OrganizationServiceGetRoleDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceGetRoleDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service get role default response +func (o *OrganizationServiceGetRoleDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceGetRoleDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/{role_id}][%d] OrganizationService_GetRole default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_responses.go index 6a890b3d..30f47edd 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceListOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service list o k response +func (o *OrganizationServiceListOK) Code() int { + return 200 +} + func (o *OrganizationServiceListOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations][%d] organizationServiceListOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceListDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service list default response -func (o *OrganizationServiceListDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service list default response has a 2xx status code func (o *OrganizationServiceListDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceListDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service list default response +func (o *OrganizationServiceListDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceListDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations][%d] OrganizationService_List default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_roles_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_roles_responses.go index a7a0b5b5..7da4226c 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_roles_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_list_roles_responses.go @@ -81,6 +81,11 @@ func (o *OrganizationServiceListRolesOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service list roles o k response +func (o *OrganizationServiceListRolesOK) Code() int { + return 200 +} + func (o *OrganizationServiceListRolesOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/roles][%d] organizationServiceListRolesOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type OrganizationServiceListRolesDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service list roles default response -func (o *OrganizationServiceListRolesDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service list roles default response has a 2xx status code func (o *OrganizationServiceListRolesDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *OrganizationServiceListRolesDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service list roles default response +func (o *OrganizationServiceListRolesDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceListRolesDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/organizations/{id}/roles][%d] OrganizationService_ListRoles default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_iam_policy_responses.go index 30284203..60274c70 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_iam_policy_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_iam_policy_responses.go @@ -84,6 +84,11 @@ func (o *OrganizationServiceSetIamPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service set iam policy o k response +func (o *OrganizationServiceSetIamPolicyOK) Code() int { + return 200 +} + func (o *OrganizationServiceSetIamPolicyOK) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/organizations/{id}/iam-policy][%d] organizationServiceSetIamPolicyOK %+v", 200, o.Payload) } @@ -126,11 +131,6 @@ type OrganizationServiceSetIamPolicyDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service set iam policy default response -func (o *OrganizationServiceSetIamPolicyDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service set iam policy default response has a 2xx status code func (o *OrganizationServiceSetIamPolicyDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -156,6 +156,11 @@ func (o *OrganizationServiceSetIamPolicyDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service set iam policy default response +func (o *OrganizationServiceSetIamPolicyDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceSetIamPolicyDefault) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/organizations/{id}/iam-policy][%d] OrganizationService_SetIamPolicy default %+v", o._statusCode, o.Payload) } @@ -242,6 +247,11 @@ func (o *OrganizationServiceSetIamPolicyBody) ContextValidate(ctx context.Contex func (o *OrganizationServiceSetIamPolicyBody) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if o.Policy != nil { + + if swag.IsZero(o.Policy) { // not required + return nil + } + if err := o.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_name_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_name_responses.go index 22492c86..c7495e07 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_name_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_set_name_responses.go @@ -83,6 +83,11 @@ func (o *OrganizationServiceSetNameOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service set name o k response +func (o *OrganizationServiceSetNameOK) Code() int { + return 200 +} + func (o *OrganizationServiceSetNameOK) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/organizations/{id}/name][%d] organizationServiceSetNameOK %+v", 200, o.Payload) } @@ -125,11 +130,6 @@ type OrganizationServiceSetNameDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service set name default response -func (o *OrganizationServiceSetNameDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service set name default response has a 2xx status code func (o *OrganizationServiceSetNameDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -155,6 +155,11 @@ func (o *OrganizationServiceSetNameDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service set name default response +func (o *OrganizationServiceSetNameDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceSetNameDefault) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/organizations/{id}/name][%d] OrganizationService_SetName default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_test_iam_permissions_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_test_iam_permissions_responses.go index 791659c1..936b28a4 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_test_iam_permissions_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service/organization_service_test_iam_permissions_responses.go @@ -83,6 +83,11 @@ func (o *OrganizationServiceTestIamPermissionsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the organization service test iam permissions o k response +func (o *OrganizationServiceTestIamPermissionsOK) Code() int { + return 200 +} + func (o *OrganizationServiceTestIamPermissionsOK) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/organizations/{id}/test-iam-permissions][%d] organizationServiceTestIamPermissionsOK %+v", 200, o.Payload) } @@ -125,11 +130,6 @@ type OrganizationServiceTestIamPermissionsDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the organization service test iam permissions default response -func (o *OrganizationServiceTestIamPermissionsDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this organization service test iam permissions default response has a 2xx status code func (o *OrganizationServiceTestIamPermissionsDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -155,6 +155,11 @@ func (o *OrganizationServiceTestIamPermissionsDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the organization service test iam permissions default response +func (o *OrganizationServiceTestIamPermissionsDefault) Code() int { + return o._statusCode +} + func (o *OrganizationServiceTestIamPermissionsDefault) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/organizations/{id}/test-iam-permissions][%d] OrganizationService_TestIamPermissions default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_client.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_client.go index 3777c9fa..bf8a2f02 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_client.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_client.go @@ -128,7 +128,7 @@ func (a *Client) ProjectServiceDelete(params *ProjectServiceDeleteParams, authIn } /* -ProjectServiceGet gets retrieves the requested project by ID +ProjectServiceGet gets retrieves the requested project by ID a not found status will be returned for projects in the d e l e t e d state */ func (a *Client) ProjectServiceGet(params *ProjectServiceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ProjectServiceGetOK, error) { // TODO: Validate the params before sending diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_create_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_create_responses.go index 74195bdb..2b468205 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_create_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_create_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceCreateOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service create o k response +func (o *ProjectServiceCreateOK) Code() int { + return 200 +} + func (o *ProjectServiceCreateOK) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/projects][%d] projectServiceCreateOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceCreateDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service create default response -func (o *ProjectServiceCreateDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service create default response has a 2xx status code func (o *ProjectServiceCreateDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceCreateDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service create default response +func (o *ProjectServiceCreateDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceCreateDefault) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/projects][%d] ProjectService_Create default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_delete_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_delete_responses.go index e01af629..29b11e22 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_delete_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_delete_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceDeleteOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service delete o k response +func (o *ProjectServiceDeleteOK) Code() int { + return 200 +} + func (o *ProjectServiceDeleteOK) Error() string { return fmt.Sprintf("[DELETE /resource-manager/2019-12-10/projects/{id}][%d] projectServiceDeleteOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceDeleteDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service delete default response -func (o *ProjectServiceDeleteDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service delete default response has a 2xx status code func (o *ProjectServiceDeleteDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceDeleteDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service delete default response +func (o *ProjectServiceDeleteDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceDeleteDefault) Error() string { return fmt.Sprintf("[DELETE /resource-manager/2019-12-10/projects/{id}][%d] ProjectService_Delete default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_iam_policy_responses.go index 8d029278..2c0c1935 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_iam_policy_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_iam_policy_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceGetIamPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service get iam policy o k response +func (o *ProjectServiceGetIamPolicyOK) Code() int { + return 200 +} + func (o *ProjectServiceGetIamPolicyOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/{id}/iam-policy][%d] projectServiceGetIamPolicyOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceGetIamPolicyDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service get iam policy default response -func (o *ProjectServiceGetIamPolicyDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service get iam policy default response has a 2xx status code func (o *ProjectServiceGetIamPolicyDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceGetIamPolicyDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service get iam policy default response +func (o *ProjectServiceGetIamPolicyDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceGetIamPolicyDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/{id}/iam-policy][%d] ProjectService_GetIamPolicy default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_projects_count_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_projects_count_responses.go index 1a4bfc1e..038eb489 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_projects_count_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_projects_count_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceGetProjectsCountOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service get projects count o k response +func (o *ProjectServiceGetProjectsCountOK) Code() int { + return 200 +} + func (o *ProjectServiceGetProjectsCountOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/count][%d] projectServiceGetProjectsCountOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceGetProjectsCountDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service get projects count default response -func (o *ProjectServiceGetProjectsCountDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service get projects count default response has a 2xx status code func (o *ProjectServiceGetProjectsCountDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceGetProjectsCountDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service get projects count default response +func (o *ProjectServiceGetProjectsCountDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceGetProjectsCountDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/count][%d] ProjectService_GetProjectsCount default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_responses.go index 1094088e..d898c679 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_get_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceGetOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service get o k response +func (o *ProjectServiceGetOK) Code() int { + return 200 +} + func (o *ProjectServiceGetOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/{id}][%d] projectServiceGetOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceGetDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service get default response -func (o *ProjectServiceGetDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service get default response has a 2xx status code func (o *ProjectServiceGetDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceGetDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service get default response +func (o *ProjectServiceGetDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceGetDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects/{id}][%d] ProjectService_Get default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_list_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_list_responses.go index 957e71e4..ed227ecd 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_list_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_list_responses.go @@ -81,6 +81,11 @@ func (o *ProjectServiceListOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service list o k response +func (o *ProjectServiceListOK) Code() int { + return 200 +} + func (o *ProjectServiceListOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects][%d] projectServiceListOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ProjectServiceListDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service list default response -func (o *ProjectServiceListDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service list default response has a 2xx status code func (o *ProjectServiceListDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ProjectServiceListDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service list default response +func (o *ProjectServiceListDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceListDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/projects][%d] ProjectService_List default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_description_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_description_responses.go index 22f78366..c9148e3d 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_description_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_description_responses.go @@ -82,6 +82,11 @@ func (o *ProjectServiceSetDescriptionOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service set description o k response +func (o *ProjectServiceSetDescriptionOK) Code() int { + return 200 +} + func (o *ProjectServiceSetDescriptionOK) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/description][%d] projectServiceSetDescriptionOK %+v", 200, o.Payload) } @@ -122,11 +127,6 @@ type ProjectServiceSetDescriptionDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service set description default response -func (o *ProjectServiceSetDescriptionDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service set description default response has a 2xx status code func (o *ProjectServiceSetDescriptionDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -152,6 +152,11 @@ func (o *ProjectServiceSetDescriptionDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service set description default response +func (o *ProjectServiceSetDescriptionDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceSetDescriptionDefault) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/description][%d] ProjectService_SetDescription default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_iam_policy_responses.go index 8df0e871..6b199f66 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_iam_policy_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_iam_policy_responses.go @@ -84,6 +84,11 @@ func (o *ProjectServiceSetIamPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service set iam policy o k response +func (o *ProjectServiceSetIamPolicyOK) Code() int { + return 200 +} + func (o *ProjectServiceSetIamPolicyOK) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/iam-policy][%d] projectServiceSetIamPolicyOK %+v", 200, o.Payload) } @@ -126,11 +131,6 @@ type ProjectServiceSetIamPolicyDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service set iam policy default response -func (o *ProjectServiceSetIamPolicyDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service set iam policy default response has a 2xx status code func (o *ProjectServiceSetIamPolicyDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -156,6 +156,11 @@ func (o *ProjectServiceSetIamPolicyDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service set iam policy default response +func (o *ProjectServiceSetIamPolicyDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceSetIamPolicyDefault) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/iam-policy][%d] ProjectService_SetIamPolicy default %+v", o._statusCode, o.Payload) } @@ -242,6 +247,11 @@ func (o *ProjectServiceSetIamPolicyBody) ContextValidate(ctx context.Context, fo func (o *ProjectServiceSetIamPolicyBody) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if o.Policy != nil { + + if swag.IsZero(o.Policy) { // not required + return nil + } + if err := o.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_name_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_name_responses.go index 01cca63c..bfcc7ffa 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_name_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_set_name_responses.go @@ -82,6 +82,11 @@ func (o *ProjectServiceSetNameOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service set name o k response +func (o *ProjectServiceSetNameOK) Code() int { + return 200 +} + func (o *ProjectServiceSetNameOK) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/name][%d] projectServiceSetNameOK %+v", 200, o.Payload) } @@ -122,11 +127,6 @@ type ProjectServiceSetNameDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service set name default response -func (o *ProjectServiceSetNameDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service set name default response has a 2xx status code func (o *ProjectServiceSetNameDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -152,6 +152,11 @@ func (o *ProjectServiceSetNameDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service set name default response +func (o *ProjectServiceSetNameDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceSetNameDefault) Error() string { return fmt.Sprintf("[PUT /resource-manager/2019-12-10/projects/{id}/name][%d] ProjectService_SetName default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_test_iam_permissions_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_test_iam_permissions_responses.go index 817d5d56..946e3417 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_test_iam_permissions_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/project_service/project_service_test_iam_permissions_responses.go @@ -83,6 +83,11 @@ func (o *ProjectServiceTestIamPermissionsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the project service test iam permissions o k response +func (o *ProjectServiceTestIamPermissionsOK) Code() int { + return 200 +} + func (o *ProjectServiceTestIamPermissionsOK) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/projects/{id}/test-iam-permissions][%d] projectServiceTestIamPermissionsOK %+v", 200, o.Payload) } @@ -125,11 +130,6 @@ type ProjectServiceTestIamPermissionsDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the project service test iam permissions default response -func (o *ProjectServiceTestIamPermissionsDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this project service test iam permissions default response has a 2xx status code func (o *ProjectServiceTestIamPermissionsDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -155,6 +155,11 @@ func (o *ProjectServiceTestIamPermissionsDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the project service test iam permissions default response +func (o *ProjectServiceTestIamPermissionsDefault) Code() int { + return o._statusCode +} + func (o *ProjectServiceTestIamPermissionsDefault) Error() string { return fmt.Sprintf("[POST /resource-manager/2019-12-10/projects/{id}/test-iam-permissions][%d] ProjectService_TestIamPermissions default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_client.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_client.go index c357e1d0..1a71daec 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_client.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_client.go @@ -28,11 +28,55 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + ResourceServiceGetIamPolicy(params *ResourceServiceGetIamPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceGetIamPolicyOK, error) + ResourceServiceList(params *ResourceServiceListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceListOK, error) + ResourceServiceSetIamPolicy(params *ResourceServiceSetIamPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceSetIamPolicyOK, error) + + ResourceServiceTestIamPermissions(params *ResourceServiceTestIamPermissionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceTestIamPermissionsOK, error) + SetTransport(transport runtime.ClientTransport) } +/* +ResourceServiceGetIamPolicy gets iam policy gets the i a m policy for a resource +*/ +func (a *Client) ResourceServiceGetIamPolicy(params *ResourceServiceGetIamPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceGetIamPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResourceServiceGetIamPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "ResourceService_GetIamPolicy", + Method: "GET", + PathPattern: "/2019-12-10/resource-manager/resources/iam-policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ResourceServiceGetIamPolicyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResourceServiceGetIamPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ResourceServiceGetIamPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ResourceServiceList lists lists the resources the caller has access to */ @@ -71,6 +115,82 @@ func (a *Client) ResourceServiceList(params *ResourceServiceListParams, authInfo return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ResourceServiceSetIamPolicy sets iam policy sets the i a m policy for a resource since this updates the full policy the policy takes an etag argument that should match with the current policy stored in the system this is to avoid concurrent writes erasing each other s data hence the client should always get the current policy that includes the etag modify the policy and then set the policy with the same etag if there is no existing policy the etag must be empty +*/ +func (a *Client) ResourceServiceSetIamPolicy(params *ResourceServiceSetIamPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceSetIamPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResourceServiceSetIamPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "ResourceService_SetIamPolicy", + Method: "PUT", + PathPattern: "/2019-12-10/resource-manager/resources/iam-policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ResourceServiceSetIamPolicyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResourceServiceSetIamPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ResourceServiceSetIamPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ResourceServiceTestIamPermissions tests iam permissions returns a subset of the request permissions the calling principal has on the resource +*/ +func (a *Client) ResourceServiceTestIamPermissions(params *ResourceServiceTestIamPermissionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResourceServiceTestIamPermissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResourceServiceTestIamPermissionsParams() + } + op := &runtime.ClientOperation{ + ID: "ResourceService_TestIamPermissions", + Method: "POST", + PathPattern: "/resource-manager/2019-12-10/resources/test-iam-permissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ResourceServiceTestIamPermissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResourceServiceTestIamPermissionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ResourceServiceTestIamPermissionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_parameters.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_parameters.go new file mode 100644 index 00000000..ef4959c3 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// 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" +) + +// NewResourceServiceGetIamPolicyParams creates a new ResourceServiceGetIamPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResourceServiceGetIamPolicyParams() *ResourceServiceGetIamPolicyParams { + return &ResourceServiceGetIamPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResourceServiceGetIamPolicyParamsWithTimeout creates a new ResourceServiceGetIamPolicyParams object +// with the ability to set a timeout on a request. +func NewResourceServiceGetIamPolicyParamsWithTimeout(timeout time.Duration) *ResourceServiceGetIamPolicyParams { + return &ResourceServiceGetIamPolicyParams{ + timeout: timeout, + } +} + +// NewResourceServiceGetIamPolicyParamsWithContext creates a new ResourceServiceGetIamPolicyParams object +// with the ability to set a context for a request. +func NewResourceServiceGetIamPolicyParamsWithContext(ctx context.Context) *ResourceServiceGetIamPolicyParams { + return &ResourceServiceGetIamPolicyParams{ + Context: ctx, + } +} + +// NewResourceServiceGetIamPolicyParamsWithHTTPClient creates a new ResourceServiceGetIamPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewResourceServiceGetIamPolicyParamsWithHTTPClient(client *http.Client) *ResourceServiceGetIamPolicyParams { + return &ResourceServiceGetIamPolicyParams{ + HTTPClient: client, + } +} + +/* +ResourceServiceGetIamPolicyParams contains all the parameters to send to the API endpoint + + for the resource service get iam policy operation. + + Typically these are written to a http.Request. +*/ +type ResourceServiceGetIamPolicyParams struct { + + /* ResourceID. + + ResourceId is the resource name of the resource. Either this or the ResourceName needs to be provided. + */ + ResourceID *string + + /* ResourceName. + + ResourceName is the resource name of the resource. Either this or the ResourceId needs to be provided. + */ + ResourceName *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resource service get iam policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceGetIamPolicyParams) WithDefaults() *ResourceServiceGetIamPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resource service get iam policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceGetIamPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) WithTimeout(timeout time.Duration) *ResourceServiceGetIamPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) WithContext(ctx context.Context) *ResourceServiceGetIamPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) WithHTTPClient(client *http.Client) *ResourceServiceGetIamPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResourceID adds the resourceID to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) WithResourceID(resourceID *string) *ResourceServiceGetIamPolicyParams { + o.SetResourceID(resourceID) + return o +} + +// SetResourceID adds the resourceId to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) SetResourceID(resourceID *string) { + o.ResourceID = resourceID +} + +// WithResourceName adds the resourceName to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) WithResourceName(resourceName *string) *ResourceServiceGetIamPolicyParams { + o.SetResourceName(resourceName) + return o +} + +// SetResourceName adds the resourceName to the resource service get iam policy params +func (o *ResourceServiceGetIamPolicyParams) SetResourceName(resourceName *string) { + o.ResourceName = resourceName +} + +// WriteToRequest writes these params to a swagger request +func (o *ResourceServiceGetIamPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ResourceID != nil { + + // query param resource_id + var qrResourceID string + + if o.ResourceID != nil { + qrResourceID = *o.ResourceID + } + qResourceID := qrResourceID + if qResourceID != "" { + + if err := r.SetQueryParam("resource_id", qResourceID); err != nil { + return err + } + } + } + + if o.ResourceName != nil { + + // query param resource_name + var qrResourceName string + + if o.ResourceName != nil { + qrResourceName = *o.ResourceName + } + qResourceName := qrResourceName + if qResourceName != "" { + + if err := r.SetQueryParam("resource_name", qResourceName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_responses.go new file mode 100644 index 00000000..0132deab --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_get_iam_policy_responses.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// This file was generated by the 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/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// ResourceServiceGetIamPolicyReader is a Reader for the ResourceServiceGetIamPolicy structure. +type ResourceServiceGetIamPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResourceServiceGetIamPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResourceServiceGetIamPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewResourceServiceGetIamPolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewResourceServiceGetIamPolicyOK creates a ResourceServiceGetIamPolicyOK with default headers values +func NewResourceServiceGetIamPolicyOK() *ResourceServiceGetIamPolicyOK { + return &ResourceServiceGetIamPolicyOK{} +} + +/* +ResourceServiceGetIamPolicyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ResourceServiceGetIamPolicyOK struct { + Payload *models.HashicorpCloudResourcemanagerResourceGetIamPolicyResponse +} + +// IsSuccess returns true when this resource service get iam policy o k response has a 2xx status code +func (o *ResourceServiceGetIamPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resource service get iam policy o k response has a 3xx status code +func (o *ResourceServiceGetIamPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resource service get iam policy o k response has a 4xx status code +func (o *ResourceServiceGetIamPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resource service get iam policy o k response has a 5xx status code +func (o *ResourceServiceGetIamPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resource service get iam policy o k response a status code equal to that given +func (o *ResourceServiceGetIamPolicyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the resource service get iam policy o k response +func (o *ResourceServiceGetIamPolicyOK) Code() int { + return 200 +} + +func (o *ResourceServiceGetIamPolicyOK) Error() string { + return fmt.Sprintf("[GET /2019-12-10/resource-manager/resources/iam-policy][%d] resourceServiceGetIamPolicyOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceGetIamPolicyOK) String() string { + return fmt.Sprintf("[GET /2019-12-10/resource-manager/resources/iam-policy][%d] resourceServiceGetIamPolicyOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceGetIamPolicyOK) GetPayload() *models.HashicorpCloudResourcemanagerResourceGetIamPolicyResponse { + return o.Payload +} + +func (o *ResourceServiceGetIamPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewResourceServiceGetIamPolicyDefault creates a ResourceServiceGetIamPolicyDefault with default headers values +func NewResourceServiceGetIamPolicyDefault(code int) *ResourceServiceGetIamPolicyDefault { + return &ResourceServiceGetIamPolicyDefault{ + _statusCode: code, + } +} + +/* +ResourceServiceGetIamPolicyDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ResourceServiceGetIamPolicyDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// IsSuccess returns true when this resource service get iam policy default response has a 2xx status code +func (o *ResourceServiceGetIamPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this resource service get iam policy default response has a 3xx status code +func (o *ResourceServiceGetIamPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this resource service get iam policy default response has a 4xx status code +func (o *ResourceServiceGetIamPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this resource service get iam policy default response has a 5xx status code +func (o *ResourceServiceGetIamPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this resource service get iam policy default response a status code equal to that given +func (o *ResourceServiceGetIamPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the resource service get iam policy default response +func (o *ResourceServiceGetIamPolicyDefault) Code() int { + return o._statusCode +} + +func (o *ResourceServiceGetIamPolicyDefault) Error() string { + return fmt.Sprintf("[GET /2019-12-10/resource-manager/resources/iam-policy][%d] ResourceService_GetIamPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceGetIamPolicyDefault) String() string { + return fmt.Sprintf("[GET /2019-12-10/resource-manager/resources/iam-policy][%d] ResourceService_GetIamPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceGetIamPolicyDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *ResourceServiceGetIamPolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_list_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_list_responses.go index 9834a7c7..871b49e9 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_list_responses.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_list_responses.go @@ -81,6 +81,11 @@ func (o *ResourceServiceListOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the resource service list o k response +func (o *ResourceServiceListOK) Code() int { + return 200 +} + func (o *ResourceServiceListOK) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/resources][%d] resourceServiceListOK %+v", 200, o.Payload) } @@ -123,11 +128,6 @@ type ResourceServiceListDefault struct { Payload *cloud.GoogleRPCStatus } -// Code gets the status code for the resource service list default response -func (o *ResourceServiceListDefault) Code() int { - return o._statusCode -} - // IsSuccess returns true when this resource service list default response has a 2xx status code func (o *ResourceServiceListDefault) IsSuccess() bool { return o._statusCode/100 == 2 @@ -153,6 +153,11 @@ func (o *ResourceServiceListDefault) IsCode(code int) bool { return o._statusCode == code } +// Code gets the status code for the resource service list default response +func (o *ResourceServiceListDefault) Code() int { + return o._statusCode +} + func (o *ResourceServiceListDefault) Error() string { return fmt.Sprintf("[GET /resource-manager/2019-12-10/resources][%d] ResourceService_List default %+v", o._statusCode, o.Payload) } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_parameters.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_parameters.go new file mode 100644 index 00000000..67c4881f --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// 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/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" +) + +// NewResourceServiceSetIamPolicyParams creates a new ResourceServiceSetIamPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResourceServiceSetIamPolicyParams() *ResourceServiceSetIamPolicyParams { + return &ResourceServiceSetIamPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResourceServiceSetIamPolicyParamsWithTimeout creates a new ResourceServiceSetIamPolicyParams object +// with the ability to set a timeout on a request. +func NewResourceServiceSetIamPolicyParamsWithTimeout(timeout time.Duration) *ResourceServiceSetIamPolicyParams { + return &ResourceServiceSetIamPolicyParams{ + timeout: timeout, + } +} + +// NewResourceServiceSetIamPolicyParamsWithContext creates a new ResourceServiceSetIamPolicyParams object +// with the ability to set a context for a request. +func NewResourceServiceSetIamPolicyParamsWithContext(ctx context.Context) *ResourceServiceSetIamPolicyParams { + return &ResourceServiceSetIamPolicyParams{ + Context: ctx, + } +} + +// NewResourceServiceSetIamPolicyParamsWithHTTPClient creates a new ResourceServiceSetIamPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewResourceServiceSetIamPolicyParamsWithHTTPClient(client *http.Client) *ResourceServiceSetIamPolicyParams { + return &ResourceServiceSetIamPolicyParams{ + HTTPClient: client, + } +} + +/* +ResourceServiceSetIamPolicyParams contains all the parameters to send to the API endpoint + + for the resource service set iam policy operation. + + Typically these are written to a http.Request. +*/ +type ResourceServiceSetIamPolicyParams struct { + + // Body. + Body *models.HashicorpCloudResourcemanagerResourceSetIamPolicyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resource service set iam policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceSetIamPolicyParams) WithDefaults() *ResourceServiceSetIamPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resource service set iam policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceSetIamPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) WithTimeout(timeout time.Duration) *ResourceServiceSetIamPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) WithContext(ctx context.Context) *ResourceServiceSetIamPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) WithHTTPClient(client *http.Client) *ResourceServiceSetIamPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) WithBody(body *models.HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) *ResourceServiceSetIamPolicyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the resource service set iam policy params +func (o *ResourceServiceSetIamPolicyParams) SetBody(body *models.HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ResourceServiceSetIamPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + 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/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_responses.go new file mode 100644 index 00000000..ccf61b05 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_set_iam_policy_responses.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// This file was generated by the 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/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// ResourceServiceSetIamPolicyReader is a Reader for the ResourceServiceSetIamPolicy structure. +type ResourceServiceSetIamPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResourceServiceSetIamPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResourceServiceSetIamPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewResourceServiceSetIamPolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewResourceServiceSetIamPolicyOK creates a ResourceServiceSetIamPolicyOK with default headers values +func NewResourceServiceSetIamPolicyOK() *ResourceServiceSetIamPolicyOK { + return &ResourceServiceSetIamPolicyOK{} +} + +/* +ResourceServiceSetIamPolicyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ResourceServiceSetIamPolicyOK struct { + Payload *models.HashicorpCloudResourcemanagerResourceSetIamPolicyResponse +} + +// IsSuccess returns true when this resource service set iam policy o k response has a 2xx status code +func (o *ResourceServiceSetIamPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resource service set iam policy o k response has a 3xx status code +func (o *ResourceServiceSetIamPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resource service set iam policy o k response has a 4xx status code +func (o *ResourceServiceSetIamPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resource service set iam policy o k response has a 5xx status code +func (o *ResourceServiceSetIamPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resource service set iam policy o k response a status code equal to that given +func (o *ResourceServiceSetIamPolicyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the resource service set iam policy o k response +func (o *ResourceServiceSetIamPolicyOK) Code() int { + return 200 +} + +func (o *ResourceServiceSetIamPolicyOK) Error() string { + return fmt.Sprintf("[PUT /2019-12-10/resource-manager/resources/iam-policy][%d] resourceServiceSetIamPolicyOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceSetIamPolicyOK) String() string { + return fmt.Sprintf("[PUT /2019-12-10/resource-manager/resources/iam-policy][%d] resourceServiceSetIamPolicyOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceSetIamPolicyOK) GetPayload() *models.HashicorpCloudResourcemanagerResourceSetIamPolicyResponse { + return o.Payload +} + +func (o *ResourceServiceSetIamPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewResourceServiceSetIamPolicyDefault creates a ResourceServiceSetIamPolicyDefault with default headers values +func NewResourceServiceSetIamPolicyDefault(code int) *ResourceServiceSetIamPolicyDefault { + return &ResourceServiceSetIamPolicyDefault{ + _statusCode: code, + } +} + +/* +ResourceServiceSetIamPolicyDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ResourceServiceSetIamPolicyDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// IsSuccess returns true when this resource service set iam policy default response has a 2xx status code +func (o *ResourceServiceSetIamPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this resource service set iam policy default response has a 3xx status code +func (o *ResourceServiceSetIamPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this resource service set iam policy default response has a 4xx status code +func (o *ResourceServiceSetIamPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this resource service set iam policy default response has a 5xx status code +func (o *ResourceServiceSetIamPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this resource service set iam policy default response a status code equal to that given +func (o *ResourceServiceSetIamPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the resource service set iam policy default response +func (o *ResourceServiceSetIamPolicyDefault) Code() int { + return o._statusCode +} + +func (o *ResourceServiceSetIamPolicyDefault) Error() string { + return fmt.Sprintf("[PUT /2019-12-10/resource-manager/resources/iam-policy][%d] ResourceService_SetIamPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceSetIamPolicyDefault) String() string { + return fmt.Sprintf("[PUT /2019-12-10/resource-manager/resources/iam-policy][%d] ResourceService_SetIamPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceSetIamPolicyDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *ResourceServiceSetIamPolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_parameters.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_parameters.go new file mode 100644 index 00000000..c4c140c3 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// 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/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" +) + +// NewResourceServiceTestIamPermissionsParams creates a new ResourceServiceTestIamPermissionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResourceServiceTestIamPermissionsParams() *ResourceServiceTestIamPermissionsParams { + return &ResourceServiceTestIamPermissionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResourceServiceTestIamPermissionsParamsWithTimeout creates a new ResourceServiceTestIamPermissionsParams object +// with the ability to set a timeout on a request. +func NewResourceServiceTestIamPermissionsParamsWithTimeout(timeout time.Duration) *ResourceServiceTestIamPermissionsParams { + return &ResourceServiceTestIamPermissionsParams{ + timeout: timeout, + } +} + +// NewResourceServiceTestIamPermissionsParamsWithContext creates a new ResourceServiceTestIamPermissionsParams object +// with the ability to set a context for a request. +func NewResourceServiceTestIamPermissionsParamsWithContext(ctx context.Context) *ResourceServiceTestIamPermissionsParams { + return &ResourceServiceTestIamPermissionsParams{ + Context: ctx, + } +} + +// NewResourceServiceTestIamPermissionsParamsWithHTTPClient creates a new ResourceServiceTestIamPermissionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewResourceServiceTestIamPermissionsParamsWithHTTPClient(client *http.Client) *ResourceServiceTestIamPermissionsParams { + return &ResourceServiceTestIamPermissionsParams{ + HTTPClient: client, + } +} + +/* +ResourceServiceTestIamPermissionsParams contains all the parameters to send to the API endpoint + + for the resource service test iam permissions operation. + + Typically these are written to a http.Request. +*/ +type ResourceServiceTestIamPermissionsParams struct { + + // Body. + Body *models.HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resource service test iam permissions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceTestIamPermissionsParams) WithDefaults() *ResourceServiceTestIamPermissionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resource service test iam permissions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResourceServiceTestIamPermissionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) WithTimeout(timeout time.Duration) *ResourceServiceTestIamPermissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) WithContext(ctx context.Context) *ResourceServiceTestIamPermissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) WithHTTPClient(client *http.Client) *ResourceServiceTestIamPermissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) WithBody(body *models.HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) *ResourceServiceTestIamPermissionsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the resource service test iam permissions params +func (o *ResourceServiceTestIamPermissionsParams) SetBody(body *models.HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ResourceServiceTestIamPermissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + 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/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_responses.go b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_responses.go new file mode 100644 index 00000000..d385bc5f --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/client/resource_service/resource_service_test_iam_permissions_responses.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resource_service + +// This file was generated by the 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/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// ResourceServiceTestIamPermissionsReader is a Reader for the ResourceServiceTestIamPermissions structure. +type ResourceServiceTestIamPermissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResourceServiceTestIamPermissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResourceServiceTestIamPermissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewResourceServiceTestIamPermissionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewResourceServiceTestIamPermissionsOK creates a ResourceServiceTestIamPermissionsOK with default headers values +func NewResourceServiceTestIamPermissionsOK() *ResourceServiceTestIamPermissionsOK { + return &ResourceServiceTestIamPermissionsOK{} +} + +/* +ResourceServiceTestIamPermissionsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ResourceServiceTestIamPermissionsOK struct { + Payload *models.HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse +} + +// IsSuccess returns true when this resource service test iam permissions o k response has a 2xx status code +func (o *ResourceServiceTestIamPermissionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resource service test iam permissions o k response has a 3xx status code +func (o *ResourceServiceTestIamPermissionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resource service test iam permissions o k response has a 4xx status code +func (o *ResourceServiceTestIamPermissionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resource service test iam permissions o k response has a 5xx status code +func (o *ResourceServiceTestIamPermissionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resource service test iam permissions o k response a status code equal to that given +func (o *ResourceServiceTestIamPermissionsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the resource service test iam permissions o k response +func (o *ResourceServiceTestIamPermissionsOK) Code() int { + return 200 +} + +func (o *ResourceServiceTestIamPermissionsOK) Error() string { + return fmt.Sprintf("[POST /resource-manager/2019-12-10/resources/test-iam-permissions][%d] resourceServiceTestIamPermissionsOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceTestIamPermissionsOK) String() string { + return fmt.Sprintf("[POST /resource-manager/2019-12-10/resources/test-iam-permissions][%d] resourceServiceTestIamPermissionsOK %+v", 200, o.Payload) +} + +func (o *ResourceServiceTestIamPermissionsOK) GetPayload() *models.HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse { + return o.Payload +} + +func (o *ResourceServiceTestIamPermissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewResourceServiceTestIamPermissionsDefault creates a ResourceServiceTestIamPermissionsDefault with default headers values +func NewResourceServiceTestIamPermissionsDefault(code int) *ResourceServiceTestIamPermissionsDefault { + return &ResourceServiceTestIamPermissionsDefault{ + _statusCode: code, + } +} + +/* +ResourceServiceTestIamPermissionsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ResourceServiceTestIamPermissionsDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// IsSuccess returns true when this resource service test iam permissions default response has a 2xx status code +func (o *ResourceServiceTestIamPermissionsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this resource service test iam permissions default response has a 3xx status code +func (o *ResourceServiceTestIamPermissionsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this resource service test iam permissions default response has a 4xx status code +func (o *ResourceServiceTestIamPermissionsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this resource service test iam permissions default response has a 5xx status code +func (o *ResourceServiceTestIamPermissionsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this resource service test iam permissions default response a status code equal to that given +func (o *ResourceServiceTestIamPermissionsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the resource service test iam permissions default response +func (o *ResourceServiceTestIamPermissionsDefault) Code() int { + return o._statusCode +} + +func (o *ResourceServiceTestIamPermissionsDefault) Error() string { + return fmt.Sprintf("[POST /resource-manager/2019-12-10/resources/test-iam-permissions][%d] ResourceService_TestIamPermissions default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceTestIamPermissionsDefault) String() string { + return fmt.Sprintf("[POST /resource-manager/2019-12-10/resources/test-iam-permissions][%d] ResourceService_TestIamPermissions default %+v", o._statusCode, o.Payload) +} + +func (o *ResourceServiceTestIamPermissionsDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *ResourceServiceTestIamPermissionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization.go index 364e5ab3..c1575bbf 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization.go @@ -132,6 +132,11 @@ func (m *HashicorpCloudResourcemanagerOrganization) ContextValidate(ctx context. func (m *HashicorpCloudResourcemanagerOrganization) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { if m.Owner != nil { + + if swag.IsZero(m.Owner) { // not required + return nil + } + if err := m.Owner.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("owner") @@ -148,6 +153,11 @@ func (m *HashicorpCloudResourcemanagerOrganization) contextValidateOwner(ctx con func (m *HashicorpCloudResourcemanagerOrganization) contextValidateState(ctx context.Context, formats strfmt.Registry) error { if m.State != nil { + + if swag.IsZero(m.State) { // not required + return nil + } + if err := m.State.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("state") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_create_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_create_response.go index 37cefd9d..6dd7f5c1 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_create_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_create_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationCreateResponse) ContextValidat func (m *HashicorpCloudResourcemanagerOrganizationCreateResponse) contextValidateOrganization(ctx context.Context, formats strfmt.Registry) error { if m.Organization != nil { + + if swag.IsZero(m.Organization) { // not required + return nil + } + if err := m.Organization.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("organization") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_iam_policy_response.go index 2e02d22e..d08221dd 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_iam_policy_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_iam_policy_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationGetIamPolicyResponse) ContextV func (m *HashicorpCloudResourcemanagerOrganizationGetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_response.go index 147dbb1d..b9dfe636 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationGetResponse) ContextValidate(c func (m *HashicorpCloudResourcemanagerOrganizationGetResponse) contextValidateOrganization(ctx context.Context, formats strfmt.Registry) error { if m.Organization != nil { + + if swag.IsZero(m.Organization) { // not required + return nil + } + if err := m.Organization.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("organization") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_role_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_role_response.go index 0bb0e247..0769a943 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_role_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_get_role_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationGetRoleResponse) ContextValida func (m *HashicorpCloudResourcemanagerOrganizationGetRoleResponse) contextValidateRole(ctx context.Context, formats strfmt.Registry) error { if m.Role != nil { + + if swag.IsZero(m.Role) { // not required + return nil + } + if err := m.Role.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_response.go index 10fa98f6..fa000f59 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_response.go @@ -113,6 +113,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationListResponse) contextValidateO for i := 0; i < len(m.Organizations); i++ { if m.Organizations[i] != nil { + + if swag.IsZero(m.Organizations[i]) { // not required + return nil + } + if err := m.Organizations[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("organizations" + "." + strconv.Itoa(i)) @@ -131,6 +136,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationListResponse) contextValidateO func (m *HashicorpCloudResourcemanagerOrganizationListResponse) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { if m.Pagination != nil { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagination") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_roles_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_roles_response.go index 57cc0557..92ad6e45 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_roles_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_list_roles_response.go @@ -111,6 +111,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationListRolesResponse) ContextVali func (m *HashicorpCloudResourcemanagerOrganizationListRolesResponse) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { if m.Pagination != nil { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagination") @@ -129,6 +134,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationListRolesResponse) contextVali for i := 0; i < len(m.Roles); i++ { if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("roles" + "." + strconv.Itoa(i)) diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_owner.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_owner.go index 89f1f5ae..2d51d862 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_owner.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_owner.go @@ -17,7 +17,7 @@ import ( // swagger:model hashicorp.cloud.resourcemanager.OrganizationOwner type HashicorpCloudResourcemanagerOrganizationOwner struct { - // User is the email of the user who is the owner. + // User is the user principal id of the owner. User string `json:"user,omitempty"` } diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_iam_policy_response.go index 079bb985..d4e9e514 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_iam_policy_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_iam_policy_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationSetIamPolicyResponse) ContextV func (m *HashicorpCloudResourcemanagerOrganizationSetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_name_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_name_response.go index 501c77fb..580c868e 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_name_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_organization_set_name_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerOrganizationSetNameResponse) ContextValida func (m *HashicorpCloudResourcemanagerOrganizationSetNameResponse) contextValidateOrganization(ctx context.Context, formats strfmt.Registry) error { if m.Organization != nil { + + if swag.IsZero(m.Organization) { // not required + return nil + } + if err := m.Organization.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("organization") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy.go index 07a13786..cb3329f5 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy.go @@ -117,6 +117,11 @@ func (m *HashicorpCloudResourcemanagerPolicy) contextValidateBindings(ctx contex for i := 0; i < len(m.Bindings); i++ { if m.Bindings[i] != nil { + + if swag.IsZero(m.Bindings[i]) { // not required + return nil + } + if err := m.Bindings[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bindings" + "." + strconv.Itoa(i)) diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding.go index 6785e0a1..fcd51985 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding.go @@ -86,6 +86,11 @@ func (m *HashicorpCloudResourcemanagerPolicyBinding) contextValidateMembers(ctx for i := 0; i < len(m.Members); i++ { if m.Members[i] != nil { + + if swag.IsZero(m.Members[i]) { // not required + return 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)) diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding_member.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding_member.go index ef4d97c3..b60c845c 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding_member.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_policy_binding_member.go @@ -75,6 +75,11 @@ func (m *HashicorpCloudResourcemanagerPolicyBindingMember) ContextValidate(ctx c func (m *HashicorpCloudResourcemanagerPolicyBindingMember) contextValidateMemberType(ctx context.Context, formats strfmt.Registry) error { if m.MemberType != nil { + + if swag.IsZero(m.MemberType) { // not required + return nil + } + if err := m.MemberType.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("member_type") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project.go index 7ce72717..15755551 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project.go @@ -132,6 +132,11 @@ func (m *HashicorpCloudResourcemanagerProject) ContextValidate(ctx context.Conte func (m *HashicorpCloudResourcemanagerProject) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { if m.Parent != nil { + + if swag.IsZero(m.Parent) { // not required + return nil + } + if err := m.Parent.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("parent") @@ -148,6 +153,11 @@ func (m *HashicorpCloudResourcemanagerProject) contextValidateParent(ctx context func (m *HashicorpCloudResourcemanagerProject) contextValidateState(ctx context.Context, formats strfmt.Registry) error { if m.State != nil { + + if swag.IsZero(m.State) { // not required + return nil + } + if err := m.State.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("state") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_request.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_request.go index 90f50299..e9e45ce1 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_request.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_request.go @@ -78,6 +78,11 @@ func (m *HashicorpCloudResourcemanagerProjectCreateRequest) ContextValidate(ctx func (m *HashicorpCloudResourcemanagerProjectCreateRequest) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { if m.Parent != nil { + + if swag.IsZero(m.Parent) { // not required + return nil + } + if err := m.Parent.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("parent") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_response.go index 47d6ab17..14e99dc2 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_create_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerProjectCreateResponse) ContextValidate(ctx func (m *HashicorpCloudResourcemanagerProjectCreateResponse) contextValidateProject(ctx context.Context, formats strfmt.Registry) error { if m.Project != nil { + + if swag.IsZero(m.Project) { // not required + return nil + } + if err := m.Project.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("project") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_delete_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_delete_response.go index d8116c6f..570ec590 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_delete_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_delete_response.go @@ -73,6 +73,11 @@ func (m *HashicorpCloudResourcemanagerProjectDeleteResponse) ContextValidate(ctx func (m *HashicorpCloudResourcemanagerProjectDeleteResponse) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { if m.Operation != nil { + + if swag.IsZero(m.Operation) { // not required + return nil + } + if err := m.Operation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operation") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_iam_policy_response.go index 942a3d1c..35b20a01 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_iam_policy_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_iam_policy_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerProjectGetIamPolicyResponse) ContextValida func (m *HashicorpCloudResourcemanagerProjectGetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_response.go index 3d37dc77..57dbb95f 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_get_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerProjectGetResponse) ContextValidate(ctx co func (m *HashicorpCloudResourcemanagerProjectGetResponse) contextValidateProject(ctx context.Context, formats strfmt.Registry) error { if m.Project != nil { + + if swag.IsZero(m.Project) { // not required + return nil + } + if err := m.Project.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("project") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_list_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_list_response.go index dcfb6dd3..ae902112 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_list_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_list_response.go @@ -111,6 +111,11 @@ func (m *HashicorpCloudResourcemanagerProjectListResponse) ContextValidate(ctx c func (m *HashicorpCloudResourcemanagerProjectListResponse) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { if m.Pagination != nil { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagination") @@ -129,6 +134,11 @@ func (m *HashicorpCloudResourcemanagerProjectListResponse) contextValidateProjec for i := 0; i < len(m.Projects); i++ { if m.Projects[i] != nil { + + if swag.IsZero(m.Projects[i]) { // not required + return 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)) diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_set_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_set_iam_policy_response.go index 807506b1..a6d281d3 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_set_iam_policy_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_project_set_iam_policy_response.go @@ -72,6 +72,11 @@ func (m *HashicorpCloudResourcemanagerProjectSetIamPolicyResponse) ContextValida func (m *HashicorpCloudResourcemanagerProjectSetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource.go index a5018ae5..f782bcd4 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource.go @@ -74,6 +74,11 @@ func (m *HashicorpCloudResourcemanagerResource) ContextValidate(ctx context.Cont func (m *HashicorpCloudResourcemanagerResource) contextValidateLink(ctx context.Context, formats strfmt.Registry) error { if m.Link != nil { + + if swag.IsZero(m.Link) { // not required + return nil + } + if err := m.Link.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("link") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_get_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_get_iam_policy_response.go new file mode 100644 index 00000000..7ff318f4 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_get_iam_policy_response.go @@ -0,0 +1,109 @@ +// 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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudResourcemanagerResourceGetIamPolicyResponse ResourceGetIamPolicyRequest see ResourceService.GetIamPolicy +// +// swagger:model hashicorp.cloud.resourcemanager.ResourceGetIamPolicyResponse +type HashicorpCloudResourcemanagerResourceGetIamPolicyResponse struct { + + // Policy is the system managed IAM policy for the resource. + Policy *HashicorpCloudResourcemanagerPolicy `json:"policy,omitempty"` +} + +// Validate validates this hashicorp cloud resourcemanager resource get iam policy response +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) validatePolicy(formats strfmt.Registry) error { + if swag.IsZero(m.Policy) { // not required + return nil + } + + if m.Policy != nil { + if err := m.Policy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud resourcemanager resource get iam policy response based on the context it is used +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + + if err := m.Policy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceGetIamPolicyResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudResourcemanagerResourceGetIamPolicyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_id.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_id.go index c3e069ae..693f35aa 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_id.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_id.go @@ -75,6 +75,11 @@ func (m *HashicorpCloudResourcemanagerResourceID) ContextValidate(ctx context.Co func (m *HashicorpCloudResourcemanagerResourceID) contextValidateType(ctx context.Context, formats strfmt.Registry) error { if m.Type != nil { + + if swag.IsZero(m.Type) { // not required + return nil + } + if err := m.Type.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_list_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_list_response.go index fa9fa54a..1ebbf4de 100644 --- a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_list_response.go +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_list_response.go @@ -111,6 +111,11 @@ func (m *HashicorpCloudResourcemanagerResourceListResponse) ContextValidate(ctx func (m *HashicorpCloudResourcemanagerResourceListResponse) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { if m.Pagination != nil { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagination") @@ -129,6 +134,11 @@ func (m *HashicorpCloudResourcemanagerResourceListResponse) contextValidateResou for i := 0; i < len(m.Resources); i++ { if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return 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)) diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_request.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_request.go new file mode 100644 index 00000000..2c3b9e96 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_request.go @@ -0,0 +1,117 @@ +// 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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudResourcemanagerResourceSetIamPolicyRequest ResourceSetIamPolicyRequest see ResourceService.SetIamPolicy +// +// swagger:model hashicorp.cloud.resourcemanager.ResourceSetIamPolicyRequest +type HashicorpCloudResourcemanagerResourceSetIamPolicyRequest struct { + + // Policy is the IAM policy to be updated for the resource. The policy + // will be completely replaced and therefore Policy.Etag must be specified + // in order to prevent concurrent updates. + Policy *HashicorpCloudResourcemanagerPolicy `json:"policy,omitempty"` + + // ResourceId is the resource name of the resource. Either this or the ResourceName needs to be provided. + ResourceID string `json:"resource_id,omitempty"` + + // ResourceName is the resource name of the resource. Either this or the ResourceId needs to be provided. + ResourceName string `json:"resource_name,omitempty"` +} + +// Validate validates this hashicorp cloud resourcemanager resource set iam policy request +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) validatePolicy(formats strfmt.Registry) error { + if swag.IsZero(m.Policy) { // not required + return nil + } + + if m.Policy != nil { + if err := m.Policy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud resourcemanager resource set iam policy request based on the context it is used +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + + if err := m.Policy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudResourcemanagerResourceSetIamPolicyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_response.go new file mode 100644 index 00000000..441b65bc --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_set_iam_policy_response.go @@ -0,0 +1,109 @@ +// 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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudResourcemanagerResourceSetIamPolicyResponse ResourceSetIamPolicyResponse see ResourceService.SetIamPolicy +// +// swagger:model hashicorp.cloud.resourcemanager.ResourceSetIamPolicyResponse +type HashicorpCloudResourcemanagerResourceSetIamPolicyResponse struct { + + // Policy is the updated IAM policy for the resource. + Policy *HashicorpCloudResourcemanagerPolicy `json:"policy,omitempty"` +} + +// Validate validates this hashicorp cloud resourcemanager resource set iam policy response +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) validatePolicy(formats strfmt.Registry) error { + if swag.IsZero(m.Policy) { // not required + return nil + } + + if m.Policy != nil { + if err := m.Policy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud resourcemanager resource set iam policy response based on the context it is used +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + + if err := m.Policy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceSetIamPolicyResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudResourcemanagerResourceSetIamPolicyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_request.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_request.go new file mode 100644 index 00000000..66ae3205 --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_request.go @@ -0,0 +1,112 @@ +// 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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest see ResourceService.TestIamPermissions +// +// swagger:model hashicorp.cloud.resourcemanager.ResourceTestIamPermissionsRequest +type HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest struct { + + // Permissions to test. + Permissions []string `json:"permissions"` + + // resource is the scope of the permissions that is going to be retrieved. + Resource *HashicorpCloudResourcemanagerResource `json:"resource,omitempty"` +} + +// Validate validates this hashicorp cloud resourcemanager resource test iam permissions request +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResource(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) validateResource(formats strfmt.Registry) error { + if swag.IsZero(m.Resource) { // not required + return nil + } + + if m.Resource != nil { + if err := m.Resource.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resource") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resource") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud resourcemanager resource test iam permissions request based on the context it is used +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResource(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) contextValidateResource(ctx context.Context, formats strfmt.Registry) error { + + if m.Resource != nil { + + if swag.IsZero(m.Resource) { // not required + return nil + } + + if err := m.Resource.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resource") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resource") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudResourcemanagerResourceTestIamPermissionsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_response.go b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_response.go new file mode 100644 index 00000000..430ed63a --- /dev/null +++ b/clients/cloud-resource-manager/stable/2019-12-10/models/hashicorp_cloud_resourcemanager_resource_test_iam_permissions_response.go @@ -0,0 +1,50 @@ +// 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" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse see ResourceService.TestIamPermissions +// +// swagger:model hashicorp.cloud.resourcemanager.ResourceTestIamPermissionsResponse +type HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse struct { + + // AllowedPermissions are a subset of the request permissions the calling principal has for the resource. + AllowedPermissions []string `json:"allowed_permissions"` +} + +// Validate validates this hashicorp cloud resourcemanager resource test iam permissions response +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hashicorp cloud resourcemanager resource test iam permissions response based on context it is used +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudResourcemanagerResourceTestIamPermissionsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}