flowcommerce 0.0.88 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +463 -144
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dff6b4af897fb53665eaa50b51565c457526e8e
|
4
|
+
data.tar.gz: 618b252e53f31651d1845b44e015787183d419ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c10b96a306147fb8bb2361ba57d05633042e0743ab38c0ad5bae8bc08609d0aa5bf3cfce2f8fad6102acb2c3988398720f457a36b69bf7bbfe714218b9fa884
|
7
|
+
data.tar.gz: 2add23e2c4dfc9fc04078ddcd9c1b730d3226864d71cc58fc2482a1e236df5c55d65566317bec17c8f4485057f3113b1ba3e1436d7e5da18d829522c78152f62
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.
|
3
|
+
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.0/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,7 +25,7 @@ module Io
|
|
25
25
|
|
26
26
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
27
27
|
NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
|
28
|
-
USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.
|
28
|
+
USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.0/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.77' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -3666,7 +3666,7 @@ module Io
|
|
3666
3666
|
|
3667
3667
|
# Get all tokens that you are authorized to view. Note that the cleartext
|
3668
3668
|
# token value is never sent. To view the API token itself, see the resource
|
3669
|
-
# path /:id/cleartext
|
3669
|
+
# path /tokens/:id/cleartext
|
3670
3670
|
def get(incoming={})
|
3671
3671
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3672
3672
|
query = {
|
@@ -3677,21 +3677,21 @@ module Io
|
|
3677
3677
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
3678
3678
|
}.delete_if { |k, v| v.nil? }
|
3679
3679
|
r = @client.request("/tokens").with_query(query).get
|
3680
|
-
r.map { |x| ::Io::Flow::V0::Models::Token.
|
3680
|
+
r.map { |x| ::Io::Flow::V0::Models::Token.from_json(x) }
|
3681
3681
|
end
|
3682
3682
|
|
3683
3683
|
# Create a new token for the requesting user
|
3684
3684
|
def post(token_form)
|
3685
3685
|
HttpClient::Preconditions.assert_class('token_form', token_form, ::Io::Flow::V0::Models::TokenForm)
|
3686
3686
|
r = @client.request("/tokens").with_json(token_form.to_json).post
|
3687
|
-
::Io::Flow::V0::Models::Token.
|
3687
|
+
::Io::Flow::V0::Models::Token.from_json(r)
|
3688
3688
|
end
|
3689
3689
|
|
3690
3690
|
# Get metadata for the token with this ID
|
3691
3691
|
def get_by_id(id)
|
3692
3692
|
HttpClient::Preconditions.assert_class('id', id, String)
|
3693
3693
|
r = @client.request("/tokens/#{CGI.escape(id)}").get
|
3694
|
-
::Io::Flow::V0::Models::Token.
|
3694
|
+
::Io::Flow::V0::Models::Token.from_json(r)
|
3695
3695
|
end
|
3696
3696
|
|
3697
3697
|
def delete_by_id(id)
|
@@ -3707,27 +3707,36 @@ module Io
|
|
3707
3707
|
::Io::Flow::V0::Models::Cleartext.new(r)
|
3708
3708
|
end
|
3709
3709
|
|
3710
|
-
# Preferred method to validate a token, obtaining
|
3710
|
+
# Preferred method to validate a token, obtaining specific information if the
|
3711
3711
|
# token is valid (or a 404 if the token does not exist). We use an HTTP POST
|
3712
3712
|
# with a form body to enusre that the token itself is not logged in the
|
3713
3713
|
# request logs.
|
3714
3714
|
def post_authentications(token_authentication_form)
|
3715
3715
|
HttpClient::Preconditions.assert_class('token_authentication_form', token_authentication_form, ::Io::Flow::V0::Models::TokenAuthenticationForm)
|
3716
3716
|
r = @client.request("/tokens/authentications").with_json(token_authentication_form.to_json).post
|
3717
|
-
::Io::Flow::V0::Models::
|
3717
|
+
::Io::Flow::V0::Models::LegacyTokenReference.new(r)
|
3718
3718
|
end
|
3719
3719
|
|
3720
|
-
|
3721
|
-
|
3722
|
-
|
3723
|
-
|
3724
|
-
|
3725
|
-
|
3726
|
-
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3730
|
-
|
3720
|
+
# Preferred method to validate a token if valid for a given partner, obtaining
|
3721
|
+
# specific information if the token is valid (or a 404 if the token does not
|
3722
|
+
# exist). We use an HTTP POST with a form body to enusre that the token itself
|
3723
|
+
# is not logged in the request logs.
|
3724
|
+
def post_authentications_and_organizations_by_organization(organization, token_authentication_form)
|
3725
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3726
|
+
HttpClient::Preconditions.assert_class('token_authentication_form', token_authentication_form, ::Io::Flow::V0::Models::TokenAuthenticationForm)
|
3727
|
+
r = @client.request("/tokens/authentications/organizations/#{CGI.escape(organization)}").with_json(token_authentication_form.to_json).post
|
3728
|
+
::Io::Flow::V0::Models::OrganizationTokenReference.new(r)
|
3729
|
+
end
|
3730
|
+
|
3731
|
+
# Preferred method to validate a token if valid for a given partner, obtaining
|
3732
|
+
# specific information if the token is valid (or a 404 if the token does not
|
3733
|
+
# exist). We use an HTTP POST with a form body to enusre that the token itself
|
3734
|
+
# is not logged in the request logs.
|
3735
|
+
def post_authentications_and_partners_by_partner(partner, token_authentication_form)
|
3736
|
+
HttpClient::Preconditions.assert_class('partner', partner, String)
|
3737
|
+
HttpClient::Preconditions.assert_class('token_authentication_form', token_authentication_form, ::Io::Flow::V0::Models::TokenAuthenticationForm)
|
3738
|
+
r = @client.request("/tokens/authentications/partners/#{CGI.escape(partner)}").with_json(token_authentication_form.to_json).post
|
3739
|
+
::Io::Flow::V0::Models::PartnerTokenReference.new(r)
|
3731
3740
|
end
|
3732
3741
|
|
3733
3742
|
end
|
@@ -4809,6 +4818,130 @@ module Io
|
|
4809
4818
|
|
4810
4819
|
end
|
4811
4820
|
|
4821
|
+
class Token
|
4822
|
+
|
4823
|
+
module Types
|
4824
|
+
LEGACY_TOKEN = 'legacy_token' unless defined?(LEGACY_TOKEN)
|
4825
|
+
ORGANIZATION_TOKEN = 'organization_token' unless defined?(ORGANIZATION_TOKEN)
|
4826
|
+
PARTNER_TOKEN = 'partner_token' unless defined?(PARTNER_TOKEN)
|
4827
|
+
end
|
4828
|
+
|
4829
|
+
def initialize(incoming={})
|
4830
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4831
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'Token')
|
4832
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4833
|
+
end
|
4834
|
+
|
4835
|
+
def subtype_to_hash
|
4836
|
+
raise 'Cannot serialize an instance of token directly - must use one of the specific types: legacy_token, organization_token, partner_token'
|
4837
|
+
end
|
4838
|
+
|
4839
|
+
def to_hash
|
4840
|
+
subtype_to_hash.merge(:discriminator => @name)
|
4841
|
+
end
|
4842
|
+
|
4843
|
+
def Token.from_json(hash)
|
4844
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
4845
|
+
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
4846
|
+
if discriminator.empty?
|
4847
|
+
raise "Union type[token] requires a field named 'discriminator'"
|
4848
|
+
end
|
4849
|
+
case discriminator
|
4850
|
+
when Types::LEGACY_TOKEN; LegacyToken.new(hash)
|
4851
|
+
when Types::ORGANIZATION_TOKEN; OrganizationToken.new(hash)
|
4852
|
+
when Types::PARTNER_TOKEN; PartnerToken.new(hash)
|
4853
|
+
else TokenUndefinedType.new(:name => discriminator)
|
4854
|
+
end
|
4855
|
+
end
|
4856
|
+
|
4857
|
+
end
|
4858
|
+
|
4859
|
+
class TokenUndefinedType < Token
|
4860
|
+
|
4861
|
+
attr_reader :name
|
4862
|
+
|
4863
|
+
def initialize(incoming={})
|
4864
|
+
super(:name => 'undefined_type')
|
4865
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4866
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4867
|
+
end
|
4868
|
+
|
4869
|
+
def subtype_to_hash
|
4870
|
+
raise 'Unable to serialize undefined type to json'
|
4871
|
+
end
|
4872
|
+
|
4873
|
+
def copy(incoming={})
|
4874
|
+
raise 'Operation not supported for undefined type'
|
4875
|
+
end
|
4876
|
+
|
4877
|
+
def to_hash
|
4878
|
+
raise 'Operation not supported for undefined type'
|
4879
|
+
end
|
4880
|
+
|
4881
|
+
end
|
4882
|
+
|
4883
|
+
class TokenForm
|
4884
|
+
|
4885
|
+
module Types
|
4886
|
+
LEGACY_TOKEN_FORM = 'legacy_token_form' unless defined?(LEGACY_TOKEN_FORM)
|
4887
|
+
ORGANIZATION_TOKEN_FORM = 'organization_token_form' unless defined?(ORGANIZATION_TOKEN_FORM)
|
4888
|
+
PARTNER_TOKEN_FORM = 'partner_token_form' unless defined?(PARTNER_TOKEN_FORM)
|
4889
|
+
end
|
4890
|
+
|
4891
|
+
def initialize(incoming={})
|
4892
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4893
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'TokenForm')
|
4894
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4895
|
+
end
|
4896
|
+
|
4897
|
+
def subtype_to_hash
|
4898
|
+
raise 'Cannot serialize an instance of token_form directly - must use one of the specific types: legacy_token_form, organization_token_form, partner_token_form'
|
4899
|
+
end
|
4900
|
+
|
4901
|
+
def to_hash
|
4902
|
+
subtype_to_hash.merge(:discriminator => @name)
|
4903
|
+
end
|
4904
|
+
|
4905
|
+
def TokenForm.from_json(hash)
|
4906
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
4907
|
+
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
4908
|
+
if discriminator.empty?
|
4909
|
+
raise "Union type[token_form] requires a field named 'discriminator'"
|
4910
|
+
end
|
4911
|
+
case discriminator
|
4912
|
+
when Types::LEGACY_TOKEN_FORM; LegacyTokenForm.new(hash)
|
4913
|
+
when Types::ORGANIZATION_TOKEN_FORM; OrganizationTokenForm.new(hash)
|
4914
|
+
when Types::PARTNER_TOKEN_FORM; PartnerTokenForm.new(hash)
|
4915
|
+
else TokenFormUndefinedType.new(:name => discriminator)
|
4916
|
+
end
|
4917
|
+
end
|
4918
|
+
|
4919
|
+
end
|
4920
|
+
|
4921
|
+
class TokenFormUndefinedType < TokenForm
|
4922
|
+
|
4923
|
+
attr_reader :name
|
4924
|
+
|
4925
|
+
def initialize(incoming={})
|
4926
|
+
super(:name => 'undefined_type')
|
4927
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4928
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4929
|
+
end
|
4930
|
+
|
4931
|
+
def subtype_to_hash
|
4932
|
+
raise 'Unable to serialize undefined type to json'
|
4933
|
+
end
|
4934
|
+
|
4935
|
+
def copy(incoming={})
|
4936
|
+
raise 'Operation not supported for undefined type'
|
4937
|
+
end
|
4938
|
+
|
4939
|
+
def to_hash
|
4940
|
+
raise 'Operation not supported for undefined type'
|
4941
|
+
end
|
4942
|
+
|
4943
|
+
end
|
4944
|
+
|
4812
4945
|
class AdjustmentReasonKey
|
4813
4946
|
|
4814
4947
|
attr_reader :value
|
@@ -5215,13 +5348,21 @@ module Io
|
|
5215
5348
|
end
|
5216
5349
|
|
5217
5350
|
def CardType.ALL
|
5218
|
-
@@all ||= [CardType.american_express, CardType.china_union_pay, CardType.dankort, CardType.diners_club, CardType.discover, CardType.jcb, CardType.maestro, CardType.mastercard, CardType.visa]
|
5351
|
+
@@all ||= [CardType.american_express, CardType.ban_contact, CardType.cartes_bancaires, CardType.china_union_pay, CardType.dankort, CardType.diners_club, CardType.discover, CardType.jcb, CardType.maestro, CardType.mastercard, CardType.visa]
|
5219
5352
|
end
|
5220
5353
|
|
5221
5354
|
def CardType.american_express
|
5222
5355
|
@@_american_express ||= CardType.new('american_express')
|
5223
5356
|
end
|
5224
5357
|
|
5358
|
+
def CardType.ban_contact
|
5359
|
+
@@_ban_contact ||= CardType.new('ban_contact')
|
5360
|
+
end
|
5361
|
+
|
5362
|
+
def CardType.cartes_bancaires
|
5363
|
+
@@_cartes_bancaires ||= CardType.new('cartes_bancaires')
|
5364
|
+
end
|
5365
|
+
|
5225
5366
|
def CardType.china_union_pay
|
5226
5367
|
@@_china_union_pay ||= CardType.new('china_union_pay')
|
5227
5368
|
end
|
@@ -13036,6 +13177,97 @@ module Io
|
|
13036
13177
|
|
13037
13178
|
end
|
13038
13179
|
|
13180
|
+
# All of the metadata associated with a given token.
|
13181
|
+
class LegacyToken < Token
|
13182
|
+
|
13183
|
+
attr_reader :id, :user, :partial, :created_at, :description
|
13184
|
+
|
13185
|
+
def initialize(incoming={})
|
13186
|
+
super(:name => Token::Types::LEGACY_TOKEN)
|
13187
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13188
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :user, :partial, :created_at], 'LegacyToken')
|
13189
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13190
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
13191
|
+
@partial = HttpClient::Preconditions.assert_class('partial', opts.delete(:partial), String)
|
13192
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
13193
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
13194
|
+
end
|
13195
|
+
|
13196
|
+
def to_json
|
13197
|
+
JSON.dump(to_hash)
|
13198
|
+
end
|
13199
|
+
|
13200
|
+
def copy(incoming={})
|
13201
|
+
LegacyToken.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13202
|
+
end
|
13203
|
+
|
13204
|
+
def subtype_to_hash
|
13205
|
+
{
|
13206
|
+
:id => id,
|
13207
|
+
:user => user.to_hash,
|
13208
|
+
:partial => partial,
|
13209
|
+
:created_at => created_at,
|
13210
|
+
:description => description
|
13211
|
+
}
|
13212
|
+
end
|
13213
|
+
|
13214
|
+
end
|
13215
|
+
|
13216
|
+
class LegacyTokenForm < TokenForm
|
13217
|
+
|
13218
|
+
attr_reader :description
|
13219
|
+
|
13220
|
+
def initialize(incoming={})
|
13221
|
+
super(:name => TokenForm::Types::LEGACY_TOKEN_FORM)
|
13222
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13223
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
13224
|
+
end
|
13225
|
+
|
13226
|
+
def to_json
|
13227
|
+
JSON.dump(to_hash)
|
13228
|
+
end
|
13229
|
+
|
13230
|
+
def copy(incoming={})
|
13231
|
+
LegacyTokenForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13232
|
+
end
|
13233
|
+
|
13234
|
+
def subtype_to_hash
|
13235
|
+
{
|
13236
|
+
:description => description
|
13237
|
+
}
|
13238
|
+
end
|
13239
|
+
|
13240
|
+
end
|
13241
|
+
|
13242
|
+
# Summary data for a given token
|
13243
|
+
class LegacyTokenReference
|
13244
|
+
|
13245
|
+
attr_reader :id, :user
|
13246
|
+
|
13247
|
+
def initialize(incoming={})
|
13248
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13249
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :user], 'LegacyTokenReference')
|
13250
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13251
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
13252
|
+
end
|
13253
|
+
|
13254
|
+
def to_json
|
13255
|
+
JSON.dump(to_hash)
|
13256
|
+
end
|
13257
|
+
|
13258
|
+
def copy(incoming={})
|
13259
|
+
LegacyTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13260
|
+
end
|
13261
|
+
|
13262
|
+
def to_hash
|
13263
|
+
{
|
13264
|
+
:id => id,
|
13265
|
+
:user => user.to_hash
|
13266
|
+
}
|
13267
|
+
end
|
13268
|
+
|
13269
|
+
end
|
13270
|
+
|
13039
13271
|
# Line items represent the items a consumer is purchasing, including additional
|
13040
13272
|
# information to complete the transaction. Note that you may pass in as many
|
13041
13273
|
# line items as you like - including repeating item numbers across line items.
|
@@ -14873,6 +15105,110 @@ module Io
|
|
14873
15105
|
|
14874
15106
|
end
|
14875
15107
|
|
15108
|
+
# All of the metadata associated with a given token.
|
15109
|
+
class OrganizationToken < Token
|
15110
|
+
|
15111
|
+
attr_reader :id, :organization, :user, :environment, :partial, :created_at, :description
|
15112
|
+
|
15113
|
+
def initialize(incoming={})
|
15114
|
+
super(:name => Token::Types::ORGANIZATION_TOKEN)
|
15115
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15116
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :organization, :user, :environment, :partial, :created_at], 'OrganizationToken')
|
15117
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
15118
|
+
@organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x))
|
15119
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
15120
|
+
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
15121
|
+
@partial = HttpClient::Preconditions.assert_class('partial', opts.delete(:partial), String)
|
15122
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
15123
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
15124
|
+
end
|
15125
|
+
|
15126
|
+
def to_json
|
15127
|
+
JSON.dump(to_hash)
|
15128
|
+
end
|
15129
|
+
|
15130
|
+
def copy(incoming={})
|
15131
|
+
OrganizationToken.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15132
|
+
end
|
15133
|
+
|
15134
|
+
def subtype_to_hash
|
15135
|
+
{
|
15136
|
+
:id => id,
|
15137
|
+
:organization => organization.to_hash,
|
15138
|
+
:user => user.to_hash,
|
15139
|
+
:environment => environment.value,
|
15140
|
+
:partial => partial,
|
15141
|
+
:created_at => created_at,
|
15142
|
+
:description => description
|
15143
|
+
}
|
15144
|
+
end
|
15145
|
+
|
15146
|
+
end
|
15147
|
+
|
15148
|
+
# Used to create a new token. User making the request must be authorized to
|
15149
|
+
# create a token for this organization.
|
15150
|
+
class OrganizationTokenForm < TokenForm
|
15151
|
+
|
15152
|
+
attr_reader :organization, :environment, :description
|
15153
|
+
|
15154
|
+
def initialize(incoming={})
|
15155
|
+
super(:name => TokenForm::Types::ORGANIZATION_TOKEN_FORM)
|
15156
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15157
|
+
HttpClient::Preconditions.require_keys(opts, [:organization, :environment], 'OrganizationTokenForm')
|
15158
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
15159
|
+
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
15160
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
15161
|
+
end
|
15162
|
+
|
15163
|
+
def to_json
|
15164
|
+
JSON.dump(to_hash)
|
15165
|
+
end
|
15166
|
+
|
15167
|
+
def copy(incoming={})
|
15168
|
+
OrganizationTokenForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15169
|
+
end
|
15170
|
+
|
15171
|
+
def subtype_to_hash
|
15172
|
+
{
|
15173
|
+
:organization => organization,
|
15174
|
+
:environment => environment.value,
|
15175
|
+
:description => description
|
15176
|
+
}
|
15177
|
+
end
|
15178
|
+
|
15179
|
+
end
|
15180
|
+
|
15181
|
+
# Summary data for a given token
|
15182
|
+
class OrganizationTokenReference
|
15183
|
+
|
15184
|
+
attr_reader :id, :organization, :user
|
15185
|
+
|
15186
|
+
def initialize(incoming={})
|
15187
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15188
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :organization, :user], 'OrganizationTokenReference')
|
15189
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
15190
|
+
@organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x))
|
15191
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
15192
|
+
end
|
15193
|
+
|
15194
|
+
def to_json
|
15195
|
+
JSON.dump(to_hash)
|
15196
|
+
end
|
15197
|
+
|
15198
|
+
def copy(incoming={})
|
15199
|
+
OrganizationTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15200
|
+
end
|
15201
|
+
|
15202
|
+
def to_hash
|
15203
|
+
{
|
15204
|
+
:id => id,
|
15205
|
+
:organization => organization.to_hash,
|
15206
|
+
:user => user.to_hash
|
15207
|
+
}
|
15208
|
+
end
|
15209
|
+
|
15210
|
+
end
|
15211
|
+
|
14876
15212
|
class OrganizationUpserted < Event
|
14877
15213
|
|
14878
15214
|
attr_reader :event_id, :timestamp, :id, :name, :environment, :currencies, :parent_id
|
@@ -14975,6 +15311,110 @@ module Io
|
|
14975
15311
|
|
14976
15312
|
end
|
14977
15313
|
|
15314
|
+
# All of the metadata associated with a given token.
|
15315
|
+
class PartnerToken < Token
|
15316
|
+
|
15317
|
+
attr_reader :id, :partner, :user, :environment, :partial, :created_at, :description
|
15318
|
+
|
15319
|
+
def initialize(incoming={})
|
15320
|
+
super(:name => Token::Types::PARTNER_TOKEN)
|
15321
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15322
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :partner, :user, :environment, :partial, :created_at], 'PartnerToken')
|
15323
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
15324
|
+
@partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
|
15325
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
15326
|
+
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
15327
|
+
@partial = HttpClient::Preconditions.assert_class('partial', opts.delete(:partial), String)
|
15328
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
15329
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
15330
|
+
end
|
15331
|
+
|
15332
|
+
def to_json
|
15333
|
+
JSON.dump(to_hash)
|
15334
|
+
end
|
15335
|
+
|
15336
|
+
def copy(incoming={})
|
15337
|
+
PartnerToken.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15338
|
+
end
|
15339
|
+
|
15340
|
+
def subtype_to_hash
|
15341
|
+
{
|
15342
|
+
:id => id,
|
15343
|
+
:partner => partner,
|
15344
|
+
:user => user.to_hash,
|
15345
|
+
:environment => environment.value,
|
15346
|
+
:partial => partial,
|
15347
|
+
:created_at => created_at,
|
15348
|
+
:description => description
|
15349
|
+
}
|
15350
|
+
end
|
15351
|
+
|
15352
|
+
end
|
15353
|
+
|
15354
|
+
# Used to create a new token. User making the request must be authorized to
|
15355
|
+
# create a token for this partner.
|
15356
|
+
class PartnerTokenForm < TokenForm
|
15357
|
+
|
15358
|
+
attr_reader :partner, :environment, :description
|
15359
|
+
|
15360
|
+
def initialize(incoming={})
|
15361
|
+
super(:name => TokenForm::Types::PARTNER_TOKEN_FORM)
|
15362
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15363
|
+
HttpClient::Preconditions.require_keys(opts, [:partner, :environment], 'PartnerTokenForm')
|
15364
|
+
@partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
|
15365
|
+
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
15366
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
15367
|
+
end
|
15368
|
+
|
15369
|
+
def to_json
|
15370
|
+
JSON.dump(to_hash)
|
15371
|
+
end
|
15372
|
+
|
15373
|
+
def copy(incoming={})
|
15374
|
+
PartnerTokenForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15375
|
+
end
|
15376
|
+
|
15377
|
+
def subtype_to_hash
|
15378
|
+
{
|
15379
|
+
:partner => partner,
|
15380
|
+
:environment => environment.value,
|
15381
|
+
:description => description
|
15382
|
+
}
|
15383
|
+
end
|
15384
|
+
|
15385
|
+
end
|
15386
|
+
|
15387
|
+
# Summary data for a given token
|
15388
|
+
class PartnerTokenReference
|
15389
|
+
|
15390
|
+
attr_reader :id, :partner, :user
|
15391
|
+
|
15392
|
+
def initialize(incoming={})
|
15393
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15394
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :partner, :user], 'PartnerTokenReference')
|
15395
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
15396
|
+
@partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
|
15397
|
+
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
15398
|
+
end
|
15399
|
+
|
15400
|
+
def to_json
|
15401
|
+
JSON.dump(to_hash)
|
15402
|
+
end
|
15403
|
+
|
15404
|
+
def copy(incoming={})
|
15405
|
+
PartnerTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15406
|
+
end
|
15407
|
+
|
15408
|
+
def to_hash
|
15409
|
+
{
|
15410
|
+
:id => id,
|
15411
|
+
:partner => partner,
|
15412
|
+
:user => user.to_hash
|
15413
|
+
}
|
15414
|
+
end
|
15415
|
+
|
15416
|
+
end
|
15417
|
+
|
14978
15418
|
class PasswordChangeForm
|
14979
15419
|
|
14980
15420
|
attr_reader :current, :new
|
@@ -18117,41 +18557,6 @@ module Io
|
|
18117
18557
|
|
18118
18558
|
end
|
18119
18559
|
|
18120
|
-
# All of the metadata associated with a given token.
|
18121
|
-
class Token
|
18122
|
-
|
18123
|
-
attr_reader :id, :user, :partial, :created_at, :description
|
18124
|
-
|
18125
|
-
def initialize(incoming={})
|
18126
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18127
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :user, :partial, :created_at], 'Token')
|
18128
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
18129
|
-
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
18130
|
-
@partial = HttpClient::Preconditions.assert_class('partial', opts.delete(:partial), String)
|
18131
|
-
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
18132
|
-
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
18133
|
-
end
|
18134
|
-
|
18135
|
-
def to_json
|
18136
|
-
JSON.dump(to_hash)
|
18137
|
-
end
|
18138
|
-
|
18139
|
-
def copy(incoming={})
|
18140
|
-
Token.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18141
|
-
end
|
18142
|
-
|
18143
|
-
def to_hash
|
18144
|
-
{
|
18145
|
-
:id => id,
|
18146
|
-
:user => user.to_hash,
|
18147
|
-
:partial => partial,
|
18148
|
-
:created_at => created_at,
|
18149
|
-
:description => description
|
18150
|
-
}
|
18151
|
-
end
|
18152
|
-
|
18153
|
-
end
|
18154
|
-
|
18155
18560
|
# Used to authenticate a given token.
|
18156
18561
|
class TokenAuthenticationForm
|
18157
18562
|
|
@@ -18179,62 +18584,6 @@ module Io
|
|
18179
18584
|
|
18180
18585
|
end
|
18181
18586
|
|
18182
|
-
# Used to create a new token for the user authorized by the request. You can
|
18183
|
-
# only create an API token for your own account.
|
18184
|
-
class TokenForm
|
18185
|
-
|
18186
|
-
attr_reader :description
|
18187
|
-
|
18188
|
-
def initialize(incoming={})
|
18189
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18190
|
-
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
18191
|
-
end
|
18192
|
-
|
18193
|
-
def to_json
|
18194
|
-
JSON.dump(to_hash)
|
18195
|
-
end
|
18196
|
-
|
18197
|
-
def copy(incoming={})
|
18198
|
-
TokenForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18199
|
-
end
|
18200
|
-
|
18201
|
-
def to_hash
|
18202
|
-
{
|
18203
|
-
:description => description
|
18204
|
-
}
|
18205
|
-
end
|
18206
|
-
|
18207
|
-
end
|
18208
|
-
|
18209
|
-
# Summary data for a given token
|
18210
|
-
class TokenReference
|
18211
|
-
|
18212
|
-
attr_reader :id, :user
|
18213
|
-
|
18214
|
-
def initialize(incoming={})
|
18215
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18216
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :user], 'TokenReference')
|
18217
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
18218
|
-
@user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
|
18219
|
-
end
|
18220
|
-
|
18221
|
-
def to_json
|
18222
|
-
JSON.dump(to_hash)
|
18223
|
-
end
|
18224
|
-
|
18225
|
-
def copy(incoming={})
|
18226
|
-
TokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18227
|
-
end
|
18228
|
-
|
18229
|
-
def to_hash
|
18230
|
-
{
|
18231
|
-
:id => id,
|
18232
|
-
:user => user.to_hash
|
18233
|
-
}
|
18234
|
-
end
|
18235
|
-
|
18236
|
-
end
|
18237
|
-
|
18238
18587
|
# Model used to report whether or not a given token is valid
|
18239
18588
|
class TokenValidation
|
18240
18589
|
|
@@ -18290,38 +18639,6 @@ module Io
|
|
18290
18639
|
|
18291
18640
|
end
|
18292
18641
|
|
18293
|
-
class TokenVersion
|
18294
|
-
|
18295
|
-
attr_reader :id, :timestamp, :type, :token
|
18296
|
-
|
18297
|
-
def initialize(incoming={})
|
18298
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18299
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :token], 'TokenVersion')
|
18300
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
18301
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
18302
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
18303
|
-
@token = (x = opts.delete(:token); x.is_a?(::Io::Flow::V0::Models::Token) ? x : ::Io::Flow::V0::Models::Token.new(x))
|
18304
|
-
end
|
18305
|
-
|
18306
|
-
def to_json
|
18307
|
-
JSON.dump(to_hash)
|
18308
|
-
end
|
18309
|
-
|
18310
|
-
def copy(incoming={})
|
18311
|
-
TokenVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18312
|
-
end
|
18313
|
-
|
18314
|
-
def to_hash
|
18315
|
-
{
|
18316
|
-
:id => id,
|
18317
|
-
:timestamp => timestamp,
|
18318
|
-
:type => type.value,
|
18319
|
-
:token => token.to_hash
|
18320
|
-
}
|
18321
|
-
end
|
18322
|
-
|
18323
|
-
end
|
18324
|
-
|
18325
18642
|
# Top level tracking information which contains labels. In cases where shipments
|
18326
18643
|
# are re-labeled, you will see multiple labels for each tracking allowing simple
|
18327
18644
|
# access to see where a shipment is - with which carrier and with the local
|
@@ -19162,7 +19479,7 @@ module Io
|
|
19162
19479
|
|
19163
19480
|
class WebhookResponse
|
19164
19481
|
|
19165
|
-
attr_reader :id, :request, :headers, :body, :status
|
19482
|
+
attr_reader :id, :request, :headers, :body, :body_url, :status
|
19166
19483
|
|
19167
19484
|
def initialize(incoming={})
|
19168
19485
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -19171,6 +19488,7 @@ module Io
|
|
19171
19488
|
@request = (x = opts.delete(:request); x.is_a?(::Io::Flow::V0::Models::WebhookRequestReference) ? x : ::Io::Flow::V0::Models::WebhookRequestReference.new(x))
|
19172
19489
|
@headers = HttpClient::Preconditions.assert_class('headers', opts.delete(:headers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Header) ? x : ::Io::Flow::V0::Models::Header.new(x)) }
|
19173
19490
|
@body = HttpClient::Preconditions.assert_class('body', opts.delete(:body), String)
|
19491
|
+
@body_url = (x = opts.delete(:body_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('body_url', x, String))
|
19174
19492
|
@status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), Integer)
|
19175
19493
|
end
|
19176
19494
|
|
@@ -19188,6 +19506,7 @@ module Io
|
|
19188
19506
|
:request => request.to_hash,
|
19189
19507
|
:headers => headers.map { |o| o.to_hash },
|
19190
19508
|
:body => body,
|
19509
|
+
:body_url => body_url,
|
19191
19510
|
:status => status
|
19192
19511
|
}
|
19193
19512
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcommerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.89
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flow Commerce, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|