Class: Google::Apis::AndroidpublisherV1::AndroidPublisherService

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

Overview

Google Play Developer API

Lets Android application developers access their Google Play accounts.

Examples:

require 'google/apis/androidpublisher_v1'

Androidpublisher = Google::Apis::AndroidpublisherV1 # Alias the module
service = Androidpublisher::AndroidPublisherService.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

#initializeAndroidPublisherService

Returns a new instance of AndroidPublisherService



51
52
53
54
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'androidpublisher/v1/applications/')
  @batch_path = 'batch/androidpublisher/v1'
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.



38
39
40
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 38

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. Overrides userIp if both are provided.

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. Overrides userIp if both are provided.



44
45
46
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



49
50
51
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#cancel_purchase(package_name, subscription_id, token, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Cancels a user's subscription purchase. The subscription remains valid until its expiration time.

Parameters:

  • package_name (String)

    The package name of the application for which this subscription was purchased ( for example, 'com.some.thing').

  • subscription_id (String)

    The purchased subscription ID (for example, 'monthly001').

  • token (String)

    The token provided to the user's device when the subscription was purchased.

  • 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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:



86
87
88
89
90
91
92
93
94
95
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 86

def cancel_purchase(package_name, subscription_id, token, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel', options)
  command.params['packageName'] = package_name unless package_name.nil?
  command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
  command.params['token'] = token unless token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_purchase(package_name, subscription_id, token, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AndroidpublisherV1::SubscriptionPurchase

Checks whether a user's subscription purchase is valid and returns its expiry time.

Parameters:

  • package_name (String)

    The package name of the application for which this subscription was purchased ( for example, 'com.some.thing').

  • subscription_id (String)

    The purchased subscription ID (for example, 'monthly001').

  • token (String)

    The token provided to the user's device when the subscription was purchased.

  • 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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



127
128
129
130
131
132
133
134
135
136
137
138
# File 'generated/google/apis/androidpublisher_v1/service.rb', line 127

def get_purchase(package_name, subscription_id, token, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{packageName}/subscriptions/{subscriptionId}/purchases/{token}', options)
  command.response_representation = Google::Apis::AndroidpublisherV1::SubscriptionPurchase::Representation
  command.response_class = Google::Apis::AndroidpublisherV1::SubscriptionPurchase
  command.params['packageName'] = package_name unless package_name.nil?
  command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
  command.params['token'] = token unless token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end