Class: Google::Apis::PlayintegrityV1::PlayIntegrityService

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

Overview

Google Play Integrity API

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

Examples:

require 'google/apis/playintegrity_v1'

Playintegrity = Google::Apis::PlayintegrityV1 # Alias the module
service = Playintegrity::PlayIntegrityService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayIntegrityService

Returns a new instance of PlayIntegrityService.



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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-playintegrity_v1',
        client_version: Google::Apis::PlayintegrityV1::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/playintegrity_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/playintegrity_v1/service.rb', line 48

def quota_user
  @quota_user
end

Instance Method Details

#decode_integrity_token(package_name, decode_integrity_token_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlayintegrityV1::DecodeIntegrityTokenResponse

Decodes the integrity token and returns the token payload.

Parameters:

  • package_name (String)

    Package name of the app the attached integrity token belongs to.

  • decode_integrity_token_request_object (Google::Apis::PlayintegrityV1::DecodeIntegrityTokenRequest) (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



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/google/apis/playintegrity_v1/service.rb', line 113

def decode_integrity_token(package_name, decode_integrity_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+packageName}:decodeIntegrityToken', options)
  command.request_representation = Google::Apis::PlayintegrityV1::DecodeIntegrityTokenRequest::Representation
  command.request_object = decode_integrity_token_request_object
  command.response_representation = Google::Apis::PlayintegrityV1::DecodeIntegrityTokenResponse::Representation
  command.response_class = Google::Apis::PlayintegrityV1::DecodeIntegrityTokenResponse
  command.params['packageName'] = package_name unless package_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

#write_device_recall(package_name, write_device_recall_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlayintegrityV1::WriteDeviceRecallResponse

Writes recall bits for the device where Play Integrity API token is obtained. The endpoint is available to select Play partners in an early access program ( EAP).

Parameters:

  • package_name (String)

    Required. Package name of the app the attached integrity token belongs to.

  • write_device_recall_request_object (Google::Apis::PlayintegrityV1::WriteDeviceRecallRequest) (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



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

def write_device_recall(package_name, write_device_recall_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+packageName}/deviceRecall:write', options)
  command.request_representation = Google::Apis::PlayintegrityV1::WriteDeviceRecallRequest::Representation
  command.request_object = write_device_recall_request_object
  command.response_representation = Google::Apis::PlayintegrityV1::WriteDeviceRecallResponse::Representation
  command.response_class = Google::Apis::PlayintegrityV1::WriteDeviceRecallResponse
  command.params['packageName'] = package_name unless package_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