Class: Google::Apis::ChromepolicyV1::ChromePolicyService

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

Overview

Chrome Policy API

The Chrome Policy API is a suite of services that allows Chrome administrators to control the policies applied to their managed Chrome OS devices and Chrome browsers.

Examples:

require 'google/apis/chromepolicy_v1'

Chromepolicy = Google::Apis::ChromepolicyV1 # Alias the module
service = Chromepolicy::ChromePolicyService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChromePolicyService

Returns a new instance of ChromePolicyService.



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

def initialize
  super('https://chromepolicy.googleapis.com/', '',
        client_name: 'google-apis-chromepolicy_v1',
        client_version: Google::Apis::ChromepolicyV1::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.



40
41
42
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 40

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.



45
46
47
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#batch_customer_policy_orgunit_inherit(customer, google_chrome_policy_v1_batch_inherit_org_unit_policies_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleProtobufEmpty

Modify multiple policy values that are applied to a specific org unit so that they now inherit the value from a parent (if applicable). All targets must have the same target format. That is to say that they must point to the same target resource and must have the same keys specified in additionalTargetKeyNames, though the values for those keys may be different. On failure the request will return the error details as part of the google.rpc. Status.

Parameters:

  • customer (String)

    ID of the G Suite account or literal "my_customer" for the customer associated to the request.

  • google_chrome_policy_v1_batch_inherit_org_unit_policies_request_object (Google::Apis::ChromepolicyV1::GoogleChromePolicyV1BatchInheritOrgUnitPoliciesRequest) (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



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 117

def batch_customer_policy_orgunit_inherit(customer, google_chrome_policy_v1_batch_inherit_org_unit_policies_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+customer}/policies/orgunits:batchInherit', options)
  command.request_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1BatchInheritOrgUnitPoliciesRequest::Representation
  command.request_object = google_chrome_policy_v1_batch_inherit_org_unit_policies_request_object
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleProtobufEmpty
  command.params['customer'] = customer unless customer.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_customer_policy_orgunit_modify(customer, google_chrome_policy_v1_batch_modify_org_unit_policies_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleProtobufEmpty

Modify multiple policy values that are applied to a specific org unit. All targets must have the same target format. That is to say that they must point to the same target resource and must have the same keys specified in additionalTargetKeyNames, though the values for those keys may be different. On failure the request will return the error details as part of the google.rpc. Status.

Parameters:

  • customer (String)

    ID of the G Suite account or literal "my_customer" for the customer associated to the request.

  • google_chrome_policy_v1_batch_modify_org_unit_policies_request_object (Google::Apis::ChromepolicyV1::GoogleChromePolicyV1BatchModifyOrgUnitPoliciesRequest) (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



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

def batch_customer_policy_orgunit_modify(customer, google_chrome_policy_v1_batch_modify_org_unit_policies_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+customer}/policies/orgunits:batchModify', options)
  command.request_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1BatchModifyOrgUnitPoliciesRequest::Representation
  command.request_object = google_chrome_policy_v1_batch_modify_org_unit_policies_request_object
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleProtobufEmpty
  command.params['customer'] = customer unless customer.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_customer_policy_schema(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleChromePolicyV1PolicySchema

Get a specific policy schema for a customer by its resource name.

Parameters:

  • name (String)

    Required. The policy schema resource name to query.

  • 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



188
189
190
191
192
193
194
195
196
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 188

def get_customer_policy_schema(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1PolicySchema::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1PolicySchema
  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_customer_policy_schemas(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ListPolicySchemasResponse

Gets a list of policy schemas that match a specified filter value for a given customer.

Parameters:

  • parent (String)

    Required. The customer for which the listing request will apply.

  • filter (String) (defaults to: nil)

    The schema filter used to find a particular schema based on fields like its resource name, description and additionalTargetKeyNames.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of policy schemas to return.

  • page_token (String) (defaults to: nil)

    The page token used to retrieve a specific page of the listing 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



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

def list_customer_policy_schemas(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/policySchemas', options)
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ListPolicySchemasResponse::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ListPolicySchemasResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.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

#resolve_customer_policy(customer, google_chrome_policy_v1_resolve_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ResolveResponse

Gets the resolved policy values for a list of policies that match a search query.

Parameters:

  • customer (String)

    ID of the G Suite account or literal "my_customer" for the customer associated to the request.

  • google_chrome_policy_v1_resolve_request_object (Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ResolveRequest) (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



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 77

def resolve_customer_policy(customer, google_chrome_policy_v1_resolve_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+customer}/policies:resolve', options)
  command.request_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ResolveRequest::Representation
  command.request_object = google_chrome_policy_v1_resolve_request_object
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ResolveResponse::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1ResolveResponse
  command.params['customer'] = customer unless customer.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#upload_medium(customer, google_chrome_policy_v1_upload_policy_file_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChromepolicyV1::GoogleChromePolicyV1UploadPolicyFileResponse

Creates an enterprise file from the content provided by user. Returns a public download url for end user.

Parameters:

  • customer (String)

    Required. The customer for which the file upload will apply.

  • google_chrome_policy_v1_upload_policy_file_request_object (Google::Apis::ChromepolicyV1::GoogleChromePolicyV1UploadPolicyFileRequest) (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.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • 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



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/google/apis/chromepolicy_v1/service.rb', line 265

def upload_medium(customer, google_chrome_policy_v1_upload_policy_file_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'v1/{+customer}/policies/files:uploadPolicyFile', options)
  else
    command = make_upload_command(:post, 'v1/{+customer}/policies/files:uploadPolicyFile', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1UploadPolicyFileRequest::Representation
  command.request_object = google_chrome_policy_v1_upload_policy_file_request_object
  command.response_representation = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1UploadPolicyFileResponse::Representation
  command.response_class = Google::Apis::ChromepolicyV1::GoogleChromePolicyV1UploadPolicyFileResponse
  command.params['customer'] = customer unless customer.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end