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_id* `organizations/`organization_id

  • 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



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

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



389
390
391
392
393
394
395
396
397
398
399
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 389

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_id* `organizations/`organization_id

  • 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



572
573
574
575
576
577
578
579
580
581
582
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 572

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_id* `organizations/`organization_id

  • 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



842
843
844
845
846
847
848
849
850
851
852
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 842

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 etag of policy. If an etag is provided and does not match the current etag of the policy, deletion 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



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

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



423
424
425
426
427
428
429
430
431
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 423

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 etag of policy. If an etag is provided and does not match the current etag of the policy, deletion 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



609
610
611
612
613
614
615
616
617
618
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 609

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 etag of policy. If an etag is provided and does not match the current etag of the policy, deletion 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



879
880
881
882
883
884
885
886
887
888
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 879

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 etag value 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



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

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



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

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 constraint. Returns a google.rpc.Status with google.rpc.Code. NOT_FOUND if the custom constraint does not exist.

Parameters:

  • name (String)

    Required. Resource name of the custom 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



455
456
457
458
459
460
461
462
463
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 455

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 etag value 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



642
643
644
645
646
647
648
649
650
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 642

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



676
677
678
679
680
681
682
683
684
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 676

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 etag value 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



912
913
914
915
916
917
918
919
920
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 912

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



946
947
948
949
950
951
952
953
954
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 946

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



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

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



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

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



353
354
355
356
357
358
359
360
361
362
363
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 353

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 currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



494
495
496
497
498
499
500
501
502
503
504
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 494

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



715
716
717
718
719
720
721
722
723
724
725
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 715

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



804
805
806
807
808
809
810
811
812
813
814
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 804

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_id* `organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Size of the pages to be returned. This is currently unsupported and will be ignored. 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 currently unsupported and will be ignored. 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



985
986
987
988
989
990
991
992
993
994
995
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 985

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 do not exist. Returns a google.rpc. Status with google.rpc.Code.ABORTED if the etag supplied in the request does not 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 which this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_id`/policies/`constraint_name * organizations/ organization_id/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 by the set. 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



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

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. Format of the name should be * organizations/organization_id/ customConstraints/custom_constraint_id`Example:organizations/123/ customConstraints/custom.createOnlyE2TypeVmsThe max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/ organization_id/customConstraints/` 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



534
535
536
537
538
539
540
541
542
543
544
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 534

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 do not exist. Returns a google.rpc. Status with google.rpc.Code.ABORTED if the etag supplied in the request does not 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 which this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_id`/policies/`constraint_name * organizations/ organization_id/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 by the set. 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



763
764
765
766
767
768
769
770
771
772
773
774
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 763

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 do not exist. Returns a google.rpc. Status with google.rpc.Code.ABORTED if the etag supplied in the request does not 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 which this policy configures: * projects/project_number/policies/constraint_name* ` folders/`folder_id`/policies/`constraint_name * organizations/ organization_id/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 by the set. 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



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/google/apis/orgpolicy_v2/service.rb', line 1033

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