flowcommerce 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 877260b01961a7094c950e02cdca2909139abd7c
4
- data.tar.gz: acd7305fc771d64b5152e954bf79148c57d3c006
3
+ metadata.gz: 514d204b0c2fd2851b9ff45336368a631ae5399c
4
+ data.tar.gz: 82b3a381d43e0462c25a3839b2e90585aeefe02c
5
5
  SHA512:
6
- metadata.gz: 26e3745ccb255d0036ea904cb6710be8c1d7f1694689e0c0f9202f89bc7aac438e3974eebaae42e1634d9f425078344d5f6cc90c1275fa66f890ad74478e9d24
7
- data.tar.gz: b65738a6a3aa62e3e5d7ae00b8c8288cc5d255a3b157e52140d594d20f753383cfeb558de4f735dbe8ee3453f504daed379d5e285fcc6f7b8e140aaa2b91f92c
6
+ metadata.gz: 56374baa11a350f02809657ee793c78f13fb2389ba7fdfab9325d2d848121b62c967807151156201047af940165e1528708c326d7c72ac237165d27af77c4117
7
+ data.tar.gz: 1da67de2289922505cc8406879cabd555019a97bac740d13938534e6f4afad4a12968c2f4e8ccc1462084b5ca25aea3f406bab5b42bd85b82beda1f041350434
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.2.65
3
- # apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.74/ruby_client
3
+ # apidoc:0.11.74 http://www.apidoc.me/flow/api/0.2.76/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.72 http://www.apidoc.me/flow/api/0.2.74/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.74 http://www.apidoc.me/flow/api/0.2.76/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.2.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -333,6 +333,14 @@ module Io
333
333
  @scheduled_exports ||= ::Io::Flow::V0::Clients::ScheduledExports.new(self)
334
334
  end
335
335
 
336
+ def sessions
337
+ @sessions ||= ::Io::Flow::V0::Clients::Sessions.new(self)
338
+ end
339
+
340
+ def session_authorizations
341
+ @session_authorizations ||= ::Io::Flow::V0::Clients::SessionAuthorizations.new(self)
342
+ end
343
+
336
344
  def suggestions
337
345
  @suggestions ||= ::Io::Flow::V0::Clients::Suggestions.new(self)
338
346
  end
@@ -3902,6 +3910,57 @@ module Io
3902
3910
 
3903
3911
  end
3904
3912
 
3913
+ class Sessions
3914
+
3915
+ def initialize(client)
3916
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3917
+ end
3918
+
3919
+ def get_by_session(session)
3920
+ HttpClient::Preconditions.assert_class('session', session, String)
3921
+ r = @client.request("/sessions/#{CGI.escape(session)}").get
3922
+ ::Io::Flow::V0::Models::Session.from_json(r)
3923
+ end
3924
+
3925
+ def put_by_session(session, session_put_form)
3926
+ HttpClient::Preconditions.assert_class('session', session, String)
3927
+ HttpClient::Preconditions.assert_class('session_put_form', session_put_form, ::Io::Flow::V0::Models::SessionPutForm)
3928
+ r = @client.request("/sessions/#{CGI.escape(session)}").with_json(session_put_form.to_json).put
3929
+ ::Io::Flow::V0::Models::Session.from_json(r)
3930
+ end
3931
+
3932
+ # Resets the session - returned session will be identical to the result of
3933
+ # using POST to create a session, except for we preserve the session id
3934
+ def put_reset_by_session(session, session_form)
3935
+ HttpClient::Preconditions.assert_class('session', session, String)
3936
+ HttpClient::Preconditions.assert_class('session_form', session_form, ::Io::Flow::V0::Models::SessionForm)
3937
+ r = @client.request("/sessions/#{CGI.escape(session)}/reset").with_json(session_form.to_json).put
3938
+ ::Io::Flow::V0::Models::Session.from_json(r)
3939
+ end
3940
+
3941
+ def post_organizations_by_organization(organization, session_form)
3942
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3943
+ HttpClient::Preconditions.assert_class('session_form', session_form, ::Io::Flow::V0::Models::SessionForm)
3944
+ r = @client.request("/sessions/organizations/#{CGI.escape(organization)}").with_json(session_form.to_json).post
3945
+ ::Io::Flow::V0::Models::OrganizationSession.new(r)
3946
+ end
3947
+
3948
+ end
3949
+
3950
+ class SessionAuthorizations
3951
+
3952
+ def initialize(client)
3953
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3954
+ end
3955
+
3956
+ def post(session_authorization_form)
3957
+ HttpClient::Preconditions.assert_class('session_authorization_form', session_authorization_form, ::Io::Flow::V0::Models::SessionAuthorizationForm)
3958
+ r = @client.request("/authorizations/sessions").with_json(session_authorization_form.to_json).post
3959
+ ::Io::Flow::V0::Models::SessionAuthorization.from_json(r)
3960
+ end
3961
+
3962
+ end
3963
+
3905
3964
  class Suggestions
3906
3965
 
3907
3966
  def initialize(client)
@@ -4312,6 +4371,8 @@ module Io
4312
4371
  class Event
4313
4372
 
4314
4373
  module Types
4374
+ ATTRIBUTE_UPSERTED = 'attribute_upserted' unless defined?(ATTRIBUTE_UPSERTED)
4375
+ ATTRIBUTE_DELETED = 'attribute_deleted' unless defined?(ATTRIBUTE_DELETED)
4315
4376
  CATALOG_UPSERTED = 'catalog_upserted' unless defined?(CATALOG_UPSERTED)
4316
4377
  CATALOG_DELETED = 'catalog_deleted' unless defined?(CATALOG_DELETED)
4317
4378
  SUBCATALOG_UPSERTED = 'subcatalog_upserted' unless defined?(SUBCATALOG_UPSERTED)
@@ -4376,7 +4437,7 @@ module Io
4376
4437
  end
4377
4438
 
4378
4439
  def subtype_to_hash
4379
- raise 'Cannot serialize an instance of event directly - must use one of the specific types: catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4440
+ raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4380
4441
  end
4381
4442
 
4382
4443
  def to_hash
@@ -4390,6 +4451,8 @@ module Io
4390
4451
  raise "Union type[event] requires a field named 'discriminator'"
4391
4452
  end
4392
4453
  case discriminator
4454
+ when Types::ATTRIBUTE_UPSERTED; AttributeUpserted.new(hash)
4455
+ when Types::ATTRIBUTE_DELETED; AttributeDeleted.new(hash)
4393
4456
  when Types::CATALOG_UPSERTED; CatalogUpserted.new(hash)
4394
4457
  when Types::CATALOG_DELETED; CatalogDeleted.new(hash)
4395
4458
  when Types::SUBCATALOG_UPSERTED; SubcatalogUpserted.new(hash)
@@ -5006,6 +5069,128 @@ module Io
5006
5069
 
5007
5070
  end
5008
5071
 
5072
+ class Session
5073
+
5074
+ module Types
5075
+ SHOPIFY_SESSION = 'shopify_session' unless defined?(SHOPIFY_SESSION)
5076
+ ORGANIZATION_SESSION = 'organization_session' unless defined?(ORGANIZATION_SESSION)
5077
+ end
5078
+
5079
+ attr_reader :discriminator
5080
+
5081
+ def initialize(incoming={})
5082
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5083
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Session')
5084
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5085
+ end
5086
+
5087
+ def subtype_to_hash
5088
+ raise 'Cannot serialize an instance of session directly - must use one of the specific types: shopify_session, organization_session'
5089
+ end
5090
+
5091
+ def to_hash
5092
+ subtype_to_hash.merge(:discriminator => @discriminator)
5093
+ end
5094
+
5095
+ def Session.from_json(hash)
5096
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
5097
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5098
+ if discriminator.empty?
5099
+ raise "Union type[session] requires a field named 'discriminator'"
5100
+ end
5101
+ case discriminator
5102
+ when Types::SHOPIFY_SESSION; ShopifySession.new(hash)
5103
+ when Types::ORGANIZATION_SESSION; OrganizationSession.new(hash)
5104
+ else SessionUndefinedType.new(:discriminator => discriminator)
5105
+ end
5106
+ end
5107
+
5108
+ end
5109
+
5110
+ class SessionUndefinedType < Session
5111
+
5112
+ attr_reader :name
5113
+
5114
+ def initialize(incoming={})
5115
+ super(:discriminator => 'undefined_type')
5116
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5117
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5118
+ end
5119
+
5120
+ def subtype_to_hash
5121
+ raise 'Unable to serialize undefined type to json'
5122
+ end
5123
+
5124
+ def copy(incoming={})
5125
+ raise 'Operation not supported for undefined type'
5126
+ end
5127
+
5128
+ def to_hash
5129
+ raise 'Operation not supported for undefined type'
5130
+ end
5131
+
5132
+ end
5133
+
5134
+ class SessionAuthorization
5135
+
5136
+ module Types
5137
+ ORGANIZATION_SESSION_AUTHORIZATION = 'organization_session_authorization' unless defined?(ORGANIZATION_SESSION_AUTHORIZATION)
5138
+ end
5139
+
5140
+ attr_reader :discriminator
5141
+
5142
+ def initialize(incoming={})
5143
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5144
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'SessionAuthorization')
5145
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5146
+ end
5147
+
5148
+ def subtype_to_hash
5149
+ raise 'Cannot serialize an instance of session_authorization directly - must use one of the specific types: organization_session_authorization'
5150
+ end
5151
+
5152
+ def to_hash
5153
+ subtype_to_hash.merge(:discriminator => @discriminator)
5154
+ end
5155
+
5156
+ def SessionAuthorization.from_json(hash)
5157
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
5158
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5159
+ if discriminator.empty?
5160
+ raise "Union type[session_authorization] requires a field named 'discriminator'"
5161
+ end
5162
+ case discriminator
5163
+ when Types::ORGANIZATION_SESSION_AUTHORIZATION; OrganizationSessionAuthorization.new(hash)
5164
+ else SessionAuthorizationUndefinedType.new(:discriminator => discriminator)
5165
+ end
5166
+ end
5167
+
5168
+ end
5169
+
5170
+ class SessionAuthorizationUndefinedType < SessionAuthorization
5171
+
5172
+ attr_reader :name
5173
+
5174
+ def initialize(incoming={})
5175
+ super(:discriminator => 'undefined_type')
5176
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5177
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5178
+ end
5179
+
5180
+ def subtype_to_hash
5181
+ raise 'Unable to serialize undefined type to json'
5182
+ end
5183
+
5184
+ def copy(incoming={})
5185
+ raise 'Operation not supported for undefined type'
5186
+ end
5187
+
5188
+ def to_hash
5189
+ raise 'Operation not supported for undefined type'
5190
+ end
5191
+
5192
+ end
5193
+
5009
5194
  # Possible outcome types from a tier rule
5010
5195
  class TierRuleOutcome
5011
5196
 
@@ -6323,7 +6508,15 @@ module Io
6323
6508
  end
6324
6509
 
6325
6510
  def EventType.ALL
6326
- @@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
6511
+ @@all ||= [EventType.attribute_upserted, EventType.attribute_deleted, EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
6512
+ end
6513
+
6514
+ def EventType.attribute_upserted
6515
+ @@_attribute_upserted ||= EventType.new('attribute_upserted')
6516
+ end
6517
+
6518
+ def EventType.attribute_deleted
6519
+ @@_attribute_deleted ||= EventType.new('attribute_deleted')
6327
6520
  end
6328
6521
 
6329
6522
  def EventType.catalog_upserted
@@ -9189,6 +9382,39 @@ module Io
9189
9382
 
9190
9383
  end
9191
9384
 
9385
+ class AttributeDeleted < Event
9386
+
9387
+ attr_reader :event_id, :timestamp, :organization, :key
9388
+
9389
+ def initialize(incoming={})
9390
+ super(:discriminator => Event::Types::ATTRIBUTE_DELETED)
9391
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9392
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key], 'AttributeDeleted')
9393
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9394
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9395
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9396
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
9397
+ end
9398
+
9399
+ def to_json
9400
+ JSON.dump(to_hash)
9401
+ end
9402
+
9403
+ def copy(incoming={})
9404
+ AttributeDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9405
+ end
9406
+
9407
+ def subtype_to_hash
9408
+ {
9409
+ :event_id => event_id,
9410
+ :timestamp => timestamp,
9411
+ :organization => organization,
9412
+ :key => key
9413
+ }
9414
+ end
9415
+
9416
+ end
9417
+
9192
9418
  class AttributeForm
9193
9419
 
9194
9420
  attr_reader :key, :options, :label, :intent, :type
@@ -9223,6 +9449,45 @@ module Io
9223
9449
 
9224
9450
  end
9225
9451
 
9452
+ class AttributeUpserted < Event
9453
+
9454
+ attr_reader :event_id, :timestamp, :organization, :key, :label, :intent, :type
9455
+
9456
+ def initialize(incoming={})
9457
+ super(:discriminator => Event::Types::ATTRIBUTE_UPSERTED)
9458
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9459
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :label, :type], 'AttributeUpserted')
9460
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9461
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9462
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9463
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
9464
+ @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
9465
+ @intent = (x = opts.delete(:intent); x.nil? ? nil : HttpClient::Preconditions.assert_class('intent', x, String))
9466
+ @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String)
9467
+ end
9468
+
9469
+ def to_json
9470
+ JSON.dump(to_hash)
9471
+ end
9472
+
9473
+ def copy(incoming={})
9474
+ AttributeUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9475
+ end
9476
+
9477
+ def subtype_to_hash
9478
+ {
9479
+ :event_id => event_id,
9480
+ :timestamp => timestamp,
9481
+ :organization => organization,
9482
+ :key => key,
9483
+ :label => label,
9484
+ :intent => intent,
9485
+ :type => type
9486
+ }
9487
+ end
9488
+
9489
+ end
9490
+
9226
9491
  # Retrieve journaled history of an attribute
9227
9492
  class AttributeVersion
9228
9493
 
@@ -10133,6 +10398,32 @@ module Io
10133
10398
 
10134
10399
  end
10135
10400
 
10401
+ class CartReference
10402
+
10403
+ attr_reader :id
10404
+
10405
+ def initialize(incoming={})
10406
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10407
+ HttpClient::Preconditions.require_keys(opts, [:id], 'CartReference')
10408
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10409
+ end
10410
+
10411
+ def to_json
10412
+ JSON.dump(to_hash)
10413
+ end
10414
+
10415
+ def copy(incoming={})
10416
+ CartReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10417
+ end
10418
+
10419
+ def to_hash
10420
+ {
10421
+ :id => id
10422
+ }
10423
+ end
10424
+
10425
+ end
10426
+
10136
10427
  class Catalog
10137
10428
 
10138
10429
  attr_reader :id
@@ -15049,6 +15340,40 @@ module Io
15049
15340
 
15050
15341
  end
15051
15342
 
15343
+ # If we found an experience for the given session, the localized information
15344
+ # will be presented here
15345
+ class LocalSession
15346
+
15347
+ attr_reader :country, :currency, :language, :experience
15348
+
15349
+ def initialize(incoming={})
15350
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15351
+ HttpClient::Preconditions.require_keys(opts, [:country, :currency, :language, :experience], 'LocalSession')
15352
+ @country = (x = opts.delete(:country); x.is_a?(::Io::Flow::V0::Models::Country) ? x : ::Io::Flow::V0::Models::Country.new(x))
15353
+ @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::Currency) ? x : ::Io::Flow::V0::Models::Currency.new(x))
15354
+ @language = (x = opts.delete(:language); x.is_a?(::Io::Flow::V0::Models::Language) ? x : ::Io::Flow::V0::Models::Language.new(x))
15355
+ @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x))
15356
+ end
15357
+
15358
+ def to_json
15359
+ JSON.dump(to_hash)
15360
+ end
15361
+
15362
+ def copy(incoming={})
15363
+ LocalSession.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15364
+ end
15365
+
15366
+ def to_hash
15367
+ {
15368
+ :country => country.to_hash,
15369
+ :currency => currency.to_hash,
15370
+ :language => language.to_hash,
15371
+ :experience => experience.to_hash
15372
+ }
15373
+ end
15374
+
15375
+ end
15376
+
15052
15377
  # Locales defines standard conventions for presentation of content. See
15053
15378
  # https://api.flow.io/reference/locales
15054
15379
  class Locale
@@ -17005,6 +17330,69 @@ module Io
17005
17330
 
17006
17331
  end
17007
17332
 
17333
+ class OrganizationSession < Session
17334
+
17335
+ attr_reader :id, :organization, :attributes, :local
17336
+
17337
+ def initialize(incoming={})
17338
+ super(:discriminator => Session::Types::ORGANIZATION_SESSION)
17339
+ opts = HttpClient::Helper.symbolize_keys(incoming)
17340
+ HttpClient::Preconditions.require_keys(opts, [:id, :organization, :attributes], 'OrganizationSession')
17341
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
17342
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
17343
+ @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
17344
+ @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalSession) ? x : ::Io::Flow::V0::Models::LocalSession.new(x)))
17345
+ end
17346
+
17347
+ def to_json
17348
+ JSON.dump(to_hash)
17349
+ end
17350
+
17351
+ def copy(incoming={})
17352
+ OrganizationSession.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
17353
+ end
17354
+
17355
+ def subtype_to_hash
17356
+ {
17357
+ :id => id,
17358
+ :organization => organization,
17359
+ :attributes => attributes,
17360
+ :local => local.nil? ? nil : local.to_hash
17361
+ }
17362
+ end
17363
+
17364
+ end
17365
+
17366
+ # Represents a session authorized access to the specified organization's data
17367
+ class OrganizationSessionAuthorization < SessionAuthorization
17368
+
17369
+ attr_reader :organization, :environment
17370
+
17371
+ def initialize(incoming={})
17372
+ super(:discriminator => SessionAuthorization::Types::ORGANIZATION_SESSION_AUTHORIZATION)
17373
+ opts = HttpClient::Helper.symbolize_keys(incoming)
17374
+ HttpClient::Preconditions.require_keys(opts, [:organization, :environment], 'OrganizationSessionAuthorization')
17375
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
17376
+ @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
17377
+ end
17378
+
17379
+ def to_json
17380
+ JSON.dump(to_hash)
17381
+ end
17382
+
17383
+ def copy(incoming={})
17384
+ OrganizationSessionAuthorization.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
17385
+ end
17386
+
17387
+ def subtype_to_hash
17388
+ {
17389
+ :organization => organization,
17390
+ :environment => environment.value
17391
+ }
17392
+ end
17393
+
17394
+ end
17395
+
17008
17396
  class OrganizationSummary
17009
17397
 
17010
17398
  attr_reader :id, :name
@@ -19217,6 +19605,97 @@ module Io
19217
19605
 
19218
19606
  end
19219
19607
 
19608
+ # Authorize a request using a session id
19609
+ class SessionAuthorizationForm
19610
+
19611
+ attr_reader :session
19612
+
19613
+ def initialize(incoming={})
19614
+ opts = HttpClient::Helper.symbolize_keys(incoming)
19615
+ HttpClient::Preconditions.require_keys(opts, [:session], 'SessionAuthorizationForm')
19616
+ @session = HttpClient::Preconditions.assert_class('session', opts.delete(:session), String)
19617
+ end
19618
+
19619
+ def to_json
19620
+ JSON.dump(to_hash)
19621
+ end
19622
+
19623
+ def copy(incoming={})
19624
+ SessionAuthorizationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19625
+ end
19626
+
19627
+ def to_hash
19628
+ {
19629
+ :session => session
19630
+ }
19631
+ end
19632
+
19633
+ end
19634
+
19635
+ class SessionForm
19636
+
19637
+ attr_reader :ip, :experience, :country, :currency, :language
19638
+
19639
+ def initialize(incoming={})
19640
+ opts = HttpClient::Helper.symbolize_keys(incoming)
19641
+ @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
19642
+ @experience = (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String))
19643
+ @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
19644
+ @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
19645
+ @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
19646
+ end
19647
+
19648
+ def to_json
19649
+ JSON.dump(to_hash)
19650
+ end
19651
+
19652
+ def copy(incoming={})
19653
+ SessionForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19654
+ end
19655
+
19656
+ def to_hash
19657
+ {
19658
+ :ip => ip,
19659
+ :experience => experience,
19660
+ :country => country,
19661
+ :currency => currency,
19662
+ :language => language
19663
+ }
19664
+ end
19665
+
19666
+ end
19667
+
19668
+ class SessionPutForm
19669
+
19670
+ attr_reader :experience, :country, :currency, :language
19671
+
19672
+ def initialize(incoming={})
19673
+ opts = HttpClient::Helper.symbolize_keys(incoming)
19674
+ @experience = (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String))
19675
+ @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
19676
+ @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
19677
+ @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
19678
+ end
19679
+
19680
+ def to_json
19681
+ JSON.dump(to_hash)
19682
+ end
19683
+
19684
+ def copy(incoming={})
19685
+ SessionPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19686
+ end
19687
+
19688
+ def to_hash
19689
+ {
19690
+ :experience => experience,
19691
+ :country => country,
19692
+ :currency => currency,
19693
+ :language => language
19694
+ }
19695
+ end
19696
+
19697
+ end
19698
+
19220
19699
  class ShippingAddress
19221
19700
 
19222
19701
  attr_reader :contact, :location
@@ -19528,6 +20007,43 @@ module Io
19528
20007
 
19529
20008
  end
19530
20009
 
20010
+ class ShopifySession < Session
20011
+
20012
+ attr_reader :id, :organization, :attributes, :local, :shop, :cart
20013
+
20014
+ def initialize(incoming={})
20015
+ super(:discriminator => Session::Types::SHOPIFY_SESSION)
20016
+ opts = HttpClient::Helper.symbolize_keys(incoming)
20017
+ HttpClient::Preconditions.require_keys(opts, [:id, :organization, :attributes, :shop, :cart], 'ShopifySession')
20018
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
20019
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
20020
+ @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
20021
+ @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalSession) ? x : ::Io::Flow::V0::Models::LocalSession.new(x)))
20022
+ @shop = HttpClient::Preconditions.assert_class('shop', opts.delete(:shop), String)
20023
+ @cart = (x = opts.delete(:cart); x.is_a?(::Io::Flow::V0::Models::CartReference) ? x : ::Io::Flow::V0::Models::CartReference.new(x))
20024
+ end
20025
+
20026
+ def to_json
20027
+ JSON.dump(to_hash)
20028
+ end
20029
+
20030
+ def copy(incoming={})
20031
+ ShopifySession.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
20032
+ end
20033
+
20034
+ def subtype_to_hash
20035
+ {
20036
+ :id => id,
20037
+ :organization => organization,
20038
+ :attributes => attributes,
20039
+ :local => local.nil? ? nil : local.to_hash,
20040
+ :shop => shop,
20041
+ :cart => cart.to_hash
20042
+ }
20043
+ end
20044
+
20045
+ end
20046
+
19531
20047
  class SnapshotDeleted < Event
19532
20048
 
19533
20049
  attr_reader :event_id, :timestamp, :snapshot_id
@@ -22056,6 +22572,7 @@ module Io
22056
22572
  def configure_ssl(http)
22057
22573
  Preconditions.assert_class('http', http, Net::HTTP)
22058
22574
  http.use_ssl = true
22575
+ http.ssl_version = :TLSv1_2
22059
22576
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
22060
22577
  http.cert_store = OpenSSL::X509::Store.new
22061
22578
  http.cert_store.set_default_paths
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.1.19
4
+ version: 0.1.20
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: 2017-03-04 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json