moov_ruby 0.3.8 → 0.3.9

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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/crystalline/metadata_fields.rb +9 -16
  3. data/lib/crystalline/types.rb +23 -18
  4. data/lib/moov/models/components/createinvoice.rb +2 -2
  5. data/lib/moov/models/components/createinvoicelineitem.rb +53 -0
  6. data/lib/moov/models/components/createinvoicelineitem.rbi +23 -0
  7. data/lib/moov/models/components/createinvoicelineitemoption.rb +49 -0
  8. data/lib/moov/models/components/createinvoicelineitemoption.rbi +21 -0
  9. data/lib/moov/models/components/createinvoicelineitemoptionvalidationerror.rb +45 -0
  10. data/lib/moov/models/components/createinvoicelineitemoptionvalidationerror.rbi +19 -0
  11. data/lib/moov/models/components/createinvoicelineitems.rb +33 -0
  12. data/lib/moov/models/components/{invoicelineitemsupdate.rbi → createinvoicelineitems.rbi} +2 -2
  13. data/lib/moov/models/components/{invoicelineitemsupdate.rb → createinvoicelineitemsupdate.rb} +3 -3
  14. data/lib/moov/models/components/createinvoicelineitemsupdate.rbi +13 -0
  15. data/lib/moov/models/components/createinvoicelineitemsvalidationerror.rb +33 -0
  16. data/lib/moov/models/components/createinvoicelineitemsvalidationerror.rbi +13 -0
  17. data/lib/moov/models/components/createinvoicelineitemvalidationerror.rb +49 -0
  18. data/lib/moov/models/components/createinvoicelineitemvalidationerror.rbi +21 -0
  19. data/lib/moov/models/components/invoicelineitem.rb +10 -6
  20. data/lib/moov/models/components/invoicelineitem.rbi +4 -2
  21. data/lib/moov/models/components/invoicelineitemimagemetadata.rb +45 -0
  22. data/lib/moov/models/components/invoicelineitemimagemetadata.rbi +19 -0
  23. data/lib/moov/models/components/updateinvoice.rb +2 -2
  24. data/lib/moov/models/components.rb +8 -1
  25. data/lib/moov/models/errors/createinvoiceerror.rb +2 -2
  26. data/lib/moov/sdk_hooks/hooks.rb +0 -1
  27. data/lib/moov/sdkconfiguration.rb +3 -3
  28. data/lib/moov/utils/forms.rb +1 -1
  29. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 015ac1e33efa126fc5282aaed6abc4d99a097dfa283e7ee5d652315431456582
4
- data.tar.gz: bc9e6afdd5bd152791a748f0a85747d070d228b83da38b0a36dda1ddbb75ecd7
3
+ metadata.gz: 57b60a03b0e8670790f3a6e6abeb49a96cdf106a715ec4e599e7f4e92c90a5df
4
+ data.tar.gz: d3568dec1b5880ad2e377f4c82edf2abf9b921a0a933a107de73481832b6a76a
5
5
  SHA512:
6
- metadata.gz: 3616f5cf31bb11656c124c7086524daf305563e8ad9f0bce67232bf82a17b827d44564b0c198f17b090de502bc827573ac5ad6d1b12372966d0b6fa9014b9dc2
7
- data.tar.gz: ec2fd4d9b7593a584e851711602efed87dc709dc0031869986a0aa911678982fbf1ee27c6fe1de4a903a0c09b05f68d7b452288c3c10f8115530ad529ec2a085
6
+ metadata.gz: eed5c4095693c05bc4cc35e9dda1b2d146ecf9242b5cce579f82f741418d3a70897ae0396d35a3c3c1fd4016072cc8499fb5fd1ae3b51acb5b9911f167417a24
7
+ data.tar.gz: c59b08d88dcefee5d5508d5e1ad7a3fce13ad750300526cbaaf26e92fc657ceb8a6ed49723a5e99ae2482f90abba244cbda57593c208460067c33626594363a6
@@ -62,20 +62,6 @@ module Crystalline
62
62
  end
63
63
  end
64
64
 
65
- def from_json(json_obj)
66
- case json_obj
67
- when String
68
- begin
69
- d = JSON.parse(json_obj)
70
- rescue JSON::ParserError
71
- d = json_obj
72
- end
73
- else
74
- d = json_obj
75
- end
76
- from_json(d)
77
- end
78
-
79
65
  def from_dict(d)
80
66
  to_build = {}
81
67
 
@@ -111,9 +97,16 @@ module Crystalline
111
97
  to_build[key] = unmarshalled_hash
112
98
  elsif Crystalline::Utils.union? field_type
113
99
  discriminator = field.metadata.fetch(:discriminator, nil)
100
+ discriminator_mapping = field.metadata.fetch(:discriminator_mapping, nil)
114
101
  if !discriminator.nil?
115
- type_to_deserialize = value.fetch(discriminator)
116
- type_to_deserialize = Crystalline::Utils.get_union_types(field_type).find { |t| t.name.split('::').last == type_to_deserialize }
102
+ discriminator_value = value.fetch(discriminator)
103
+ if !discriminator_mapping.nil?
104
+ # Use explicit mapping from discriminator value to type
105
+ type_to_deserialize = discriminator_mapping[discriminator_value]
106
+ else
107
+ # Fallback: try to match discriminator value against type name
108
+ type_to_deserialize = Crystalline::Utils.get_union_types(field_type).find { |t| t.name.split('::').last == discriminator_value }
109
+ end
117
110
  to_build[key] = Crystalline.unmarshal_json(value, type_to_deserialize)
118
111
  else
119
112
  union_types = Crystalline::Utils.get_union_types(field_type)
@@ -41,38 +41,43 @@ module Crystalline
41
41
  end
42
42
 
43
43
  module Enum
44
+ def self.included(base)
45
+ base.extend(ClassMethods)
46
+ end
47
+
44
48
  def initialize(val)
45
- puts methods
46
- if instance_methods(false).include?(:initialize)
49
+ if self.class.instance_methods(false).include?(:initialize)
47
50
  super(val)
48
51
  else
49
52
  @val = val
50
53
  end
51
54
  end
52
55
 
53
- def self.enums(&blk)
54
- @mapping = {}
56
+ module ClassMethods
57
+ def enums(&blk)
58
+ @mapping = {}
59
+
60
+ yield
61
+ constants(false).each do |const_name|
62
+ instance = const_get(const_name, false)
63
+ unless instance.is_a? self
64
+ raise 'Enum constants must be instances of the Enum class (e.g. `Foo = new`)'
65
+ end
66
+ @mapping[instance.serialize] = instance
67
+ end
68
+ end
55
69
 
56
- yield
57
- constants(false).each do |const_name|
58
- instance = const_get(const_name, false)
59
- unless instance.is_a? self
60
- raise 'Enum constants must be instances of the Enum class (e.g. `Foo = new`)'
70
+ def deserialize(val)
71
+ if @mapping.include? val
72
+ @mapping[val]
73
+ else
74
+ raise "Invalid value for enum: #{val}"
61
75
  end
62
- @mapping[instance.serialize] = instance
63
76
  end
64
77
  end
65
78
 
66
79
  def serialize
67
80
  @val
68
81
  end
69
-
70
- def deserialize(val)
71
- if @mapping.include? val
72
- @mapping[val]
73
- else
74
- raise "Invalid value for enum: #{val}"
75
- end
76
- end
77
82
  end
78
83
  end
@@ -18,7 +18,7 @@ module Moov
18
18
 
19
19
  field :description, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description'), required: true } }
20
20
  # A collection of line items for an invoice.
21
- field :line_items, Models::Components::InvoiceLineItems, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems'), required: true } }
21
+ field :line_items, Models::Components::CreateInvoiceLineItems, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems'), required: true } }
22
22
 
23
23
  field :invoice_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoiceDate'), 'decoder': Utils.datetime_from_iso_format(true) } }
24
24
 
@@ -26,7 +26,7 @@ module Moov
26
26
 
27
27
  field :tax_amount, Crystalline::Nilable.new(Models::Components::AmountDecimal), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('taxAmount') } }
28
28
 
29
- sig { params(customer_account_id: ::String, description: ::String, line_items: Models::Components::InvoiceLineItems, invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), tax_amount: T.nilable(Models::Components::AmountDecimal)).void }
29
+ sig { params(customer_account_id: ::String, description: ::String, line_items: Models::Components::CreateInvoiceLineItems, invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), tax_amount: T.nilable(Models::Components::AmountDecimal)).void }
30
30
  def initialize(customer_account_id:, description:, line_items:, invoice_date: nil, due_date: nil, tax_amount: nil)
31
31
  @customer_account_id = customer_account_id
32
32
  @description = description
@@ -0,0 +1,53 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ # Represents a single item in an invoice, including optional modifiers and quantity.
12
+ class CreateInvoiceLineItem
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # The name of the item.
17
+ field :name, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name'), required: true } }
18
+ # The base price of the item before applying option modifiers.
19
+ field :base_price, Models::Components::AmountDecimal, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('basePrice'), required: true } }
20
+ # The quantity of this item.
21
+ field :quantity, ::Integer, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity'), required: true } }
22
+ # Optional unique identifier associating the line item with a product.
23
+ field :product_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('productID') } }
24
+ # Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
25
+ field :options, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CreateInvoiceLineItemOption)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
26
+ # Optional list of images associated with this line item.
27
+ field :image_i_ds, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
28
+
29
+ sig { params(name: ::String, base_price: Models::Components::AmountDecimal, quantity: ::Integer, product_id: T.nilable(::String), options: T.nilable(T::Array[Models::Components::CreateInvoiceLineItemOption]), image_i_ds: T.nilable(T::Array[::String])).void }
30
+ def initialize(name:, base_price:, quantity:, product_id: nil, options: nil, image_i_ds: nil)
31
+ @name = name
32
+ @base_price = base_price
33
+ @quantity = quantity
34
+ @product_id = product_id
35
+ @options = options
36
+ @image_i_ds = image_i_ds
37
+ end
38
+
39
+ sig { params(other: T.untyped).returns(T::Boolean) }
40
+ def ==(other)
41
+ return false unless other.is_a? self.class
42
+ return false unless @name == other.name
43
+ return false unless @base_price == other.base_price
44
+ return false unless @quantity == other.quantity
45
+ return false unless @product_id == other.product_id
46
+ return false unless @options == other.options
47
+ return false unless @image_i_ds == other.image_i_ds
48
+ true
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,23 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItem
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItem
11
+ def name(); end
12
+ def name=(str_); end
13
+ def base_price(); end
14
+ def base_price=(str_); end
15
+ def quantity(); end
16
+ def quantity=(str_); end
17
+ def product_id(); end
18
+ def product_id=(str_); end
19
+ def options(); end
20
+ def options=(str_); end
21
+ def image_i_ds(); end
22
+ def image_i_ds=(str_); end
23
+ end
@@ -0,0 +1,49 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ # Represents a modifier or option applied to a line item.
12
+ class CreateInvoiceLineItemOption
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # The name of the option or modifier.
17
+ field :name, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name'), required: true } }
18
+ # The quantity of this option.
19
+ field :quantity, ::Integer, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity'), required: true } }
20
+ # Optional price modification applied by this option. Can be positive, negative, or zero.
21
+ field :price_modifier, Crystalline::Nilable.new(Models::Components::AmountDecimal), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('priceModifier') } }
22
+ # Optional group identifier to categorize related options (e.g., 'toppings').
23
+ field :group, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('group') } }
24
+ # Optional list of images associated with this line item.
25
+ field :image_i_ds, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
26
+
27
+ sig { params(name: ::String, quantity: ::Integer, price_modifier: T.nilable(Models::Components::AmountDecimal), group: T.nilable(::String), image_i_ds: T.nilable(T::Array[::String])).void }
28
+ def initialize(name:, quantity:, price_modifier: nil, group: nil, image_i_ds: nil)
29
+ @name = name
30
+ @quantity = quantity
31
+ @price_modifier = price_modifier
32
+ @group = group
33
+ @image_i_ds = image_i_ds
34
+ end
35
+
36
+ sig { params(other: T.untyped).returns(T::Boolean) }
37
+ def ==(other)
38
+ return false unless other.is_a? self.class
39
+ return false unless @name == other.name
40
+ return false unless @quantity == other.quantity
41
+ return false unless @price_modifier == other.price_modifier
42
+ return false unless @group == other.group
43
+ return false unless @image_i_ds == other.image_i_ds
44
+ true
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItemOption
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItemOption
11
+ def name(); end
12
+ def name=(str_); end
13
+ def quantity(); end
14
+ def quantity=(str_); end
15
+ def price_modifier(); end
16
+ def price_modifier=(str_); end
17
+ def group(); end
18
+ def group=(str_); end
19
+ def image_i_ds(); end
20
+ def image_i_ds=(str_); end
21
+ end
@@ -0,0 +1,45 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+
12
+ class CreateInvoiceLineItemOptionValidationError
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+
17
+ field :name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name') } }
18
+
19
+ field :group, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('group') } }
20
+
21
+ field :price_modifier, Crystalline::Nilable.new(Models::Components::AmountDecimalValidationError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('priceModifier') } }
22
+
23
+ field :quantity, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity') } }
24
+
25
+ sig { params(name: T.nilable(::String), group: T.nilable(::String), price_modifier: T.nilable(Models::Components::AmountDecimalValidationError), quantity: T.nilable(::String)).void }
26
+ def initialize(name: nil, group: nil, price_modifier: nil, quantity: nil)
27
+ @name = name
28
+ @group = group
29
+ @price_modifier = price_modifier
30
+ @quantity = quantity
31
+ end
32
+
33
+ sig { params(other: T.untyped).returns(T::Boolean) }
34
+ def ==(other)
35
+ return false unless other.is_a? self.class
36
+ return false unless @name == other.name
37
+ return false unless @group == other.group
38
+ return false unless @price_modifier == other.price_modifier
39
+ return false unless @quantity == other.quantity
40
+ true
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,19 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItemOptionValidationError
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItemOptionValidationError
11
+ def name(); end
12
+ def name=(str_); end
13
+ def group(); end
14
+ def group=(str_); end
15
+ def price_modifier(); end
16
+ def price_modifier=(str_); end
17
+ def quantity(); end
18
+ def quantity=(str_); end
19
+ end
@@ -0,0 +1,33 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ # A collection of line items for an invoice.
12
+ class CreateInvoiceLineItems
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # The list of line items.
17
+ field :items, Crystalline::Array.new(Models::Components::CreateInvoiceLineItem), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items'), required: true } }
18
+
19
+ sig { params(items: T::Array[Models::Components::CreateInvoiceLineItem]).void }
20
+ def initialize(items:)
21
+ @items = items
22
+ end
23
+
24
+ sig { params(other: T.untyped).returns(T::Boolean) }
25
+ def ==(other)
26
+ return false unless other.is_a? self.class
27
+ return false unless @items == other.items
28
+ true
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -2,12 +2,12 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
 
5
- class Moov::Models::Components::InvoiceLineItemsUpdate
5
+ class Moov::Models::Components::CreateInvoiceLineItems
6
6
  extend ::Crystalline::MetadataFields::ClassMethods
7
7
  end
8
8
 
9
9
 
10
- class Moov::Models::Components::InvoiceLineItemsUpdate
10
+ class Moov::Models::Components::CreateInvoiceLineItems
11
11
  def items(); end
12
12
  def items=(str_); end
13
13
  end
@@ -9,14 +9,14 @@ module Moov
9
9
  module Components
10
10
 
11
11
  # A collection of line items for an invoice.
12
- class InvoiceLineItemsUpdate
12
+ class CreateInvoiceLineItemsUpdate
13
13
  extend T::Sig
14
14
  include Crystalline::MetadataFields
15
15
 
16
16
  # The list of line items.
17
- field :items, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::InvoiceLineItem)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items') } }
17
+ field :items, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CreateInvoiceLineItem)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items') } }
18
18
 
19
- sig { params(items: T.nilable(T::Array[Models::Components::InvoiceLineItem])).void }
19
+ sig { params(items: T.nilable(T::Array[Models::Components::CreateInvoiceLineItem])).void }
20
20
  def initialize(items: nil)
21
21
  @items = items
22
22
  end
@@ -0,0 +1,13 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItemsUpdate
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItemsUpdate
11
+ def items(); end
12
+ def items=(str_); end
13
+ end
@@ -0,0 +1,33 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+
12
+ class CreateInvoiceLineItemsValidationError
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+
17
+ field :items, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::CreateInvoiceLineItemValidationError)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items') } }
18
+
19
+ sig { params(items: T.nilable(T::Hash[Symbol, Models::Components::CreateInvoiceLineItemValidationError])).void }
20
+ def initialize(items: nil)
21
+ @items = items
22
+ end
23
+
24
+ sig { params(other: T.untyped).returns(T::Boolean) }
25
+ def ==(other)
26
+ return false unless other.is_a? self.class
27
+ return false unless @items == other.items
28
+ true
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,13 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItemsValidationError
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItemsValidationError
11
+ def items(); end
12
+ def items=(str_); end
13
+ end
@@ -0,0 +1,49 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+
12
+ class CreateInvoiceLineItemValidationError
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+
17
+ field :product_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('productID') } }
18
+
19
+ field :name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name') } }
20
+
21
+ field :base_price, Crystalline::Nilable.new(Models::Components::AmountDecimalValidationError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('basePrice') } }
22
+
23
+ field :options, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::CreateInvoiceLineItemOptionValidationError)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
24
+
25
+ field :quantity, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity') } }
26
+
27
+ sig { params(product_id: T.nilable(::String), name: T.nilable(::String), base_price: T.nilable(Models::Components::AmountDecimalValidationError), options: T.nilable(T::Hash[Symbol, Models::Components::CreateInvoiceLineItemOptionValidationError]), quantity: T.nilable(::String)).void }
28
+ def initialize(product_id: nil, name: nil, base_price: nil, options: nil, quantity: nil)
29
+ @product_id = product_id
30
+ @name = name
31
+ @base_price = base_price
32
+ @options = options
33
+ @quantity = quantity
34
+ end
35
+
36
+ sig { params(other: T.untyped).returns(T::Boolean) }
37
+ def ==(other)
38
+ return false unless other.is_a? self.class
39
+ return false unless @product_id == other.product_id
40
+ return false unless @name == other.name
41
+ return false unless @base_price == other.base_price
42
+ return false unless @options == other.options
43
+ return false unless @quantity == other.quantity
44
+ true
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceLineItemValidationError
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceLineItemValidationError
11
+ def product_id(); end
12
+ def product_id=(str_); end
13
+ def name(); end
14
+ def name=(str_); end
15
+ def base_price(); end
16
+ def base_price=(str_); end
17
+ def options(); end
18
+ def options=(str_); end
19
+ def quantity(); end
20
+ def quantity=(str_); end
21
+ end
@@ -19,18 +19,21 @@ module Moov
19
19
  field :base_price, Models::Components::AmountDecimal, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('basePrice'), required: true } }
20
20
  # The quantity of this item.
21
21
  field :quantity, ::Integer, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity'), required: true } }
22
- # Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
23
- field :options, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::InvoiceLineItemOption)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
24
22
  # Optional unique identifier associating the line item with a product.
25
23
  field :product_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('productID') } }
24
+ # Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
25
+ field :options, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::InvoiceLineItemOption)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
26
+ # Optional list of images associated with this line item.
27
+ field :images, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::InvoiceLineItemImageMetadata)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('images') } }
26
28
 
27
- sig { params(name: ::String, base_price: Models::Components::AmountDecimal, quantity: ::Integer, options: T.nilable(T::Array[Models::Components::InvoiceLineItemOption]), product_id: T.nilable(::String)).void }
28
- def initialize(name:, base_price:, quantity:, options: nil, product_id: nil)
29
+ sig { params(name: ::String, base_price: Models::Components::AmountDecimal, quantity: ::Integer, product_id: T.nilable(::String), options: T.nilable(T::Array[Models::Components::InvoiceLineItemOption]), images: T.nilable(T::Array[Models::Components::InvoiceLineItemImageMetadata])).void }
30
+ def initialize(name:, base_price:, quantity:, product_id: nil, options: nil, images: nil)
29
31
  @name = name
30
32
  @base_price = base_price
31
33
  @quantity = quantity
32
- @options = options
33
34
  @product_id = product_id
35
+ @options = options
36
+ @images = images
34
37
  end
35
38
 
36
39
  sig { params(other: T.untyped).returns(T::Boolean) }
@@ -39,8 +42,9 @@ module Moov
39
42
  return false unless @name == other.name
40
43
  return false unless @base_price == other.base_price
41
44
  return false unless @quantity == other.quantity
42
- return false unless @options == other.options
43
45
  return false unless @product_id == other.product_id
46
+ return false unless @options == other.options
47
+ return false unless @images == other.images
44
48
  true
45
49
  end
46
50
  end
@@ -14,8 +14,10 @@ class Moov::Models::Components::InvoiceLineItem
14
14
  def base_price=(str_); end
15
15
  def quantity(); end
16
16
  def quantity=(str_); end
17
- def options(); end
18
- def options=(str_); end
19
17
  def product_id(); end
20
18
  def product_id=(str_); end
19
+ def options(); end
20
+ def options=(str_); end
21
+ def images(); end
22
+ def images=(str_); end
21
23
  end
@@ -0,0 +1,45 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+
12
+ class InvoiceLineItemImageMetadata
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # Unique identifier for a image resource.
17
+ field :image_id, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageID'), required: true } }
18
+ # The image's public URL.
19
+ field :link, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('link'), required: true } }
20
+ # A unique identifier for an image, used in public image links.
21
+ field :public_id, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('publicID'), required: true } }
22
+ # Alternative text for the image.
23
+ field :alt_text, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('altText') } }
24
+
25
+ sig { params(image_id: ::String, link: ::String, public_id: ::String, alt_text: T.nilable(::String)).void }
26
+ def initialize(image_id:, link:, public_id:, alt_text: nil)
27
+ @image_id = image_id
28
+ @link = link
29
+ @public_id = public_id
30
+ @alt_text = alt_text
31
+ end
32
+
33
+ sig { params(other: T.untyped).returns(T::Boolean) }
34
+ def ==(other)
35
+ return false unless other.is_a? self.class
36
+ return false unless @image_id == other.image_id
37
+ return false unless @link == other.link
38
+ return false unless @public_id == other.public_id
39
+ return false unless @alt_text == other.alt_text
40
+ true
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,19 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::InvoiceLineItemImageMetadata
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::InvoiceLineItemImageMetadata
11
+ def image_id(); end
12
+ def image_id=(str_); end
13
+ def link(); end
14
+ def link=(str_); end
15
+ def public_id(); end
16
+ def public_id=(str_); end
17
+ def alt_text(); end
18
+ def alt_text=(str_); end
19
+ end
@@ -16,7 +16,7 @@ module Moov
16
16
 
17
17
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description') } }
18
18
  # A collection of line items for an invoice.
19
- field :line_items, Crystalline::Nilable.new(Models::Components::InvoiceLineItemsUpdate), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
19
+ field :line_items, Crystalline::Nilable.new(Models::Components::CreateInvoiceLineItemsUpdate), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
20
20
  # Status can only be updated to `canceled` when the status is either `draft`, `unpaid`, or `overdue`.
21
21
  field :status, Crystalline::Nilable.new(Models::Components::InvoiceStatus), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('status'), 'decoder': Utils.enum_from_string(Models::Components::InvoiceStatus, true) } }
22
22
 
@@ -26,7 +26,7 @@ module Moov
26
26
 
27
27
  field :due_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('dueDate'), 'decoder': Utils.datetime_from_iso_format(true) } }
28
28
 
29
- sig { params(description: T.nilable(::String), line_items: T.nilable(Models::Components::InvoiceLineItemsUpdate), status: T.nilable(Models::Components::InvoiceStatus), tax_amount: T.nilable(Models::Components::AmountDecimalUpdate), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime)).void }
29
+ sig { params(description: T.nilable(::String), line_items: T.nilable(Models::Components::CreateInvoiceLineItemsUpdate), status: T.nilable(Models::Components::InvoiceStatus), tax_amount: T.nilable(Models::Components::AmountDecimalUpdate), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime)).void }
30
30
  def initialize(description: nil, line_items: nil, status: nil, tax_amount: nil, invoice_date: nil, due_date: nil)
31
31
  @description = description
32
32
  @line_items = line_items
@@ -160,6 +160,13 @@ module Moov
160
160
  autoload :CreateIndividualErrorSsn, 'moov/models/components/createindividualerror_ssn.rb'
161
161
  autoload :CreateIndividualProfile, 'moov/models/components/createindividualprofile.rb'
162
162
  autoload :CreateInvoice, 'moov/models/components/createinvoice.rb'
163
+ autoload :CreateInvoiceLineItem, 'moov/models/components/createinvoicelineitem.rb'
164
+ autoload :CreateInvoiceLineItemOption, 'moov/models/components/createinvoicelineitemoption.rb'
165
+ autoload :CreateInvoiceLineItemOptionValidationError, 'moov/models/components/createinvoicelineitemoptionvalidationerror.rb'
166
+ autoload :CreateInvoiceLineItemValidationError, 'moov/models/components/createinvoicelineitemvalidationerror.rb'
167
+ autoload :CreateInvoiceLineItems, 'moov/models/components/createinvoicelineitems.rb'
168
+ autoload :CreateInvoiceLineItemsUpdate, 'moov/models/components/createinvoicelineitemsupdate.rb'
169
+ autoload :CreateInvoiceLineItemsValidationError, 'moov/models/components/createinvoicelineitemsvalidationerror.rb'
163
170
  autoload :CreatePaymentLink, 'moov/models/components/createpaymentlink.rb'
164
171
  autoload :CreatePaymentLinkLineItem, 'moov/models/components/createpaymentlinklineitem.rb'
165
172
  autoload :CreatePaymentLinkLineItemOption, 'moov/models/components/createpaymentlinklineitemoption.rb'
@@ -270,11 +277,11 @@ module Moov
270
277
  autoload :InvoiceExternalPayment, 'moov/models/components/invoiceexternalpayment.rb'
271
278
  autoload :InvoiceExternalPaymentPaymentType, 'moov/models/components/invoiceexternalpayment_paymenttype.rb'
272
279
  autoload :InvoiceLineItem, 'moov/models/components/invoicelineitem.rb'
280
+ autoload :InvoiceLineItemImageMetadata, 'moov/models/components/invoicelineitemimagemetadata.rb'
273
281
  autoload :InvoiceLineItemOption, 'moov/models/components/invoicelineitemoption.rb'
274
282
  autoload :InvoiceLineItemOptionValidationError, 'moov/models/components/invoicelineitemoptionvalidationerror.rb'
275
283
  autoload :InvoiceLineItemValidationError, 'moov/models/components/invoicelineitemvalidationerror.rb'
276
284
  autoload :InvoiceLineItems, 'moov/models/components/invoicelineitems.rb'
277
- autoload :InvoiceLineItemsUpdate, 'moov/models/components/invoicelineitemsupdate.rb'
278
285
  autoload :InvoiceLineItemsValidationError, 'moov/models/components/invoicelineitemsvalidationerror.rb'
279
286
  autoload :InvoicePayment, 'moov/models/components/invoicepayment.rb'
280
287
  autoload :InvoiceStatus, 'moov/models/components/invoicestatus.rb'
@@ -18,7 +18,7 @@ module Moov
18
18
 
19
19
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description') } }
20
20
 
21
- field :line_items, Crystalline::Nilable.new(Models::Components::InvoiceLineItemsValidationError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
21
+ field :line_items, Crystalline::Nilable.new(Models::Components::CreateInvoiceLineItemsValidationError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
22
22
 
23
23
  field :invoice_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoiceDate') } }
24
24
 
@@ -28,7 +28,7 @@ module Moov
28
28
  # Raw HTTP response; suitable for custom response parsing
29
29
  field :raw_response, Crystalline::Nilable.new(::Faraday::Response), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('-') } }
30
30
 
31
- sig { params(customer_account_id: T.nilable(::String), description: T.nilable(::String), line_items: T.nilable(Models::Components::InvoiceLineItemsValidationError), invoice_date: T.nilable(::String), due_date: T.nilable(::String), tax_amount: T.nilable(Models::Components::AmountDecimalValidationError), raw_response: T.nilable(::Faraday::Response)).void }
31
+ sig { params(customer_account_id: T.nilable(::String), description: T.nilable(::String), line_items: T.nilable(Models::Components::CreateInvoiceLineItemsValidationError), invoice_date: T.nilable(::String), due_date: T.nilable(::String), tax_amount: T.nilable(Models::Components::AmountDecimalValidationError), raw_response: T.nilable(::Faraday::Response)).void }
32
32
  def initialize(customer_account_id: nil, description: nil, line_items: nil, invoice_date: nil, due_date: nil, tax_amount: nil, raw_response: nil)
33
33
  @customer_account_id = customer_account_id
34
34
  @description = description
@@ -6,7 +6,6 @@
6
6
  require_relative './registration'
7
7
  require_relative './types'
8
8
 
9
-
10
9
  module Moov
11
10
  module SDKHooks
12
11
  class Hooks
@@ -95,9 +95,9 @@ module Moov
95
95
  @globals = globals.nil? ? {} : globals
96
96
  @language = 'ruby'
97
97
  @openapi_doc_version = 'latest'
98
- @sdk_version = '0.3.8'
99
- @gen_version = '2.763.3'
100
- @user_agent = 'speakeasy-sdk/ruby 0.3.8 2.763.3 latest moov_ruby'
98
+ @sdk_version = '0.3.9'
99
+ @gen_version = '2.770.0'
100
+ @user_agent = 'speakeasy-sdk/ruby 0.3.9 2.770.0 latest moov_ruby'
101
101
  end
102
102
 
103
103
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -104,7 +104,7 @@ module Moov
104
104
  end
105
105
  raise StandardError, 'invalid multipart/form-data file' if T.unsafe(file_name) == '' || T.unsafe(content).nil?
106
106
 
107
- form.append([field_name, [file_name, content]])
107
+ form.append(["#{field_name}[]", [file_name, content]])
108
108
  end
109
109
  else
110
110
  # Handle single file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moov_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Speakeasy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-26 00:00:00.000000000 Z
11
+ date: 2025-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -540,6 +540,20 @@ files:
540
540
  - lib/moov/models/components/createindividualprofile.rbi
541
541
  - lib/moov/models/components/createinvoice.rb
542
542
  - lib/moov/models/components/createinvoice.rbi
543
+ - lib/moov/models/components/createinvoicelineitem.rb
544
+ - lib/moov/models/components/createinvoicelineitem.rbi
545
+ - lib/moov/models/components/createinvoicelineitemoption.rb
546
+ - lib/moov/models/components/createinvoicelineitemoption.rbi
547
+ - lib/moov/models/components/createinvoicelineitemoptionvalidationerror.rb
548
+ - lib/moov/models/components/createinvoicelineitemoptionvalidationerror.rbi
549
+ - lib/moov/models/components/createinvoicelineitems.rb
550
+ - lib/moov/models/components/createinvoicelineitems.rbi
551
+ - lib/moov/models/components/createinvoicelineitemsupdate.rb
552
+ - lib/moov/models/components/createinvoicelineitemsupdate.rbi
553
+ - lib/moov/models/components/createinvoicelineitemsvalidationerror.rb
554
+ - lib/moov/models/components/createinvoicelineitemsvalidationerror.rbi
555
+ - lib/moov/models/components/createinvoicelineitemvalidationerror.rb
556
+ - lib/moov/models/components/createinvoicelineitemvalidationerror.rbi
543
557
  - lib/moov/models/components/createpaymentlink.rb
544
558
  - lib/moov/models/components/createpaymentlink.rbi
545
559
  - lib/moov/models/components/createpaymentlinklineitem.rb
@@ -760,14 +774,14 @@ files:
760
774
  - lib/moov/models/components/invoiceexternalpayment_paymenttype.rbi
761
775
  - lib/moov/models/components/invoicelineitem.rb
762
776
  - lib/moov/models/components/invoicelineitem.rbi
777
+ - lib/moov/models/components/invoicelineitemimagemetadata.rb
778
+ - lib/moov/models/components/invoicelineitemimagemetadata.rbi
763
779
  - lib/moov/models/components/invoicelineitemoption.rb
764
780
  - lib/moov/models/components/invoicelineitemoption.rbi
765
781
  - lib/moov/models/components/invoicelineitemoptionvalidationerror.rb
766
782
  - lib/moov/models/components/invoicelineitemoptionvalidationerror.rbi
767
783
  - lib/moov/models/components/invoicelineitems.rb
768
784
  - lib/moov/models/components/invoicelineitems.rbi
769
- - lib/moov/models/components/invoicelineitemsupdate.rb
770
- - lib/moov/models/components/invoicelineitemsupdate.rbi
771
785
  - lib/moov/models/components/invoicelineitemsvalidationerror.rb
772
786
  - lib/moov/models/components/invoicelineitemsvalidationerror.rbi
773
787
  - lib/moov/models/components/invoicelineitemvalidationerror.rb