Class: Google::Apis::OrgpolicyV2::OrgPolicyAPIService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/orgpolicy_v2/service.rb

Overview

Organization Policy API

The Organization Policy API allows users to configure governance rules on their Google Cloud resources across the resource hierarchy.

Examples:

require 'google/apis/orgpolicy_v2'

Orgpolicy = Google::Apis::OrgpolicyV2 # Alias the module
service = Orgpolicy::OrgPolicyAPIService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://orgpolicy.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrgPolicyAPIService

Returns a new instance of OrgPolicyAPIService.



48
49
50
51
52
53
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-orgpolicy_v2',
        client_version: Google::Apis::OrgpolicyV2::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#create_folder_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Creates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the policy already exists on the given Google Cloud resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that will parent the new policy. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 123

def create_folder_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/policies', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_organization_custom_constraint(parent, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint

Creates a custom constraint. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the organization does not exist. Returns a google.rpc. Status with google.rpc.Code.ALREADY_EXISTS if the constraint already exists on the given organization.

Parameters:

  • parent (String)

    Required. Must be in the following form: * organizations/organization_id``

  • google_cloud_orgpolicy_v2_custom_constraint_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



392
393
394
395
396
397
398
399
400
401
402
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 392

def create_organization_custom_constraint(parent, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/customConstraints', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
  command.request_object = google_cloud_orgpolicy_v2_custom_constraint_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_organization_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Creates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the policy already exists on the given Google Cloud resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that will parent the new policy. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



576
577
578
579
580
581
582
583
584
585
586
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 576

def create_organization_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/policies', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Creates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the policy already exists on the given Google Cloud resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that will parent the new policy. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



848
849
850
851
852
853
854
855
856
857
858
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 848

def create_project_policy(parent, google_cloud_orgpolicy_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/policies', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_folder_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleProtobufEmpty

Deletes a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or organization policy does not exist.

Parameters:

  • name (String)

    Required. Name of the policy to delete. See the policy entry for naming rules.

  • etag (String) (defaults to: nil)

    Optional. The current entity tag (ETag) of the organization policy. If an ETag is provided and doesn't match the current ETag of the policy, deletion of the policy will be blocked and an ABORTED error will be returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



160
161
162
163
164
165
166
167
168
169
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 160

def delete_folder_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleProtobufEmpty

Deletes a custom constraint. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the constraint does not exist.

Parameters:

  • name (String)

    Required. Name of the custom constraint to delete. See the custom constraint entry for naming rules.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



426
427
428
429
430
431
432
433
434
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 426

def delete_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_organization_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleProtobufEmpty

Deletes a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or organization policy does not exist.

Parameters:

  • name (String)

    Required. Name of the policy to delete. See the policy entry for naming rules.

  • etag (String) (defaults to: nil)

    Optional. The current entity tag (ETag) of the organization policy. If an ETag is provided and doesn't match the current ETag of the policy, deletion of the policy will be blocked and an ABORTED error will be returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



613
614
615
616
617
618
619
620
621
622
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 613

def delete_organization_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleProtobufEmpty

Deletes a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or organization policy does not exist.

Parameters:

  • name (String)

    Required. Name of the policy to delete. See the policy entry for naming rules.

  • etag (String) (defaults to: nil)

    Optional. The current entity tag (ETag) of the organization policy. If an ETag is provided and doesn't match the current ETag of the policy, deletion of the policy will be blocked and an ABORTED error will be returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



885
886
887
888
889
890
891
892
893
894
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 885

def delete_project_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_folder_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets a policy on a resource. If no policy is set on the resource, NOT_FOUND is returned. The entity tag (ETag) can be used with UpdatePolicy() to update a policy during read-modify-write.

Parameters:

  • name (String)

    Required. Resource name of the policy. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



193
194
195
196
197
198
199
200
201
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 193

def get_folder_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_folder_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets the effective policy on a resource. This is the result of merging policies in the resource hierarchy and evaluating conditions. The returned policy will not have an ETag or condition set because it is an evaluated policy across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.

Parameters:

  • name (String)

    Required. The effective policy to compute. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



227
228
229
230
231
232
233
234
235
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 227

def get_folder_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}:getEffectivePolicy', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint

Gets a custom or managed constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the custom or managed constraint does not exist.

Parameters:

  • name (String)

    Required. Resource name of the custom or managed constraint. See the custom constraint entry for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



458
459
460
461
462
463
464
465
466
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 458

def get_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets a policy on a resource. If no policy is set on the resource, NOT_FOUND is returned. The entity tag (ETag) can be used with UpdatePolicy() to update a policy during read-modify-write.

Parameters:

  • name (String)

    Required. Resource name of the policy. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



646
647
648
649
650
651
652
653
654
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 646

def get_organization_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets the effective policy on a resource. This is the result of merging policies in the resource hierarchy and evaluating conditions. The returned policy will not have an ETag or condition set because it is an evaluated policy across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.

Parameters:

  • name (String)

    Required. The effective policy to compute. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



680
681
682
683
684
685
686
687
688
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 680

def get_organization_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}:getEffectivePolicy', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets a policy on a resource. If no policy is set on the resource, NOT_FOUND is returned. The entity tag (ETag) can be used with UpdatePolicy() to update a policy during read-modify-write.

Parameters:

  • name (String)

    Required. Resource name of the policy. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



918
919
920
921
922
923
924
925
926
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 918

def get_project_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Gets the effective policy on a resource. This is the result of merging policies in the resource hierarchy and evaluating conditions. The returned policy will not have an ETag or condition set because it is an evaluated policy across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.

Parameters:

  • name (String)

    Required. The effective policy to compute. See Policy for naming requirements.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



952
953
954
955
956
957
958
959
960
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 952

def get_project_policy_effective_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}:getEffectivePolicy', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_folder_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse

Lists constraints that could be applied on the specified resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that parents the constraint. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 84

def list_folder_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/constraints', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_folder_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse

Retrieves all of the policies that exist on a particular resource.

Parameters:

  • parent (String)

    Required. The target Google Cloud resource that parents the set of constraints and policies that will be returned from this call. Must be in one of the following forms: * projects/project_number* `projects/`project_id * folders/folder_number* `organizations/`organization_number

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



266
267
268
269
270
271
272
273
274
275
276
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 266

def list_folder_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/policies', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse

Lists constraints that could be applied on the specified resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that parents the constraint. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



356
357
358
359
360
361
362
363
364
365
366
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 356

def list_organization_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/constraints', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_custom_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse

Retrieves all of the custom constraints that exist on a particular organization resource.

Parameters:

  • parent (String)

    Required. The target Google Cloud resource that parents the set of custom constraints that will be returned from this call. Must be in one of the following forms: * organizations/organization_id``

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



497
498
499
500
501
502
503
504
505
506
507
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 497

def list_organization_custom_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/customConstraints', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse

Retrieves all of the policies that exist on a particular resource.

Parameters:

  • parent (String)

    Required. The target Google Cloud resource that parents the set of constraints and policies that will be returned from this call. Must be in one of the following forms: * projects/project_number* `projects/`project_id * folders/folder_number* `organizations/`organization_number

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



719
720
721
722
723
724
725
726
727
728
729
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 719

def list_organization_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/policies', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse

Lists constraints that could be applied on the specified resource.

Parameters:

  • parent (String)

    Required. The Google Cloud resource that parents the constraint. Must be in one of the following forms: * projects/project_number* `projects/` project_id * folders/folder_number`*organizations/organization_number `

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



809
810
811
812
813
814
815
816
817
818
819
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 809

def list_project_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/constraints', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListConstraintsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse

Retrieves all of the policies that exist on a particular resource.

Parameters:

  • parent (String)

    Required. The target Google Cloud resource that parents the set of constraints and policies that will be returned from this call. Must be in one of the following forms: * projects/project_number* `projects/`project_id * folders/folder_number* `organizations/`organization_number

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is not used, but the server may at any point start using this field to limit page size.

  • page_token (String) (defaults to: nil)

    Page token used to retrieve the next page. This is not used, but the server may at any point start using this field.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



991
992
993
994
995
996
997
998
999
1000
1001
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 991

def list_project_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/policies', options)
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListPoliciesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_folder_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Updates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or the policy doesn't exist. Returns a google. rpc.Status with google.rpc.Code.ABORTED if the ETag supplied in the request doesn't match the persisted ETag of the policy. Note: the supplied policy will perform a full overwrite of all fields.

Parameters:

  • name (String)

    Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint that this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_number`/policies/`constraint_name * organizations/ organization_number/policies/constraint_nameFor example, `projects/123/ policies/compute.disableSerialPortAccess`. Note: `projects/`project_id`/ policies/`constraint_name is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Field mask used to specify the fields to be overwritten in the policy. The fields specified in the update_mask are relative to the policy, not the full request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 314

def patch_folder_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_organization_custom_constraint(name, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint

Updates a custom constraint. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.

Parameters:

  • name (String)

    Immutable. Name of the constraint. This is unique within the organization. The name must be of the form: * organizations/organization_id/customConstraints/ custom_constraint_id`Example:organizations/123/customConstraints/custom. createOnlyE2TypeVms` The max length is 71 characters and the minimum length is

    1. Note that the prefix organizations/organization_id/customConstraints/ custom. is not counted.
  • google_cloud_orgpolicy_v2_custom_constraint_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



537
538
539
540
541
542
543
544
545
546
547
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 537

def patch_organization_custom_constraint(name, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
  command.request_object = google_cloud_orgpolicy_v2_custom_constraint_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_organization_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Updates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or the policy doesn't exist. Returns a google. rpc.Status with google.rpc.Code.ABORTED if the ETag supplied in the request doesn't match the persisted ETag of the policy. Note: the supplied policy will perform a full overwrite of all fields.

Parameters:

  • name (String)

    Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint that this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_number`/policies/`constraint_name * organizations/ organization_number/policies/constraint_nameFor example, `projects/123/ policies/compute.disableSerialPortAccess`. Note: `projects/`project_id`/ policies/`constraint_name is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Field mask used to specify the fields to be overwritten in the policy. The fields specified in the update_mask are relative to the policy, not the full request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 767

def patch_organization_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy

Updates a policy. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the constraint or the policy doesn't exist. Returns a google. rpc.Status with google.rpc.Code.ABORTED if the ETag supplied in the request doesn't match the persisted ETag of the policy. Note: the supplied policy will perform a full overwrite of all fields.

Parameters:

  • name (String)

    Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint that this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_number`/policies/`constraint_name * organizations/ organization_number/policies/constraint_nameFor example, `projects/123/ policies/compute.disableSerialPortAccess`. Note: `projects/`project_id`/ policies/`constraint_name is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

  • google_cloud_orgpolicy_v2_policy_object (Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Field mask used to specify the fields to be overwritten in the policy. The fields specified in the update_mask are relative to the policy, not the full request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 1039

def patch_project_policy(name, google_cloud_orgpolicy_v2_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.request_object = google_cloud_orgpolicy_v2_policy_object
  command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy::Representation
  command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2Policy
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end