forked from googleapis/google-api-ruby-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.rb
135 lines (116 loc) · 5.19 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AndroidpublisherV1_1
# An InappPurchase resource indicates the status of a user's inapp product
# purchase.
class InappPurchase
include Google::Apis::Core::Hashable
# The consumption state of the inapp product. Possible values are:
# - Yet to be consumed
# - Consumed
# Corresponds to the JSON property `consumptionState`
# @return [Fixnum]
attr_accessor :consumption_state
# A developer-specified string that contains supplemental information about an
# order.
# Corresponds to the JSON property `developerPayload`
# @return [String]
attr_accessor :developer_payload
# This kind represents an inappPurchase object in the androidpublisher service.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The order id associated with the purchase of the inapp product.
# Corresponds to the JSON property `orderId`
# @return [String]
attr_accessor :order_id
# The purchase state of the order. Possible values are:
# - Purchased
# - Canceled
# - Pending
# Corresponds to the JSON property `purchaseState`
# @return [Fixnum]
attr_accessor :purchase_state
# The time the product was purchased, in milliseconds since the epoch (Jan 1,
# 1970).
# Corresponds to the JSON property `purchaseTime`
# @return [Fixnum]
attr_accessor :purchase_time
# The type of purchase of the inapp product. This field is only set if this
# purchase was not made using the standard in-app billing flow. Possible values
# are:
# - Test (i.e. purchased from a license testing account)
# - Promo (i.e. purchased using a promo code)
# - Rewarded (i.e. from watching a video ad instead of paying)
# Corresponds to the JSON property `purchaseType`
# @return [Fixnum]
attr_accessor :purchase_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@consumption_state = args[:consumption_state] if args.key?(:consumption_state)
@developer_payload = args[:developer_payload] if args.key?(:developer_payload)
@kind = args[:kind] if args.key?(:kind)
@order_id = args[:order_id] if args.key?(:order_id)
@purchase_state = args[:purchase_state] if args.key?(:purchase_state)
@purchase_time = args[:purchase_time] if args.key?(:purchase_time)
@purchase_type = args[:purchase_type] if args.key?(:purchase_type)
end
end
# A SubscriptionPurchase resource indicates the status of a user's subscription
# purchase.
class SubscriptionPurchase
include Google::Apis::Core::Hashable
# Whether the subscription will automatically be renewed when it reaches its
# current expiry time.
# Corresponds to the JSON property `autoRenewing`
# @return [Boolean]
attr_accessor :auto_renewing
alias_method :auto_renewing?, :auto_renewing
# Time at which the subscription was granted, in milliseconds since the Epoch.
# Corresponds to the JSON property `initiationTimestampMsec`
# @return [Fixnum]
attr_accessor :initiation_timestamp_msec
# This kind represents a subscriptionPurchase object in the androidpublisher
# service.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Time at which the subscription will expire, in milliseconds since the Epoch.
# Corresponds to the JSON property `validUntilTimestampMsec`
# @return [Fixnum]
attr_accessor :valid_until_timestamp_msec
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@auto_renewing = args[:auto_renewing] if args.key?(:auto_renewing)
@initiation_timestamp_msec = args[:initiation_timestamp_msec] if args.key?(:initiation_timestamp_msec)
@kind = args[:kind] if args.key?(:kind)
@valid_until_timestamp_msec = args[:valid_until_timestamp_msec] if args.key?(:valid_until_timestamp_msec)
end
end
end
end
end