Class: Google::Apis::ServiceuserV1::ServiceUserService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/serviceuser_v1/service.rb

Overview

Service User API

Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.

Examples:

require 'google/apis/serviceuser_v1'

Serviceuser = Google::Apis::ServiceuserV1 # Alias the module
service = Serviceuser::ServiceUserService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeServiceUserService

Returns a new instance of ServiceUserService



47
48
49
50
# File 'generated/google/apis/serviceuser_v1/service.rb', line 47

def initialize
  super('https://serviceuser.googleapis.com/', '')
  @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 'generated/google/apis/serviceuser_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 'generated/google/apis/serviceuser_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#disable_service(name, disable_service_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ServiceuserV1::Operation

Disable a service so it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks. Operation

Parameters:

  • name (String)

    Name of the consumer and the service to disable for that consumer. The Service User implementation accepts the following forms for consumer:

    • "project:" A valid path would be:
    • /v1/projects/my-project/services/servicemanagement.googleapis.com:disable
  • disable_service_request_object (Google::Apis::ServiceuserV1::DisableServiceRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



80
81
82
83
84
85
86
87
88
89
90
# File 'generated/google/apis/serviceuser_v1/service.rb', line 80

def disable_service(name, disable_service_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:disable', options)
  command.request_representation = Google::Apis::ServiceuserV1::DisableServiceRequest::Representation
  command.request_object = disable_service_request_object
  command.response_representation = Google::Apis::ServiceuserV1::Operation::Representation
  command.response_class = Google::Apis::ServiceuserV1::Operation
  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

#enable_service(name, enable_service_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ServiceuserV1::Operation

Enable a service so it can be used with a project. See Cloud Auth Guide for more information. Operation

Parameters:

  • name (String)

    Name of the consumer and the service to enable for that consumer. A valid path would be:

    • /v1/projects/my-project/services/servicemanagement.googleapis.com:enable
  • enable_service_request_object (Google::Apis::ServiceuserV1::EnableServiceRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



118
119
120
121
122
123
124
125
126
127
128
# File 'generated/google/apis/serviceuser_v1/service.rb', line 118

def enable_service(name, enable_service_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:enable', options)
  command.request_representation = Google::Apis::ServiceuserV1::EnableServiceRequest::Representation
  command.request_object = enable_service_request_object
  command.response_representation = Google::Apis::ServiceuserV1::Operation::Representation
  command.response_class = Google::Apis::ServiceuserV1::Operation
  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_project_services(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ServiceuserV1::ListEnabledServicesResponse

List enabled services for the specified consumer.

Parameters:

  • parent (String)

    List enabled services for the specified parent. An example valid parent would be:

    • projects/my-project
  • page_size (Fixnum)

    Requested size of the next page of data.

  • page_token (String)

    Token identifying which result to start with; returned by a previous list call.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def list_project_services(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+parent}/services', options)
  command.response_representation = Google::Apis::ServiceuserV1::ListEnabledServicesResponse::Representation
  command.response_class = Google::Apis::ServiceuserV1::ListEnabledServicesResponse
  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

#search_services(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ServiceuserV1::SearchServicesResponse

Search available services. When no filter is specified, returns all accessible services. For authenticated users, also returns all services the calling user has "servicemanagement.services.bind" permission for.

Parameters:

  • page_size (Fixnum)

    Requested size of the next page of data.

  • page_token (String)

    Token identifying which result to start with; returned by a previous list call.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



195
196
197
198
199
200
201
202
203
204
# File 'generated/google/apis/serviceuser_v1/service.rb', line 195

def search_services(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/services:search', options)
  command.response_representation = Google::Apis::ServiceuserV1::SearchServicesResponse::Representation
  command.response_class = Google::Apis::ServiceuserV1::SearchServicesResponse
  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