bf_ruby2 1.2016.229 → 1.2016.230
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -29
- data/bf_ruby2-1.2016.229.gem +0 -0
- data/docs/AccountsApi.md +82 -31
- data/docs/AddChargeToAccountResponse.md +9 -0
- data/docs/AddChargeToAccountResponsePagedMetadata.md +14 -0
- data/docs/AddChargesToAccountAPIRequest.md +17 -0
- data/docs/AddressesApi.md +4 -4
- data/docs/AmendmentsApi.md +13 -13
- data/docs/AnalyticsApi.md +15 -15
- data/docs/AuditlogsApi.md +5 -5
- data/docs/BatchUpdatePricingComponentValuesRequest.md +9 -0
- data/docs/ChargesApi.md +56 -8
- data/docs/ClientsApi.md +6 -6
- data/docs/ConfigurationsApi.md +6 -6
- data/docs/CouponbookApi.md +11 -11
- data/docs/CouponbookdefinitionApi.md +8 -8
- data/docs/CoupondefinitionApi.md +7 -7
- data/docs/CouponinstanceApi.md +12 -12
- data/docs/CouponmodifierApi.md +9 -9
- data/docs/CouponruleApi.md +6 -6
- data/docs/CouponsApi.md +10 -10
- data/docs/CreateSubscriptionChargeAmendment.md +0 -1
- data/docs/CreateSubscriptionRequest.md +2 -0
- data/docs/CreditnotesApi.md +7 -7
- data/docs/CybersourcetokensApi.md +7 -7
- data/docs/DunninglinesApi.md +8 -8
- data/docs/EmailprovidersApi.md +5 -5
- data/docs/EmailsApi.md +1 -1
- data/docs/EmailsubscriptionsApi.md +7 -7
- data/docs/FixedtermdefinitionsApi.md +4 -4
- data/docs/FixedtermsApi.md +2 -2
- data/docs/Invoice.md +3 -0
- data/docs/InvoicesApi.md +63 -63
- data/docs/MetadataApi.md +6 -6
- data/docs/NestedChargeRequest.md +19 -0
- data/docs/NotificationsApi.md +6 -6
- data/docs/OrganizationsApi.md +9 -9
- data/docs/PasswordsApi.md +2 -2
- data/docs/PaymentmethodsApi.md +10 -10
- data/docs/PaymentmethodsubscriptionlinksApi.md +3 -3
- data/docs/PaymentsApi.md +9 -9
- data/docs/PeriodsApi.md +2 -2
- data/docs/PermissionsApi.md +8 -8
- data/docs/PricingcalculatorApi.md +6 -6
- data/docs/PricingcomponentsApi.md +8 -8
- data/docs/PricingcomponenttiersApi.md +7 -7
- data/docs/PricingcomponentvaluechangesApi.md +7 -7
- data/docs/PricingcomponentvaluesApi.md +7 -7
- data/docs/ProductrateplansApi.md +27 -27
- data/docs/ProductsApi.md +17 -17
- data/docs/ProfilesApi.md +6 -6
- data/docs/QuotesApi.md +2 -2
- data/docs/RecalculateChargeBatchRequest.md +12 -0
- data/docs/RecalculateChargeBatchResponse.md +11 -0
- data/docs/RecalculateChargeBatchResponsePagedMetadata.md +14 -0
- data/docs/ReceiptsApi.md +6 -6
- data/docs/RefundsApi.md +9 -9
- data/docs/RolesApi.md +8 -8
- data/docs/SearchApi.md +1 -1
- data/docs/SingleRecalculateChargeRequest.md +15 -0
- data/docs/Subscription.md +1 -0
- data/docs/SubscriptionsApi.md +153 -102
- data/docs/SynchAppConfigsApi.md +6 -6
- data/docs/SynchConfigsApi.md +8 -8
- data/docs/SynchJobsApi.md +10 -10
- data/docs/TaxationlinksApi.md +8 -8
- data/docs/TaxationstrategiesApi.md +11 -11
- data/docs/TimeApi.md +1 -1
- data/docs/TokenizationApi.md +6 -6
- data/docs/UnitofmeasureApi.md +6 -6
- data/docs/UpdatePricingComponentValueChangeResult.md +19 -0
- data/docs/UpdatePricingComponentValueRequest.md +10 -0
- data/docs/UpdatePricingComponentValueResponse.md +9 -0
- data/docs/UpdatePricingComponentValueResponsePagedMetadata.md +14 -0
- data/docs/UsageApi.md +7 -7
- data/docs/UsageperiodsApi.md +3 -3
- data/docs/UsageroundingstrategiesApi.md +6 -6
- data/docs/UsagesessionsApi.md +6 -6
- data/docs/UsernamesApi.md +2 -2
- data/docs/UsersApi.md +16 -16
- data/docs/VaultedgatewaysApi.md +22 -22
- data/docs/WebhooksApi.md +10 -10
- data/lib/bf_ruby2.rb +13 -0
- data/lib/bf_ruby2/api/accounts_api.rb +92 -31
- data/lib/bf_ruby2/api/addresses_api.rb +4 -4
- data/lib/bf_ruby2/api/amendments_api.rb +13 -13
- data/lib/bf_ruby2/api/analytics_api.rb +15 -15
- data/lib/bf_ruby2/api/auditlogs_api.rb +5 -5
- data/lib/bf_ruby2/api/charges_api.rb +65 -8
- data/lib/bf_ruby2/api/clients_api.rb +6 -6
- data/lib/bf_ruby2/api/configurations_api.rb +6 -6
- data/lib/bf_ruby2/api/couponbook_api.rb +11 -11
- data/lib/bf_ruby2/api/couponbookdefinition_api.rb +8 -8
- data/lib/bf_ruby2/api/coupondefinition_api.rb +7 -7
- data/lib/bf_ruby2/api/couponinstance_api.rb +12 -12
- data/lib/bf_ruby2/api/couponmodifier_api.rb +9 -9
- data/lib/bf_ruby2/api/couponrule_api.rb +6 -6
- data/lib/bf_ruby2/api/coupons_api.rb +10 -10
- data/lib/bf_ruby2/api/creditnotes_api.rb +7 -7
- data/lib/bf_ruby2/api/cybersourcetokens_api.rb +7 -7
- data/lib/bf_ruby2/api/dunninglines_api.rb +8 -8
- data/lib/bf_ruby2/api/emailproviders_api.rb +5 -5
- data/lib/bf_ruby2/api/emails_api.rb +1 -1
- data/lib/bf_ruby2/api/emailsubscriptions_api.rb +7 -7
- data/lib/bf_ruby2/api/fixedtermdefinitions_api.rb +4 -4
- data/lib/bf_ruby2/api/fixedterms_api.rb +2 -2
- data/lib/bf_ruby2/api/invoices_api.rb +63 -63
- data/lib/bf_ruby2/api/metadata_api.rb +6 -6
- data/lib/bf_ruby2/api/notifications_api.rb +6 -6
- data/lib/bf_ruby2/api/organizations_api.rb +9 -9
- data/lib/bf_ruby2/api/passwords_api.rb +2 -2
- data/lib/bf_ruby2/api/paymentmethods_api.rb +10 -10
- data/lib/bf_ruby2/api/paymentmethodsubscriptionlinks_api.rb +3 -3
- data/lib/bf_ruby2/api/payments_api.rb +9 -9
- data/lib/bf_ruby2/api/periods_api.rb +2 -2
- data/lib/bf_ruby2/api/permissions_api.rb +8 -8
- data/lib/bf_ruby2/api/pricingcalculator_api.rb +6 -6
- data/lib/bf_ruby2/api/pricingcomponents_api.rb +8 -8
- data/lib/bf_ruby2/api/pricingcomponenttiers_api.rb +7 -7
- data/lib/bf_ruby2/api/pricingcomponentvaluechanges_api.rb +7 -7
- data/lib/bf_ruby2/api/pricingcomponentvalues_api.rb +7 -7
- data/lib/bf_ruby2/api/productrateplans_api.rb +27 -27
- data/lib/bf_ruby2/api/products_api.rb +17 -17
- data/lib/bf_ruby2/api/profiles_api.rb +6 -6
- data/lib/bf_ruby2/api/quotes_api.rb +2 -2
- data/lib/bf_ruby2/api/receipts_api.rb +6 -6
- data/lib/bf_ruby2/api/refunds_api.rb +9 -9
- data/lib/bf_ruby2/api/roles_api.rb +8 -8
- data/lib/bf_ruby2/api/search_api.rb +1 -1
- data/lib/bf_ruby2/api/subscriptions_api.rb +163 -102
- data/lib/bf_ruby2/api/synch_app_configs_api.rb +6 -6
- data/lib/bf_ruby2/api/synch_configs_api.rb +8 -8
- data/lib/bf_ruby2/api/synch_jobs_api.rb +10 -10
- data/lib/bf_ruby2/api/taxationlinks_api.rb +8 -8
- data/lib/bf_ruby2/api/taxationstrategies_api.rb +11 -11
- data/lib/bf_ruby2/api/time_api.rb +1 -1
- data/lib/bf_ruby2/api/tokenization_api.rb +6 -6
- data/lib/bf_ruby2/api/unitofmeasure_api.rb +6 -6
- data/lib/bf_ruby2/api/usage_api.rb +7 -7
- data/lib/bf_ruby2/api/usageperiods_api.rb +3 -3
- data/lib/bf_ruby2/api/usageroundingstrategies_api.rb +6 -6
- data/lib/bf_ruby2/api/usagesessions_api.rb +6 -6
- data/lib/bf_ruby2/api/usernames_api.rb +2 -2
- data/lib/bf_ruby2/api/users_api.rb +16 -16
- data/lib/bf_ruby2/api/vaultedgateways_api.rb +22 -22
- data/lib/bf_ruby2/api/webhooks_api.rb +10 -10
- data/lib/bf_ruby2/models/add_charge_to_account_response.rb +212 -0
- data/lib/bf_ruby2/models/add_charge_to_account_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/add_charges_to_account_api_request.rb +337 -0
- data/lib/bf_ruby2/models/batch_update_pricing_component_values_request.rb +244 -0
- data/lib/bf_ruby2/models/create_subscription_charge_amendment.rb +1 -24
- data/lib/bf_ruby2/models/create_subscription_request.rb +24 -4
- data/lib/bf_ruby2/models/invoice.rb +32 -1
- data/lib/bf_ruby2/models/nested_charge_request.rb +343 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_request.rb +279 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_response.rb +234 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/single_recalculate_charge_request.rb +317 -0
- data/lib/bf_ruby2/models/subscription.rb +11 -1
- data/lib/bf_ruby2/models/update_pricing_component_value_change_result.rb +367 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_request.rb +253 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_response.rb +210 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/version.rb +1 -1
- data/spec/models/add_charge_to_account_response_paged_metadata_spec.rb +89 -0
- data/spec/models/add_charge_to_account_response_spec.rb +59 -0
- data/spec/models/add_charges_to_account_api_request_spec.rb +115 -0
- data/spec/models/batch_update_pricing_component_values_request_spec.rb +63 -0
- data/spec/models/nested_charge_request_spec.rb +123 -0
- data/spec/models/recalculate_charge_batch_request_spec.rb +81 -0
- data/spec/models/recalculate_charge_batch_response_paged_metadata_spec.rb +89 -0
- data/spec/models/recalculate_charge_batch_response_spec.rb +71 -0
- data/spec/models/single_recalculate_charge_request_spec.rb +103 -0
- data/spec/models/update_pricing_component_value_change_result_spec.rb +131 -0
- data/spec/models/update_pricing_component_value_request_spec.rb +69 -0
- data/spec/models/update_pricing_component_value_response_paged_metadata_spec.rb +89 -0
- data/spec/models/update_pricing_component_value_response_spec.rb +59 -0
- metadata +54 -2
- data/setup.scratch.rb +0 -33
@@ -0,0 +1,210 @@
|
|
1
|
+
=begin
|
2
|
+
#BillForward REST API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module BillForward
|
27
|
+
# UpdatePricingComponentValueResponse
|
28
|
+
class UpdatePricingComponentValueResponse
|
29
|
+
# A list of update value requests
|
30
|
+
attr_accessor :changes
|
31
|
+
|
32
|
+
# If an invoice has been generated this field will contain it. If this field has a NULL value it means no invoice has been created.
|
33
|
+
attr_accessor :invoice
|
34
|
+
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
:'changes' => :'changes',
|
40
|
+
:'invoice' => :'invoice'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'changes' => :'UpdatePricingComponentValueChangeResult',
|
48
|
+
:'invoice' => :'Invoice'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
return unless attributes.is_a?(Hash)
|
56
|
+
|
57
|
+
# convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
59
|
+
|
60
|
+
if attributes.has_key?(:'changes')
|
61
|
+
self.changes = attributes[:'changes']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'invoice')
|
65
|
+
self.invoice = attributes[:'invoice']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properies with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
changes == o.changes &&
|
89
|
+
invoice == o.invoice
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
100
|
+
def hash
|
101
|
+
[changes, invoice].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
if type =~ /^Array<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :DateTime
|
131
|
+
DateTime.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :BOOLEAN
|
141
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
temp_model = BillForward.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map{ |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|
@@ -0,0 +1,269 @@
|
|
1
|
+
=begin
|
2
|
+
#BillForward REST API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module BillForward
|
27
|
+
|
28
|
+
class UpdatePricingComponentValueResponsePagedMetadata
|
29
|
+
# {\"description\":\"Paging parameter. URL fragment that can be used to fetch next page of results.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
30
|
+
attr_accessor :next_page
|
31
|
+
|
32
|
+
# {\"description\":\"Paging parameter. 0-indexed. Describes which page (given a page size of `recordsRequested`) of the result set you are viewing.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
33
|
+
attr_accessor :current_page
|
34
|
+
|
35
|
+
# {\"description\":\"Paging parameter. 0-indexed. Describes your current location within a pageable list of query results.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
36
|
+
attr_accessor :current_offset
|
37
|
+
|
38
|
+
# {\"default\":10,\"description\":\"Paging parameter. Describes how many records you requested.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
39
|
+
attr_accessor :records_requested
|
40
|
+
|
41
|
+
# {\"description\":\"Describes how many records were returned by your query.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
42
|
+
attr_accessor :records_returned
|
43
|
+
|
44
|
+
# {\"description\":\"Number of milliseconds taken by API to calculate response.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
45
|
+
attr_accessor :execution_time
|
46
|
+
|
47
|
+
# {\"description\":\"The results returned by your query.\",\"verbs\":[\"GET\",\"PUT\",\"POST\"]}
|
48
|
+
attr_accessor :results
|
49
|
+
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'next_page' => :'nextPage',
|
55
|
+
:'current_page' => :'currentPage',
|
56
|
+
:'current_offset' => :'currentOffset',
|
57
|
+
:'records_requested' => :'recordsRequested',
|
58
|
+
:'records_returned' => :'recordsReturned',
|
59
|
+
:'execution_time' => :'executionTime',
|
60
|
+
:'results' => :'results'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.swagger_types
|
66
|
+
{
|
67
|
+
:'next_page' => :'String',
|
68
|
+
:'current_page' => :'Integer',
|
69
|
+
:'current_offset' => :'Integer',
|
70
|
+
:'records_requested' => :'Integer',
|
71
|
+
:'records_returned' => :'Integer',
|
72
|
+
:'execution_time' => :'Integer',
|
73
|
+
:'results' => :'Array<UpdatePricingComponentValueResponse>'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Initializes the object
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
79
|
+
def initialize(attributes = {})
|
80
|
+
return unless attributes.is_a?(Hash)
|
81
|
+
|
82
|
+
# convert string to symbol for hash key
|
83
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
84
|
+
|
85
|
+
if attributes.has_key?(:'nextPage')
|
86
|
+
self.next_page = attributes[:'nextPage']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'currentPage')
|
90
|
+
self.current_page = attributes[:'currentPage']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.has_key?(:'currentOffset')
|
94
|
+
self.current_offset = attributes[:'currentOffset']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'recordsRequested')
|
98
|
+
self.records_requested = attributes[:'recordsRequested']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'recordsReturned')
|
102
|
+
self.records_returned = attributes[:'recordsReturned']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'executionTime')
|
106
|
+
self.execution_time = attributes[:'executionTime']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'results')
|
110
|
+
if (value = attributes[:'results']).is_a?(Array)
|
111
|
+
self.results = value
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
118
|
+
# @return Array for valid properies with the reasons
|
119
|
+
def list_invalid_properties
|
120
|
+
invalid_properties = Array.new
|
121
|
+
return invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @next_page.nil?
|
128
|
+
return false if @current_page.nil?
|
129
|
+
return false if @current_offset.nil?
|
130
|
+
return false if @records_requested.nil?
|
131
|
+
return false if @records_returned.nil?
|
132
|
+
return false if @execution_time.nil?
|
133
|
+
return false if @results.nil?
|
134
|
+
return true
|
135
|
+
end
|
136
|
+
|
137
|
+
# Checks equality by comparing each attribute.
|
138
|
+
# @param [Object] Object to be compared
|
139
|
+
def ==(o)
|
140
|
+
return true if self.equal?(o)
|
141
|
+
self.class == o.class &&
|
142
|
+
next_page == o.next_page &&
|
143
|
+
current_page == o.current_page &&
|
144
|
+
current_offset == o.current_offset &&
|
145
|
+
records_requested == o.records_requested &&
|
146
|
+
records_returned == o.records_returned &&
|
147
|
+
execution_time == o.execution_time &&
|
148
|
+
results == o.results
|
149
|
+
end
|
150
|
+
|
151
|
+
# @see the `==` method
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
155
|
+
end
|
156
|
+
|
157
|
+
# Calculates hash code according to all attributes.
|
158
|
+
# @return [Fixnum] Hash code
|
159
|
+
def hash
|
160
|
+
[next_page, current_page, current_offset, records_requested, records_returned, execution_time, results].hash
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def build_from_hash(attributes)
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
168
|
+
self.class.swagger_types.each_pair do |key, type|
|
169
|
+
if type =~ /^Array<(.*)>/i
|
170
|
+
# check to ensure the input is an array given that the the attribute
|
171
|
+
# is documented as an array but the input is not
|
172
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
174
|
+
end
|
175
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
177
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
178
|
+
end
|
179
|
+
|
180
|
+
self
|
181
|
+
end
|
182
|
+
|
183
|
+
# Deserializes the data based on type
|
184
|
+
# @param string type Data type
|
185
|
+
# @param string value Value to be deserialized
|
186
|
+
# @return [Object] Deserialized data
|
187
|
+
def _deserialize(type, value)
|
188
|
+
case type.to_sym
|
189
|
+
when :DateTime
|
190
|
+
DateTime.parse(value)
|
191
|
+
when :Date
|
192
|
+
Date.parse(value)
|
193
|
+
when :String
|
194
|
+
value.to_s
|
195
|
+
when :Integer
|
196
|
+
value.to_i
|
197
|
+
when :Float
|
198
|
+
value.to_f
|
199
|
+
when :BOOLEAN
|
200
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
201
|
+
true
|
202
|
+
else
|
203
|
+
false
|
204
|
+
end
|
205
|
+
when :Object
|
206
|
+
# generic object (usually a Hash), return directly
|
207
|
+
value
|
208
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
209
|
+
inner_type = Regexp.last_match[:inner_type]
|
210
|
+
value.map { |v| _deserialize(inner_type, v) }
|
211
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
212
|
+
k_type = Regexp.last_match[:k_type]
|
213
|
+
v_type = Regexp.last_match[:v_type]
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each do |k, v|
|
216
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else # model
|
220
|
+
temp_model = BillForward.const_get(type).new
|
221
|
+
temp_model.build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
next if value.nil?
|
244
|
+
hash[param] = _to_hash(value)
|
245
|
+
end
|
246
|
+
hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Outputs non-array value in the form of hash
|
250
|
+
# For object, use to_hash. Otherwise, just return the value
|
251
|
+
# @param [Object] value Any valid value
|
252
|
+
# @return [Hash] Returns the value in the form of hash
|
253
|
+
def _to_hash(value)
|
254
|
+
if value.is_a?(Array)
|
255
|
+
value.compact.map{ |v| _to_hash(v) }
|
256
|
+
elsif value.is_a?(Hash)
|
257
|
+
{}.tap do |hash|
|
258
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
259
|
+
end
|
260
|
+
elsif value.respond_to? :to_hash
|
261
|
+
value.to_hash
|
262
|
+
else
|
263
|
+
value
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|