flowcommerce 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c993743e66d4e1650e8cc123d612b35fa5efdea
4
- data.tar.gz: c692d8752ef47e468d6689b080f92130baadd317
3
+ metadata.gz: e61a74d0c11b6488d07dc0e742507e4d155bce83
4
+ data.tar.gz: 36bb51a105adcada9b2c10f77228f0f68ed7340c
5
5
  SHA512:
6
- metadata.gz: 3e6fcfff505fa9c3b3920ba7838ada82c00973ad08af6d5eac12b965b0efe7d460d2cc1b71b68f255641805171ffa58a0547b4c19de4e01374802b3e930a9504
7
- data.tar.gz: e44f72706ecf3feeb3ea4b3319c48a4948935222b61748fce140f98378301b4f2c2fac57afe81bcce09eed2fcaa2b954652344274bdf472e3fbd658b70d722c3
6
+ metadata.gz: a5b280c8f03af1ba9ede44f0caf0b8438440c6d3c3c9c4f7752f05ec13d8858d60c657f8810a36112fc16188de88bd482294c2fbadbfaf3ecdc91463e9ad3023
7
+ data.tar.gz: 41834885539be39721ca84699cd795832e8d740b3214fe5b94ae001d0e885126d84b29c2ca009efc793d488ed5309596220a7a911718d462d54f20686b0aab51
@@ -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.2.11/ruby_client
3
+ # apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.14/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.2.11/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.14/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
 
@@ -595,6 +595,23 @@ module Io
595
595
  ::Io::Flow::V0::Models::Pricing.new(r)
596
596
  end
597
597
 
598
+ # Formats the requested amount using the formatting settings for the
599
+ # experience.
600
+ def get_formatters_by_base_and_amount(organization, base, amount, incoming={})
601
+ HttpClient::Preconditions.assert_class('organization', organization, String)
602
+ HttpClient::Preconditions.assert_class('base', base, String)
603
+ HttpClient::Preconditions.assert_class('amount', amount, String)
604
+ opts = HttpClient::Helper.symbolize_keys(incoming)
605
+ query = {
606
+ :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
607
+ :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
608
+ :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
609
+ :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
610
+ }.delete_if { |k, v| v.nil? }
611
+ r = @client.request("/#{CGI.escape(organization)}/experiences/formatters/#{CGI.escape(base)}/#{CGI.escape(amount)}").with_query(query).get
612
+ ::Io::Flow::V0::Models::PriceWithBase.new(r)
613
+ end
614
+
598
615
  # Returns localized information about 1 or more items. The items will be
599
616
  # localized based on the experience selected by the query parameters in the
600
617
  # order of experience, then country, then ip address.
@@ -3475,14 +3492,15 @@ module Io
3475
3492
  ::Io::Flow::V0::Models::Invitation.new(r)
3476
3493
  end
3477
3494
 
3478
- # Accepts the invitation w/ the specified token, creating a membership record
3479
- # for this user within this organization. Invitations are one time use only -
3480
- # you will get a validation error if the invitation has previously been
3481
- # accepted.
3482
- def put_tokens_by_token(token, invitation_accepts_form)
3495
+ # Accepts the invitation w/ the specified token and the authenticated user.
3496
+ # Creating a membership record for this user within this organization.
3497
+ # Invitations are one time use only - you will get a validation error if the
3498
+ # invitation has previously been accepted or if the user's email addresses do
3499
+ # not match the email on the invite.
3500
+ def put_tokens_by_token(token, hash)
3483
3501
  HttpClient::Preconditions.assert_class('token', token, String)
3484
- HttpClient::Preconditions.assert_class('invitation_accepts_form', invitation_accepts_form, ::Io::Flow::V0::Models::InvitationAcceptsForm)
3485
- r = @client.request("/invitations/tokens/#{CGI.escape(token)}").with_json(invitation_accepts_form.to_json).put
3502
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
3503
+ r = @client.request("/invitations/tokens/#{CGI.escape(token)}").with_json(hash.to_json).put
3486
3504
  ::Io::Flow::V0::Models::Membership.new(r)
3487
3505
  end
3488
3506
 
@@ -6193,6 +6211,48 @@ module Io
6193
6211
 
6194
6212
  end
6195
6213
 
6214
+ class InvitationErrorCode
6215
+
6216
+ attr_reader :value
6217
+
6218
+ def initialize(value)
6219
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
6220
+ end
6221
+
6222
+ # Returns the instance of InvitationErrorCode for this value, creating a new instance for an unknown value
6223
+ def InvitationErrorCode.apply(value)
6224
+ if value.instance_of?(InvitationErrorCode)
6225
+ value
6226
+ else
6227
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
6228
+ value.nil? ? nil : (from_string(value) || InvitationErrorCode.new(value))
6229
+ end
6230
+ end
6231
+
6232
+ # Returns the instance of InvitationErrorCode for this value, or nil if not found
6233
+ def InvitationErrorCode.from_string(value)
6234
+ HttpClient::Preconditions.assert_class('value', value, String)
6235
+ InvitationErrorCode.ALL.find { |v| v.value == value }
6236
+ end
6237
+
6238
+ def InvitationErrorCode.ALL
6239
+ @@all ||= [InvitationErrorCode.expired, InvitationErrorCode.invalid_email]
6240
+ end
6241
+
6242
+ def InvitationErrorCode.expired
6243
+ @@_expired ||= InvitationErrorCode.new('expired')
6244
+ end
6245
+
6246
+ def InvitationErrorCode.invalid_email
6247
+ @@_invalid_email ||= InvitationErrorCode.new('invalid_email')
6248
+ end
6249
+
6250
+ def to_hash
6251
+ value
6252
+ end
6253
+
6254
+ end
6255
+
6196
6256
  class LevyComponent
6197
6257
 
6198
6258
  attr_reader :value
@@ -12705,14 +12765,16 @@ module Io
12705
12765
 
12706
12766
  end
12707
12767
 
12708
- class InvitationAcceptsForm
12768
+ # Returns information as to why a particular invitation could not be accepted.
12769
+ class InvitationError
12709
12770
 
12710
- attr_reader :user_id
12771
+ attr_reader :code, :messages
12711
12772
 
12712
12773
  def initialize(incoming={})
12713
12774
  opts = HttpClient::Helper.symbolize_keys(incoming)
12714
- HttpClient::Preconditions.require_keys(opts, [:user_id], 'InvitationAcceptsForm')
12715
- @user_id = HttpClient::Preconditions.assert_class('user_id', opts.delete(:user_id), String)
12775
+ HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'InvitationError')
12776
+ @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::InvitationErrorCode) ? x : ::Io::Flow::V0::Models::InvitationErrorCode.apply(x))
12777
+ @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
12716
12778
  end
12717
12779
 
12718
12780
  def to_json
@@ -12720,12 +12782,13 @@ module Io
12720
12782
  end
12721
12783
 
12722
12784
  def copy(incoming={})
12723
- InvitationAcceptsForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12785
+ InvitationError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12724
12786
  end
12725
12787
 
12726
12788
  def to_hash
12727
12789
  {
12728
- :user_id => user_id
12790
+ :code => code.value,
12791
+ :messages => messages
12729
12792
  }
12730
12793
  end
12731
12794
 
@@ -17143,7 +17206,7 @@ module Io
17143
17206
  opts = HttpClient::Helper.symbolize_keys(incoming)
17144
17207
  HttpClient::Preconditions.require_keys(opts, [:dimensions, :items], 'ShippingLabelPackage')
17145
17208
  @dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x))
17146
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItem) ? x : ::Io::Flow::V0::Models::LineItem.new(x)) }
17209
+ @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
17147
17210
  end
17148
17211
 
17149
17212
  def to_json
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.3
4
+ version: 0.1.4
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-24 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json