Class: Google::Apis::DataportabilityV1::DataPortabilityService

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

Overview

Data Portability API

The Data Portability API lets you build applications that request authorization from a user to move a copy of data from Google services into your application. This enables data portability and facilitates switching services.

Examples:

require 'google/apis/dataportability_v1'

Dataportability = Google::Apis::DataportabilityV1 # Alias the module
service = Dataportability::DataPortabilityService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDataPortabilityService

Returns a new instance of DataPortabilityService.



50
51
52
53
54
55
# File 'lib/google/apis/dataportability_v1/service.rb', line 50

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-dataportability_v1',
        client_version: Google::Apis::DataportabilityV1::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.



43
44
45
# File 'lib/google/apis/dataportability_v1/service.rb', line 43

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.



48
49
50
# File 'lib/google/apis/dataportability_v1/service.rb', line 48

def quota_user
  @quota_user
end

Instance Method Details

#cancel_archive_job_portability_archive(name, cancel_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::CancelPortabilityArchiveResponse

Cancels a Portability Archive job.

Parameters:

  • name (String)

    Required. The Archive job ID you're canceling. This is returned by the InitiatePortabilityArchive response. The format is: archiveJobs/archive_job. Canceling is only executed if the job is in progress.

  • cancel_portability_archive_request_object (Google::Apis::DataportabilityV1::CancelPortabilityArchiveRequest) (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



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/google/apis/dataportability_v1/service.rb', line 110

def cancel_archive_job_portability_archive(name, cancel_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:cancel', options)
  command.request_representation = Google::Apis::DataportabilityV1::CancelPortabilityArchiveRequest::Representation
  command.request_object = cancel_portability_archive_request_object
  command.response_representation = Google::Apis::DataportabilityV1::CancelPortabilityArchiveResponse::Representation
  command.response_class = Google::Apis::DataportabilityV1::CancelPortabilityArchiveResponse
  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

#check_access_type(check_access_type_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::CheckAccessTypeResponse

Gets the access type of the token.

Parameters:

  • check_access_type_request_object (Google::Apis::DataportabilityV1::CheckAccessTypeRequest) (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



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

def check_access_type(check_access_type_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/accessType:check', options)
  command.request_representation = Google::Apis::DataportabilityV1::CheckAccessTypeRequest::Representation
  command.request_object = check_access_type_request_object
  command.response_representation = Google::Apis::DataportabilityV1::CheckAccessTypeResponse::Representation
  command.response_class = Google::Apis::DataportabilityV1::CheckAccessTypeResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_archive_job_portability_archive_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::PortabilityArchiveState

Retrieves the state of an Archive job for the Portability API.

Parameters:

  • name (String)

    Required. The archive job ID that is returned when you request the state of the job. The format is: archiveJobs/archive_job/portabilityArchiveState. archive_job is the job ID returned by the InitiatePortabilityArchiveResponse.

  • 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



144
145
146
147
148
149
150
151
152
# File 'lib/google/apis/dataportability_v1/service.rb', line 144

def get_archive_job_portability_archive_state(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::DataportabilityV1::PortabilityArchiveState::Representation
  command.response_class = Google::Apis::DataportabilityV1::PortabilityArchiveState
  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

#initiate_portability_archive(initiate_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::InitiatePortabilityArchiveResponse

Initiates a new Archive job for the Portability API.

Parameters:

  • initiate_portability_archive_request_object (Google::Apis::DataportabilityV1::InitiatePortabilityArchiveRequest) (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



242
243
244
245
246
247
248
249
250
251
# File 'lib/google/apis/dataportability_v1/service.rb', line 242

def initiate_portability_archive(initiate_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/portabilityArchive:initiate', options)
  command.request_representation = Google::Apis::DataportabilityV1::InitiatePortabilityArchiveRequest::Representation
  command.request_object = initiate_portability_archive_request_object
  command.response_representation = Google::Apis::DataportabilityV1::InitiatePortabilityArchiveResponse::Representation
  command.response_class = Google::Apis::DataportabilityV1::InitiatePortabilityArchiveResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#reset_authorization(reset_authorization_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::Empty

Revokes OAuth tokens and resets exhausted scopes for a user/project pair. This method allows you to initiate a request after a new consent is granted. This method also indicates that previous archives can be garbage collected. You should call this method when all jobs are complete and all archives are downloaded. Do not call it only when you start a new job.

Parameters:

  • reset_authorization_request_object (Google::Apis::DataportabilityV1::ResetAuthorizationRequest) (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



212
213
214
215
216
217
218
219
220
221
# File 'lib/google/apis/dataportability_v1/service.rb', line 212

def reset_authorization(reset_authorization_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/authorization:reset', options)
  command.request_representation = Google::Apis::DataportabilityV1::ResetAuthorizationRequest::Representation
  command.request_object = reset_authorization_request_object
  command.response_representation = Google::Apis::DataportabilityV1::Empty::Representation
  command.response_class = Google::Apis::DataportabilityV1::Empty
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#retry_archive_job_portability_archive(name, retry_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DataportabilityV1::RetryPortabilityArchiveResponse

Retries a failed Portability Archive job.

Parameters:

  • name (String)

    Required. The Archive job ID you're retrying. This is returned by the InitiatePortabilityArchiveResponse. Retrying is only executed if the initial job failed.

  • retry_portability_archive_request_object (Google::Apis::DataportabilityV1::RetryPortabilityArchiveRequest) (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



177
178
179
180
181
182
183
184
185
186
187
# File 'lib/google/apis/dataportability_v1/service.rb', line 177

def retry_archive_job_portability_archive(name, retry_portability_archive_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:retry', options)
  command.request_representation = Google::Apis::DataportabilityV1::RetryPortabilityArchiveRequest::Representation
  command.request_object = retry_portability_archive_request_object
  command.response_representation = Google::Apis::DataportabilityV1::RetryPortabilityArchiveResponse::Representation
  command.response_class = Google::Apis::DataportabilityV1::RetryPortabilityArchiveResponse
  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