agentic-commerce-protocol 0.1.3 → 0.1.6

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/agentic_commerce_protocol/models/address.rb +67 -0
  3. data/lib/agentic_commerce_protocol/models/allowance.rb +67 -0
  4. data/lib/agentic_commerce_protocol/models/allowance_reason.rb +28 -0
  5. data/lib/agentic_commerce_protocol/models/buyer.rb +58 -0
  6. data/lib/agentic_commerce_protocol/models/card_funding_type.rb +30 -0
  7. data/lib/agentic_commerce_protocol/models/card_number_type.rb +29 -0
  8. data/lib/agentic_commerce_protocol/models/check_performed_type.rb +31 -0
  9. data/lib/agentic_commerce_protocol/models/checkout_session.rb +113 -0
  10. data/lib/agentic_commerce_protocol/models/checkout_session_complete_request.rb +52 -0
  11. data/lib/agentic_commerce_protocol/models/checkout_session_create_request.rb +61 -0
  12. data/lib/agentic_commerce_protocol/models/checkout_session_status.rb +32 -0
  13. data/lib/agentic_commerce_protocol/models/checkout_session_update_request.rb +70 -0
  14. data/lib/agentic_commerce_protocol/models/content_type.rb +29 -0
  15. data/lib/agentic_commerce_protocol/models/delegate_payment_request.rb +64 -0
  16. data/lib/agentic_commerce_protocol/models/delegate_payment_response.rb +55 -0
  17. data/lib/agentic_commerce_protocol/models/error.rb +58 -0
  18. data/lib/agentic_commerce_protocol/models/error_code.rb +33 -0
  19. data/lib/agentic_commerce_protocol/models/error_type.rb +31 -0
  20. data/lib/agentic_commerce_protocol/models/event_data_order.rb +64 -0
  21. data/lib/agentic_commerce_protocol/models/fulfillment_option.rb +89 -0
  22. data/lib/agentic_commerce_protocol/models/fulfillment_option_digital.rb +64 -0
  23. data/lib/agentic_commerce_protocol/models/fulfillment_option_shipping.rb +89 -0
  24. data/lib/agentic_commerce_protocol/models/item.rb +52 -0
  25. data/lib/agentic_commerce_protocol/models/line_item.rb +67 -0
  26. data/lib/agentic_commerce_protocol/models/link.rb +52 -0
  27. data/lib/agentic_commerce_protocol/models/link_type.rb +30 -0
  28. data/lib/agentic_commerce_protocol/models/message.rb +89 -0
  29. data/lib/agentic_commerce_protocol/models/message_error.rb +58 -0
  30. data/lib/agentic_commerce_protocol/models/message_info.rb +55 -0
  31. data/lib/agentic_commerce_protocol/models/order.rb +58 -0
  32. data/lib/agentic_commerce_protocol/models/payment_data.rb +58 -0
  33. data/lib/agentic_commerce_protocol/models/payment_method_card.rb +124 -0
  34. data/lib/agentic_commerce_protocol/models/payment_method_type.rb +28 -0
  35. data/lib/agentic_commerce_protocol/models/payment_provider.rb +57 -0
  36. data/lib/agentic_commerce_protocol/models/payment_provider_type.rb +28 -0
  37. data/lib/agentic_commerce_protocol/models/refund.rb +52 -0
  38. data/lib/agentic_commerce_protocol/models/refund_type.rb +29 -0
  39. data/lib/agentic_commerce_protocol/models/risk_signal.rb +55 -0
  40. data/lib/agentic_commerce_protocol/models/risk_signal_action.rb +30 -0
  41. data/lib/agentic_commerce_protocol/models/risk_signal_type.rb +28 -0
  42. data/lib/agentic_commerce_protocol/models/total.rb +55 -0
  43. data/lib/agentic_commerce_protocol/models/total_type.rb +35 -0
  44. data/lib/agentic_commerce_protocol/models/webhook_event.rb +52 -0
  45. data/lib/agentic_commerce_protocol/models/webhook_event_type.rb +29 -0
  46. data/lib/agentic_commerce_protocol/models/webhook_order_status.rb +33 -0
  47. data/lib/agentic_commerce_protocol/util.rb +70 -0
  48. data/lib/agentic_commerce_protocol/version.rb +2 -1
  49. data/lib/agentic_commerce_protocol.rb +50 -6
  50. metadata +48 -3
  51. data/lib/agentic_commerce_protocol/types.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c491837c719613a9b81716fa63b51c089a8f87642a078ba0f9cbdd5213b0baaf
4
- data.tar.gz: 1e7d82db74dd9ef9e0168e6e299e587e8b962fc3baf9b81d817e300ca7a38897
3
+ metadata.gz: 27a13c763cedf96ae0880335929ae07fdfc189c032a370eb592e53343d8b263a
4
+ data.tar.gz: 407ae694c3c8e78550df16b44ffce80f9e0eec6f48b3f07eeee6289877af2ae4
5
5
  SHA512:
6
- metadata.gz: adb411fa8697bd02723ff7a2c182584661590f8aceee32c5eb0a3ea476465ef4c1021a046a59587c7f2ed3c5556bfa3dfb489568271eaa91604acdcc8350f9f9
7
- data.tar.gz: 96d920557b4259f64825b121ddf45e0b22520ce92b04c76cccb0839dfc7101422a3386bc7babc711316260cf9638d78217ccb9ccd849043f79f071a77f9ffe57
6
+ metadata.gz: f960a6a1e5f0a63350d8c2317dc278c9227367bdeabbcc5c2d40169da9dbee97227db5e658f6130aef827fc2833f3ed514ee9bc0b2987e5aa5f63611e76e90c7
7
+ data.tar.gz: e601c02f23b6f03d60354488551cec061f2306939a3ac8d90c2a11407f237d7f8fc2a1bf55973a731b935afb7b8f708e089899bb475739b124f990627a79edef
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class Address
7
+ attr_accessor :name
8
+ attr_accessor :line_one
9
+ attr_accessor :line_two
10
+ attr_accessor :city
11
+ attr_accessor :state
12
+ attr_accessor :country
13
+ attr_accessor :postal_code
14
+
15
+ ALL_FIELD ||= ["name", "line_one", "line_two", "city", "state", "country", "postal_code"].freeze
16
+ private_constant :ALL_FIELD
17
+
18
+ def initialize(attributes = {})
19
+ unless attributes.is_a?(Hash)
20
+ fail(
21
+ ArgumentError,
22
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::Address` new method"
23
+ )
24
+ end
25
+
26
+ attributes.each do |k, v|
27
+ unless ALL_FIELD.include?(k.to_s)
28
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::Address")
29
+ end
30
+
31
+ instance_variable_set("@#{k}", v)
32
+ instance_variable_set("@__#{k}_is_defined", true)
33
+ end
34
+ end
35
+
36
+ def self.deserialize(attributes = {})
37
+ attributes = attributes.transform_keys(&:to_s)
38
+ attrs = Hash.new
39
+ attrs["name"] = attributes["name"]
40
+ attrs["line_one"] = attributes["line_one"]
41
+ attrs["line_two"] = attributes["line_two"]
42
+ attrs["city"] = attributes["city"]
43
+ attrs["state"] = attributes["state"]
44
+ attrs["country"] = attributes["country"]
45
+ attrs["postal_code"] = attributes["postal_code"]
46
+ new(attrs)
47
+ end
48
+
49
+ def serialize
50
+ out = Hash.new
51
+ out["name"] = AgenticCommerceProtocol::serialize_primitive(@name) if @name
52
+ out["line_one"] = AgenticCommerceProtocol::serialize_primitive(@line_one) if @line_one
53
+ out["line_two"] = AgenticCommerceProtocol::serialize_primitive(@line_two) if @line_two
54
+ out["city"] = AgenticCommerceProtocol::serialize_primitive(@city) if @city
55
+ out["state"] = AgenticCommerceProtocol::serialize_primitive(@state) if @state
56
+ out["country"] = AgenticCommerceProtocol::serialize_primitive(@country) if @country
57
+ out["postal_code"] = AgenticCommerceProtocol::serialize_primitive(@postal_code) if @postal_code
58
+ out
59
+ end
60
+
61
+ # Serializes the object to a json string
62
+ # @return String
63
+ def to_json
64
+ JSON.dump(serialize)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class Allowance
7
+ attr_accessor :reason
8
+ attr_accessor :max_amount
9
+ attr_accessor :currency
10
+ attr_accessor :checkout_session_id
11
+ attr_accessor :merchant_id
12
+ attr_accessor :expires_at
13
+
14
+ ALL_FIELD ||= ["reason", "max_amount", "currency", "checkout_session_id", "merchant_id", "expires_at"].freeze
15
+ private_constant :ALL_FIELD
16
+
17
+ def initialize(attributes = {})
18
+ unless attributes.is_a?(Hash)
19
+ fail(
20
+ ArgumentError,
21
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::Allowance` new method"
22
+ )
23
+ end
24
+
25
+ attributes.each do |k, v|
26
+ unless ALL_FIELD.include?(k.to_s)
27
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::Allowance")
28
+ end
29
+
30
+ instance_variable_set("@#{k}", v)
31
+ instance_variable_set("@__#{k}_is_defined", true)
32
+ end
33
+ end
34
+
35
+ def self.deserialize(attributes = {})
36
+ attributes = attributes.transform_keys(&:to_s)
37
+ attrs = Hash.new
38
+ attrs["reason"] = AgenticCommerceProtocol::AllowanceReason.deserialize(attributes["reason"])
39
+ attrs["max_amount"] = attributes["max_amount"]
40
+ attrs["currency"] = attributes["currency"]
41
+ attrs["checkout_session_id"] = attributes["checkout_session_id"]
42
+ attrs["merchant_id"] = attributes["merchant_id"]
43
+ attrs["expires_at"] = attributes["expires_at"]
44
+ new(attrs)
45
+ end
46
+
47
+ def serialize
48
+ out = Hash.new
49
+ out["reason"] = AgenticCommerceProtocol::serialize_schema_ref(@reason) if @reason
50
+ out["max_amount"] = AgenticCommerceProtocol::serialize_primitive(@max_amount) if @max_amount
51
+ out["currency"] = AgenticCommerceProtocol::serialize_primitive(@currency) if @currency
52
+ if @checkout_session_id
53
+ out["checkout_session_id"] = AgenticCommerceProtocol::serialize_primitive(@checkout_session_id)
54
+ end
55
+
56
+ out["merchant_id"] = AgenticCommerceProtocol::serialize_primitive(@merchant_id) if @merchant_id
57
+ out["expires_at"] = AgenticCommerceProtocol::serialize_primitive(@expires_at) if @expires_at
58
+ out
59
+ end
60
+
61
+ # Serializes the object to a json string
62
+ # @return String
63
+ def to_json
64
+ JSON.dump(serialize)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module AgenticCommerceProtocol
4
+ class AllowanceReason
5
+ ONE_TIME = "one_time".freeze
6
+
7
+ def self.all_vars
8
+ @all_vars ||= [ONE_TIME].freeze
9
+ end
10
+
11
+ def initialize(value)
12
+ unless AllowanceReason.all_vars.include?(value)
13
+ raise "Invalid ENUM value '#{value}' for class #AllowanceReason"
14
+ end
15
+
16
+ @value = value
17
+ end
18
+
19
+ def self.deserialize(value)
20
+ return value if AllowanceReason.all_vars.include?(value)
21
+ raise "Invalid ENUM value '#{value}' for class #AllowanceReason"
22
+ end
23
+
24
+ def serialize
25
+ @value
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class Buyer
7
+ attr_accessor :first_name
8
+ attr_accessor :last_name
9
+ attr_accessor :email
10
+ attr_accessor :phone_number
11
+
12
+ ALL_FIELD ||= ["first_name", "last_name", "email", "phone_number"].freeze
13
+ private_constant :ALL_FIELD
14
+
15
+ def initialize(attributes = {})
16
+ unless attributes.is_a?(Hash)
17
+ fail(
18
+ ArgumentError,
19
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::Buyer` new method"
20
+ )
21
+ end
22
+
23
+ attributes.each do |k, v|
24
+ unless ALL_FIELD.include?(k.to_s)
25
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::Buyer")
26
+ end
27
+
28
+ instance_variable_set("@#{k}", v)
29
+ instance_variable_set("@__#{k}_is_defined", true)
30
+ end
31
+ end
32
+
33
+ def self.deserialize(attributes = {})
34
+ attributes = attributes.transform_keys(&:to_s)
35
+ attrs = Hash.new
36
+ attrs["first_name"] = attributes["first_name"]
37
+ attrs["last_name"] = attributes["last_name"]
38
+ attrs["email"] = attributes["email"]
39
+ attrs["phone_number"] = attributes["phone_number"]
40
+ new(attrs)
41
+ end
42
+
43
+ def serialize
44
+ out = Hash.new
45
+ out["first_name"] = AgenticCommerceProtocol::serialize_primitive(@first_name) if @first_name
46
+ out["last_name"] = AgenticCommerceProtocol::serialize_primitive(@last_name) if @last_name
47
+ out["email"] = AgenticCommerceProtocol::serialize_primitive(@email) if @email
48
+ out["phone_number"] = AgenticCommerceProtocol::serialize_primitive(@phone_number) if @phone_number
49
+ out
50
+ end
51
+
52
+ # Serializes the object to a json string
53
+ # @return String
54
+ def to_json
55
+ JSON.dump(serialize)
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module AgenticCommerceProtocol
4
+ class CardFundingType
5
+ CREDIT = "credit".freeze
6
+ DEBIT = "debit".freeze
7
+ PREPAID = "prepaid".freeze
8
+
9
+ def self.all_vars
10
+ @all_vars ||= [CREDIT, DEBIT, PREPAID].freeze
11
+ end
12
+
13
+ def initialize(value)
14
+ unless CardFundingType.all_vars.include?(value)
15
+ raise "Invalid ENUM value '#{value}' for class #CardFundingType"
16
+ end
17
+
18
+ @value = value
19
+ end
20
+
21
+ def self.deserialize(value)
22
+ return value if CardFundingType.all_vars.include?(value)
23
+ raise "Invalid ENUM value '#{value}' for class #CardFundingType"
24
+ end
25
+
26
+ def serialize
27
+ @value
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module AgenticCommerceProtocol
4
+ class CardNumberType
5
+ FPAN = "fpan".freeze
6
+ NETWORK_TOKEN = "network_token".freeze
7
+
8
+ def self.all_vars
9
+ @all_vars ||= [FPAN, NETWORK_TOKEN].freeze
10
+ end
11
+
12
+ def initialize(value)
13
+ unless CardNumberType.all_vars.include?(value)
14
+ raise "Invalid ENUM value '#{value}' for class #CardNumberType"
15
+ end
16
+
17
+ @value = value
18
+ end
19
+
20
+ def self.deserialize(value)
21
+ return value if CardNumberType.all_vars.include?(value)
22
+ raise "Invalid ENUM value '#{value}' for class #CardNumberType"
23
+ end
24
+
25
+ def serialize
26
+ @value
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module AgenticCommerceProtocol
4
+ class CheckPerformedType
5
+ AVS = "avs".freeze
6
+ CVV = "cvv".freeze
7
+ ANI = "ani".freeze
8
+ AUTH0 = "auth0".freeze
9
+
10
+ def self.all_vars
11
+ @all_vars ||= [AVS, CVV, ANI, AUTH0].freeze
12
+ end
13
+
14
+ def initialize(value)
15
+ unless CheckPerformedType.all_vars.include?(value)
16
+ raise "Invalid ENUM value '#{value}' for class #CheckPerformedType"
17
+ end
18
+
19
+ @value = value
20
+ end
21
+
22
+ def self.deserialize(value)
23
+ return value if CheckPerformedType.all_vars.include?(value)
24
+ raise "Invalid ENUM value '#{value}' for class #CheckPerformedType"
25
+ end
26
+
27
+ def serialize
28
+ @value
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class CheckoutSession
7
+ attr_accessor :id
8
+ attr_accessor :buyer
9
+ attr_accessor :payment_provider
10
+ attr_accessor :status
11
+ attr_accessor :currency
12
+ attr_accessor :line_items
13
+ attr_accessor :fulfillment_address
14
+ attr_accessor :fulfillment_options
15
+ attr_accessor :fulfillment_option_id
16
+ attr_accessor :totals
17
+ attr_accessor :messages
18
+ attr_accessor :links
19
+ attr_accessor :order
20
+
21
+ ALL_FIELD ||= [
22
+ "id",
23
+ "buyer",
24
+ "payment_provider",
25
+ "status",
26
+ "currency",
27
+ "line_items",
28
+ "fulfillment_address",
29
+ "fulfillment_options",
30
+ "fulfillment_option_id",
31
+ "totals",
32
+ "messages",
33
+ "links",
34
+ "order"
35
+ ].freeze
36
+ private_constant :ALL_FIELD
37
+
38
+ def initialize(attributes = {})
39
+ unless attributes.is_a?(Hash)
40
+ fail(
41
+ ArgumentError,
42
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::CheckoutSession` new method"
43
+ )
44
+ end
45
+
46
+ attributes.each do |k, v|
47
+ unless ALL_FIELD.include?(k.to_s)
48
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::CheckoutSession")
49
+ end
50
+
51
+ instance_variable_set("@#{k}", v)
52
+ instance_variable_set("@__#{k}_is_defined", true)
53
+ end
54
+ end
55
+
56
+ def self.deserialize(attributes = {})
57
+ attributes = attributes.transform_keys(&:to_s)
58
+ attrs = Hash.new
59
+ attrs["id"] = attributes["id"]
60
+ attrs["buyer"] = AgenticCommerceProtocol::Buyer.deserialize(attributes["buyer"]) if attributes["buyer"]
61
+ if attributes["payment_provider"]
62
+ attrs["payment_provider"] = AgenticCommerceProtocol::PaymentProvider.deserialize(attributes["payment_provider"])
63
+ end
64
+
65
+ attrs["status"] = AgenticCommerceProtocol::CheckoutSessionStatus.deserialize(attributes["status"])
66
+ attrs["currency"] = attributes["currency"]
67
+ attrs["line_items"] = attributes["line_items"].map { |v| AgenticCommerceProtocol::LineItem.deserialize(v) }
68
+ if attributes["fulfillment_address"]
69
+ attrs["fulfillment_address"] = AgenticCommerceProtocol::Address.deserialize(attributes["fulfillment_address"])
70
+ end
71
+
72
+ attrs["fulfillment_options"] = attributes["fulfillment_options"].map { |v|
73
+ AgenticCommerceProtocol::FulfillmentOption.deserialize(v)
74
+ }
75
+ attrs["fulfillment_option_id"] = attributes["fulfillment_option_id"]
76
+ attrs["totals"] = attributes["totals"].map { |v| AgenticCommerceProtocol::Total.deserialize(v) }
77
+ attrs["messages"] = attributes["messages"].map { |v| AgenticCommerceProtocol::Message.deserialize(v) }
78
+ attrs["links"] = attributes["links"].map { |v| AgenticCommerceProtocol::Link.deserialize(v) }
79
+ attrs["order"] = AgenticCommerceProtocol::Order.deserialize(attributes["order"]) if attributes["order"]
80
+ new(attrs)
81
+ end
82
+
83
+ def serialize
84
+ out = Hash.new
85
+ out["id"] = AgenticCommerceProtocol::serialize_primitive(@id) if @id
86
+ out["buyer"] = AgenticCommerceProtocol::serialize_schema_ref(@buyer) if @buyer
87
+ out["payment_provider"] = AgenticCommerceProtocol::serialize_schema_ref(@payment_provider) if @payment_provider
88
+ out["status"] = AgenticCommerceProtocol::serialize_schema_ref(@status) if @status
89
+ out["currency"] = AgenticCommerceProtocol::serialize_primitive(@currency) if @currency
90
+ out["line_items"] = @line_items.map { |v| v.serialize } if @line_items
91
+ if @fulfillment_address
92
+ out["fulfillment_address"] = AgenticCommerceProtocol::serialize_schema_ref(@fulfillment_address)
93
+ end
94
+
95
+ out["fulfillment_options"] = @fulfillment_options.map { |v| v.serialize } if @fulfillment_options
96
+ if @fulfillment_option_id
97
+ out["fulfillment_option_id"] = AgenticCommerceProtocol::serialize_primitive(@fulfillment_option_id)
98
+ end
99
+
100
+ out["totals"] = @totals.map { |v| v.serialize } if @totals
101
+ out["messages"] = @messages.map { |v| v.serialize } if @messages
102
+ out["links"] = @links.map { |v| v.serialize } if @links
103
+ out["order"] = AgenticCommerceProtocol::serialize_schema_ref(@order) if @order
104
+ out
105
+ end
106
+
107
+ # Serializes the object to a json string
108
+ # @return String
109
+ def to_json
110
+ JSON.dump(serialize)
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class CheckoutSessionCompleteRequest
7
+ attr_accessor :buyer
8
+ attr_accessor :payment_data
9
+
10
+ ALL_FIELD ||= ["buyer", "payment_data"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(
16
+ ArgumentError,
17
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::CheckoutSessionCompleteRequest` new method"
18
+ )
19
+ end
20
+
21
+ attributes.each do |k, v|
22
+ unless ALL_FIELD.include?(k.to_s)
23
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::CheckoutSessionCompleteRequest")
24
+ end
25
+
26
+ instance_variable_set("@#{k}", v)
27
+ instance_variable_set("@__#{k}_is_defined", true)
28
+ end
29
+ end
30
+
31
+ def self.deserialize(attributes = {})
32
+ attributes = attributes.transform_keys(&:to_s)
33
+ attrs = Hash.new
34
+ attrs["buyer"] = AgenticCommerceProtocol::Buyer.deserialize(attributes["buyer"]) if attributes["buyer"]
35
+ attrs["payment_data"] = AgenticCommerceProtocol::PaymentData.deserialize(attributes["payment_data"])
36
+ new(attrs)
37
+ end
38
+
39
+ def serialize
40
+ out = Hash.new
41
+ out["buyer"] = AgenticCommerceProtocol::serialize_schema_ref(@buyer) if @buyer
42
+ out["payment_data"] = AgenticCommerceProtocol::serialize_schema_ref(@payment_data) if @payment_data
43
+ out
44
+ end
45
+
46
+ # Serializes the object to a json string
47
+ # @return String
48
+ def to_json
49
+ JSON.dump(serialize)
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class CheckoutSessionCreateRequest
7
+ attr_accessor :buyer
8
+ attr_accessor :items
9
+ attr_accessor :fulfillment_address
10
+
11
+ ALL_FIELD ||= ["buyer", "items", "fulfillment_address"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(
17
+ ArgumentError,
18
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::CheckoutSessionCreateRequest` new method"
19
+ )
20
+ end
21
+
22
+ attributes.each do |k, v|
23
+ unless ALL_FIELD.include?(k.to_s)
24
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::CheckoutSessionCreateRequest")
25
+ end
26
+
27
+ instance_variable_set("@#{k}", v)
28
+ instance_variable_set("@__#{k}_is_defined", true)
29
+ end
30
+ end
31
+
32
+ def self.deserialize(attributes = {})
33
+ attributes = attributes.transform_keys(&:to_s)
34
+ attrs = Hash.new
35
+ attrs["buyer"] = AgenticCommerceProtocol::Buyer.deserialize(attributes["buyer"]) if attributes["buyer"]
36
+ attrs["items"] = attributes["items"].map { |v| AgenticCommerceProtocol::Item.deserialize(v) }
37
+ if attributes["fulfillment_address"]
38
+ attrs["fulfillment_address"] = AgenticCommerceProtocol::Address.deserialize(attributes["fulfillment_address"])
39
+ end
40
+
41
+ new(attrs)
42
+ end
43
+
44
+ def serialize
45
+ out = Hash.new
46
+ out["buyer"] = AgenticCommerceProtocol::serialize_schema_ref(@buyer) if @buyer
47
+ out["items"] = @items.map { |v| v.serialize } if @items
48
+ if @fulfillment_address
49
+ out["fulfillment_address"] = AgenticCommerceProtocol::serialize_schema_ref(@fulfillment_address)
50
+ end
51
+
52
+ out
53
+ end
54
+
55
+ # Serializes the object to a json string
56
+ # @return String
57
+ def to_json
58
+ JSON.dump(serialize)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module AgenticCommerceProtocol
4
+ class CheckoutSessionStatus
5
+ NOT_READY_FOR_PAYMENT = "not_ready_for_payment".freeze
6
+ READY_FOR_PAYMENT = "ready_for_payment".freeze
7
+ COMPLETED = "completed".freeze
8
+ CANCELED = "canceled".freeze
9
+ IN_PROGRESS = "in_progress".freeze
10
+
11
+ def self.all_vars
12
+ @all_vars ||= [NOT_READY_FOR_PAYMENT, READY_FOR_PAYMENT, COMPLETED, CANCELED, IN_PROGRESS].freeze
13
+ end
14
+
15
+ def initialize(value)
16
+ unless CheckoutSessionStatus.all_vars.include?(value)
17
+ raise "Invalid ENUM value '#{value}' for class #CheckoutSessionStatus"
18
+ end
19
+
20
+ @value = value
21
+ end
22
+
23
+ def self.deserialize(value)
24
+ return value if CheckoutSessionStatus.all_vars.include?(value)
25
+ raise "Invalid ENUM value '#{value}' for class #CheckoutSessionStatus"
26
+ end
27
+
28
+ def serialize
29
+ @value
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module AgenticCommerceProtocol
6
+ class CheckoutSessionUpdateRequest
7
+ attr_accessor :buyer
8
+ attr_accessor :items
9
+ attr_accessor :fulfillment_address
10
+ attr_accessor :fulfillment_option_id
11
+
12
+ ALL_FIELD ||= ["buyer", "items", "fulfillment_address", "fulfillment_option_id"].freeze
13
+ private_constant :ALL_FIELD
14
+
15
+ def initialize(attributes = {})
16
+ unless attributes.is_a?(Hash)
17
+ fail(
18
+ ArgumentError,
19
+ "The input argument (attributes) must be a hash in `AgenticCommerceProtocol::CheckoutSessionUpdateRequest` new method"
20
+ )
21
+ end
22
+
23
+ attributes.each do |k, v|
24
+ unless ALL_FIELD.include?(k.to_s)
25
+ fail(ArgumentError, "The field #{k} is not part of AgenticCommerceProtocol::CheckoutSessionUpdateRequest")
26
+ end
27
+
28
+ instance_variable_set("@#{k}", v)
29
+ instance_variable_set("@__#{k}_is_defined", true)
30
+ end
31
+ end
32
+
33
+ def self.deserialize(attributes = {})
34
+ attributes = attributes.transform_keys(&:to_s)
35
+ attrs = Hash.new
36
+ attrs["buyer"] = AgenticCommerceProtocol::Buyer.deserialize(attributes["buyer"]) if attributes["buyer"]
37
+ if attributes["items"]
38
+ attrs["items"] = attributes["items"].map { |v| AgenticCommerceProtocol::Item.deserialize(v) }
39
+ end
40
+
41
+ if attributes["fulfillment_address"]
42
+ attrs["fulfillment_address"] = AgenticCommerceProtocol::Address.deserialize(attributes["fulfillment_address"])
43
+ end
44
+
45
+ attrs["fulfillment_option_id"] = attributes["fulfillment_option_id"]
46
+ new(attrs)
47
+ end
48
+
49
+ def serialize
50
+ out = Hash.new
51
+ out["buyer"] = AgenticCommerceProtocol::serialize_schema_ref(@buyer) if @buyer
52
+ out["items"] = @items.map { |v| v.serialize } if @items
53
+ if @fulfillment_address
54
+ out["fulfillment_address"] = AgenticCommerceProtocol::serialize_schema_ref(@fulfillment_address)
55
+ end
56
+
57
+ if @fulfillment_option_id
58
+ out["fulfillment_option_id"] = AgenticCommerceProtocol::serialize_primitive(@fulfillment_option_id)
59
+ end
60
+
61
+ out
62
+ end
63
+
64
+ # Serializes the object to a json string
65
+ # @return String
66
+ def to_json
67
+ JSON.dump(serialize)
68
+ end
69
+ end
70
+ end