inttegro 8.0.0 → 9.0.0

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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/lib/inttegro/balance_transaction/allocation.rb +18 -0
  4. data/lib/inttegro/balance_transaction/allocation_base.rb +66 -0
  5. data/lib/inttegro/balance_transaction/allocation_base_type.rb +28 -0
  6. data/lib/inttegro/balance_transaction/allocation_status.rb +28 -0
  7. data/lib/inttegro/balance_transaction/available_amount.rb +34 -0
  8. data/lib/inttegro/balance_transaction/balance_transaction.rb +66 -4
  9. data/lib/inttegro/balance_transaction/payout_allocation.rb +74 -0
  10. data/lib/inttegro/balance_transaction/payout_allocation_payout.rb +35 -0
  11. data/lib/inttegro/balance_transaction/payout_allocation_type.rb +25 -0
  12. data/lib/inttegro/balance_transaction/pending_amount.rb +35 -0
  13. data/lib/inttegro/balance_transaction/refund_allocation.rb +74 -0
  14. data/lib/inttegro/balance_transaction/refund_allocation_refund.rb +35 -0
  15. data/lib/inttegro/balance_transaction/refund_allocation_type.rb +25 -0
  16. data/lib/inttegro/balance_transaction/response.rb +4 -1
  17. data/lib/inttegro/balance_transaction/spent_amount.rb +35 -0
  18. data/lib/inttegro/checkout/invoice_view.rb +8 -0
  19. data/lib/inttegro/checkout/order_line_item_group.rb +23 -0
  20. data/lib/inttegro/chime/send_request.rb +9 -0
  21. data/lib/inttegro/chime/send_request_cooldown.rb +35 -0
  22. data/lib/inttegro/chime/transport.rb +2 -1
  23. data/lib/inttegro/generated/enums.rb +16 -1
  24. data/lib/inttegro/generated/models.rb +36 -0
  25. data/lib/inttegro/generated/operations.rb +18 -3
  26. data/lib/inttegro/http_client.rb +1 -1
  27. data/lib/inttegro/order/create_existing_customer.rb +23 -0
  28. data/lib/inttegro/order/create_new_customer.rb +23 -0
  29. data/lib/inttegro/order/document_delivery_attempt.rb +7 -0
  30. data/lib/inttegro/order/document_delivery_channel_summary.rb +34 -0
  31. data/lib/inttegro/order/document_delivery_summary.rb +43 -0
  32. data/lib/inttegro/order/document_delivery_summary_channels.rb +36 -0
  33. data/lib/inttegro/order/invoice.rb +8 -0
  34. data/lib/inttegro/order/invoice_format.rb +3 -2
  35. data/lib/inttegro/order/line_item_group.rb +25 -0
  36. data/lib/inttegro/order/receipt_document_format.rb +35 -0
  37. data/lib/inttegro/order/update_request.rb +23 -0
  38. data/lib/inttegro/otp/initiate_request.rb +35 -8
  39. data/lib/inttegro/otp/purpose.rb +62 -0
  40. data/lib/inttegro/otp/transmission.rb +4 -4
  41. data/lib/inttegro/otp/transmission_status.rb +9 -0
  42. data/lib/inttegro/otp/verify_request.rb +2 -1
  43. data/lib/inttegro/payment/payment.rb +4 -1
  44. data/lib/inttegro/payout/balance_transaction.rb +42 -0
  45. data/lib/inttegro/payout/payout.rb +7 -3
  46. data/lib/inttegro/refund/line_item.rb +31 -1
  47. data/lib/inttegro/refund/order_fee_line_item.rb +43 -0
  48. data/lib/inttegro/refund/order_fee_line_item_fee.rb +34 -0
  49. data/lib/inttegro/{otp/transmission_sent_via.rb → refund/order_fee_line_item_type.rb} +7 -6
  50. data/lib/inttegro/refund/order_line_item.rb +20 -0
  51. data/lib/inttegro/refund/order_product_line_item.rb +50 -0
  52. data/lib/inttegro/refund/order_product_line_item_product.rb +34 -0
  53. data/lib/inttegro/refund/order_product_line_item_type.rb +25 -0
  54. data/lib/inttegro/refund/order_shipping_line_item.rb +43 -0
  55. data/lib/inttegro/refund/order_shipping_line_item_shipping.rb +34 -0
  56. data/lib/inttegro/refund/order_shipping_line_item_type.rb +25 -0
  57. data/lib/inttegro/refund/payment_method_settlement.rb +18 -0
  58. data/lib/inttegro/refund/refund.rb +18 -0
  59. data/lib/inttegro/resources/customers.rb +8 -0
  60. data/lib/inttegro/resources/financial_accounts.rb +12 -0
  61. data/lib/inttegro/resources/orders.rb +8 -0
  62. data/lib/inttegro/resources/payouts.rb +8 -0
  63. data/lib/inttegro/resources/products.rb +8 -0
  64. data/lib/inttegro/search/base.rb +17 -0
  65. data/lib/inttegro/search/facet.rb +34 -0
  66. data/lib/inttegro/search/facet_bucket.rb +34 -0
  67. data/lib/inttegro/search/facet_result.rb +35 -0
  68. data/lib/inttegro/search/filter.rb +42 -0
  69. data/lib/inttegro/search/filter_operator.rb +27 -0
  70. data/lib/inttegro/search/freshness.rb +43 -0
  71. data/lib/inttegro/search/freshness_state.rb +36 -0
  72. data/lib/inttegro/search/page.rb +104 -0
  73. data/lib/inttegro/search/request.rb +68 -0
  74. data/lib/inttegro/search/resource_freshness.rb +50 -0
  75. data/lib/inttegro/search/resource_freshness_state.rb +37 -0
  76. data/lib/inttegro/search/resource_reference.rb +35 -0
  77. data/lib/inttegro/search/resource_total.rb +43 -0
  78. data/lib/inttegro/search/resource_total_relation.rb +28 -0
  79. data/lib/inttegro/search/response.rb +28 -0
  80. data/lib/inttegro/search/result.rb +78 -0
  81. data/lib/inttegro/search/sort.rb +36 -0
  82. data/lib/inttegro/search/sort_direction.rb +27 -0
  83. data/lib/inttegro/search/sort_field.rb +30 -0
  84. data/lib/inttegro/search/total.rb +35 -0
  85. data/lib/inttegro/search/total_relation.rb +27 -0
  86. data/lib/inttegro/search/type.rb +36 -0
  87. data/lib/inttegro/telemetry.rb +1 -1
  88. data/lib/inttegro/version.rb +1 -1
  89. data/rbi/inttegro/generated.rbi +15 -0
  90. metadata +55 -3
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class Refund
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::Refund::OrderProductLineItemType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class OrderProductLineItemType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `product`.
20
+ # @return [Inttegro::Refund::OrderProductLineItemType]
21
+ PRODUCT = new("product")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "order_shipping_line_item_shipping"
8
+ require_relative "order_shipping_line_item_type"
9
+
10
+ module Inttegro
11
+ class Refund
12
+ # Typed representation of the order shipping line item object in the Inttegro API.
13
+ #
14
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
15
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
16
+ # field names and serialized enum values.
17
+ #
18
+ # @api public
19
+ #
20
+ # @!attribute [r] id
21
+ # Immutable order-line identifier with the `oli_` prefix.
22
+ #
23
+ # Required in the API payload. Wire name: `id`.
24
+ # @return [String]
25
+ #
26
+ # @!attribute [r] type
27
+ # Value of the `type` field in the Inttegro API payload.
28
+ #
29
+ # Required in the API payload. Wire name: `type`.
30
+ # @return [Inttegro::Refund::OrderShippingLineItemType]
31
+ #
32
+ # @!attribute [r] shipping
33
+ # Value of the `shipping` field in the Inttegro API payload.
34
+ #
35
+ # Required in the API payload. Wire name: `shipping`.
36
+ # @return [Inttegro::Refund::OrderShippingLineItemShipping]
37
+ class OrderShippingLineItem < T::Struct
38
+ const :id, String
39
+ const :type, Inttegro::Refund::OrderShippingLineItemType
40
+ const :shipping, Inttegro::Refund::OrderShippingLineItemShipping
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class Refund
10
+ # Typed representation of the order shipping line item shipping object in the Inttegro API.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] label
19
+ # Value of the `label` field in the Inttegro API payload.
20
+ #
21
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `label`.
22
+ # @return [String, nil]
23
+ #
24
+ # @!attribute [r] description
25
+ # Value of the `description` field in the Inttegro API payload.
26
+ #
27
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `description`.
28
+ # @return [String, nil]
29
+ class OrderShippingLineItemShipping < T::Struct
30
+ const :label, T.nilable(String), default: nil
31
+ const :description, T.nilable(String), default: nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class Refund
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::Refund::OrderShippingLineItemType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class OrderShippingLineItemType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `shipping`.
20
+ # @return [Inttegro::Refund::OrderShippingLineItemType]
21
+ SHIPPING = new("shipping")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -32,6 +32,24 @@ module Inttegro
32
32
  class PaymentMethodSettlement < T::Struct
33
33
  const :payment_method, Inttegro::Refund::SettlementPaymentMethod
34
34
  const :type, Inttegro::Refund::PaymentMethodSettlementType
35
+
36
+ extend T::Sig
37
+
38
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
39
+ def self.from_hash(hash, strict = false)
40
+ data = hash.dup
41
+ if (payment_method_value = data["payment_method"]).is_a?(Hash)
42
+ data["payment_method"] = case payment_method_value["type"]
43
+ when "bank_account"
44
+ Inttegro::Refund::SettlementBankAccountPaymentMethod.from_hash(payment_method_value)
45
+ when "mobile_money"
46
+ Inttegro::Refund::SettlementMobileMoneyPaymentMethod.from_hash(payment_method_value)
47
+ else
48
+ payment_method_value
49
+ end
50
+ end
51
+ super(data, strict)
52
+ end
35
53
  end
36
54
  end
37
55
  end
@@ -150,5 +150,23 @@ module Inttegro
150
150
  const :status, Inttegro::Refund::Status
151
151
  const :succeeded_at, T.nilable(Time), default: nil
152
152
  const :total, Inttegro::Money::Amount
153
+
154
+ extend T::Sig
155
+
156
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
157
+ def self.from_hash(hash, strict = false)
158
+ data = hash.dup
159
+ if (settlement_value = data["settlement"]).is_a?(Hash)
160
+ data["settlement"] = case settlement_value["type"]
161
+ when "offline"
162
+ Inttegro::Refund::OfflineSettlement.from_hash(settlement_value)
163
+ when "payment_method"
164
+ Inttegro::Refund::PaymentMethodSettlement.from_hash(settlement_value)
165
+ else
166
+ settlement_value
167
+ end
168
+ end
169
+ super(data, strict)
170
+ end
153
171
  end
154
172
  end
@@ -43,6 +43,14 @@ module Inttegro
43
43
  def page(payload = {})
44
44
  @http.post_resource("/customers/page", Inttegro::Customer::Page, :page, payload || {})
45
45
  end
46
+
47
+ # Search customer profiles using indexed fields and full-text matching.
48
+ #
49
+ # @param payload [Inttegro::Search::Request] search query, filters, sorting, facets, and cursor
50
+ # @return [Inttegro::Search::Page] typed search results
51
+ def search(payload)
52
+ @http.post_resource("/customers/search", Inttegro::Search::Page, :search, payload)
53
+ end
46
54
  end
47
55
  end
48
56
  end
@@ -60,6 +60,18 @@ module Inttegro
60
60
  )
61
61
  end
62
62
 
63
+ # Search financial accounts using indexed fields and full-text matching.
64
+ #
65
+ # @param payload [Inttegro::Search::Request] search query, filters, sorting, facets, and cursor
66
+ # @return [Inttegro::Search::Page] typed search results
67
+ def search(payload)
68
+ @http.post_resource(
69
+ "/financial_accounts/search",
70
+ Inttegro::Search::Page, :search,
71
+ payload
72
+ )
73
+ end
74
+
63
75
  # Update mutable account profile fields.
64
76
  #
65
77
  # @param payload [Hash, Inttegro::FinancialAccount::UpdateRequest] account identifier and fields to change
@@ -398,6 +398,14 @@ module Inttegro
398
398
  @http.post_resource("/orders/page", Inttegro::Order::Page, :page, payload || {})
399
399
  end
400
400
 
401
+ # Search orders using indexed fields and full-text matching.
402
+ #
403
+ # @param payload [Inttegro::Search::Request] search query, filters, sorting, facets, and cursor
404
+ # @return [Inttegro::Search::Page] typed search results
405
+ def search(payload)
406
+ @http.post_resource("/orders/search", Inttegro::Search::Page, :search, payload)
407
+ end
408
+
401
409
  private
402
410
 
403
411
  def stable_order_request_meta(action, order_id)
@@ -156,6 +156,14 @@ module Inttegro
156
156
  @http.post_resource("/payouts/page", Inttegro::Payout::Page, :page, payload)
157
157
  end
158
158
 
159
+ # Search payouts using indexed fields and full-text matching.
160
+ #
161
+ # @param payload [Inttegro::Search::Request] search query, filters, sorting, facets, and cursor
162
+ # @return [Inttegro::Search::Page] typed search results
163
+ def search(payload)
164
+ @http.post_resource("/payouts/search", Inttegro::Search::Page, :search, payload)
165
+ end
166
+
159
167
  # Schedule a payout from the application's available balance.
160
168
  #
161
169
  # @param payload [Inttegro::Schedule::PayoutRequest] typed amount, destination, and execution fields
@@ -83,6 +83,14 @@ module Inttegro
83
83
  def page(payload = {})
84
84
  @http.post_resource("/products/page", Inttegro::Product::Page, :page, payload || {})
85
85
  end
86
+
87
+ # Search products using indexed fields and full-text matching.
88
+ #
89
+ # @param payload [Inttegro::Search::Request] search query, filters, sorting, facets, and cursor
90
+ # @return [Inttegro::Search::Page] typed search results
91
+ def search(payload)
92
+ @http.post_resource("/products/search", Inttegro::Search::Page, :search, payload)
93
+ end
86
94
  end
87
95
  end
88
96
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require "sorbet-runtime"
7
+
8
+ module Inttegro
9
+ # Namespace for generated search models and enums.
10
+ #
11
+ # Each public type in this namespace is defined in its own file and follows the field names
12
+ # and wire values declared by the Inttegro OpenAPI contract.
13
+ #
14
+ # @api public
15
+ module Search
16
+ end
17
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ module Search
10
+ # Typed representation of the facet object in the Inttegro API.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] field
19
+ # Unqualified route-local field to group and count.
20
+ #
21
+ # Required in the API payload. Wire name: `field`.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [r] limit
25
+ # Value of the `limit` field in the Inttegro API payload.
26
+ #
27
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `limit`.
28
+ # @return [Integer, nil]
29
+ class Facet < T::Struct
30
+ const :field, String
31
+ const :limit, T.nilable(Integer), default: nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ module Search
10
+ # Typed representation of the facet bucket object in the Inttegro API.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] value
19
+ # Value of the `value` field in the Inttegro API payload.
20
+ #
21
+ # Required in the API payload. Wire name: `value`.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [r] count
25
+ # Value of the `count` field in the Inttegro API payload.
26
+ #
27
+ # Required in the API payload. Wire name: `count`.
28
+ # @return [Integer]
29
+ class FacetBucket < T::Struct
30
+ const :value, String
31
+ const :count, Integer
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "facet_bucket"
8
+
9
+ module Inttegro
10
+ module Search
11
+ # Typed representation of the facet result object in the Inttegro API.
12
+ #
13
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
14
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
15
+ # field names and serialized enum values.
16
+ #
17
+ # @api public
18
+ #
19
+ # @!attribute [r] field
20
+ # The same unqualified route-local field requested by the caller.
21
+ #
22
+ # Required in the API payload. Wire name: `field`.
23
+ # @return [String]
24
+ #
25
+ # @!attribute [r] buckets
26
+ # Value of the `buckets` field in the Inttegro API payload.
27
+ #
28
+ # Required in the API payload. Wire name: `buckets`.
29
+ # @return [Array<Inttegro::Search::FacetBucket>]
30
+ class FacetResult < T::Struct
31
+ const :field, String
32
+ const :buckets, T::Array[Inttegro::Search::FacetBucket]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "filter_operator"
8
+
9
+ module Inttegro
10
+ module Search
11
+ # Typed representation of the filter object in the Inttegro API.
12
+ #
13
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
14
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
15
+ # field names and serialized enum values.
16
+ #
17
+ # @api public
18
+ #
19
+ # @!attribute [r] field
20
+ # Unqualified route-local field name documented by the selected endpoint.
21
+ #
22
+ # Required in the API payload. Wire name: `field`.
23
+ # @return [String]
24
+ #
25
+ # @!attribute [r] operator
26
+ # `eq` requires exactly one value; `in` matches any supplied value.
27
+ #
28
+ # Required in the API payload. Wire name: `operator`.
29
+ # @return [Inttegro::Search::FilterOperator]
30
+ #
31
+ # @!attribute [r] values
32
+ # Value of the `values` field in the Inttegro API payload.
33
+ #
34
+ # Required in the API payload. Wire name: `values`.
35
+ # @return [Array<String>]
36
+ class Filter < T::Struct
37
+ const :field, String
38
+ const :operator, Inttegro::Search::FilterOperator
39
+ const :values, T::Array[String]
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ module Search
10
+ # `eq` requires exactly one value; `in` matches any supplied value.
11
+ #
12
+ # Use the constants below when constructing a request. `#serialize` returns the documented
13
+ # string wire value received from or sent to the API.
14
+ #
15
+ # @api public
16
+ class FilterOperator < T::Enum
17
+ enums do
18
+ # Serialized wire value: `eq`.
19
+ # @return [Inttegro::Search::FilterOperator]
20
+ EQ = new("eq")
21
+ # Serialized wire value: `in`.
22
+ # @return [Inttegro::Search::FilterOperator]
23
+ IN = new("in")
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "freshness_state"
8
+ require_relative "resource_freshness"
9
+
10
+ module Inttegro
11
+ module Search
12
+ # Typed representation of the freshness object in the Inttegro API.
13
+ #
14
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
15
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
16
+ # field names and serialized enum values.
17
+ #
18
+ # @api public
19
+ #
20
+ # @!attribute [r] state
21
+ # Value of the `state` field in the Inttegro API payload.
22
+ #
23
+ # Required in the API payload. Wire name: `state`.
24
+ # @return [Inttegro::Search::FreshnessState]
25
+ #
26
+ # @!attribute [r] observed_at
27
+ # Value of the `observed_at` field in the Inttegro API payload.
28
+ #
29
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `observed_at`.
30
+ # @return [Time, nil]
31
+ #
32
+ # @!attribute [r] resources
33
+ # Value of the `resources` field in the Inttegro API payload.
34
+ #
35
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `resources`.
36
+ # @return [Array<Inttegro::Search::ResourceFreshness>, nil]
37
+ class Freshness < T::Struct
38
+ const :state, Inttegro::Search::FreshnessState
39
+ const :observed_at, T.nilable(Time), default: nil
40
+ const :resources, T.nilable(T::Array[Inttegro::Search::ResourceFreshness]), default: nil
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ module Search
10
+ # String-backed values accepted by the Inttegro API for Inttegro::Search::FreshnessState.
11
+ #
12
+ # Use the constants below when constructing a request. `#serialize` returns the documented
13
+ # string wire value received from or sent to the API.
14
+ #
15
+ # @api public
16
+ class FreshnessState < T::Enum
17
+ enums do
18
+ # Serialized wire value: `current`.
19
+ # @return [Inttegro::Search::FreshnessState]
20
+ CURRENT = new("current")
21
+ # Serialized wire value: `delayed`.
22
+ # @return [Inttegro::Search::FreshnessState]
23
+ DELAYED = new("delayed")
24
+ # Serialized wire value: `partial`.
25
+ # @return [Inttegro::Search::FreshnessState]
26
+ PARTIAL = new("partial")
27
+ # Serialized wire value: `unknown`.
28
+ # @return [Inttegro::Search::FreshnessState]
29
+ UNKNOWN = new("unknown")
30
+ # Serialized wire value: `unavailable`.
31
+ # @return [Inttegro::Search::FreshnessState]
32
+ UNAVAILABLE = new("unavailable")
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "facet_result"
8
+ require_relative "freshness"
9
+ require_relative "resource_total"
10
+ require_relative "result"
11
+ require_relative "sort"
12
+ require_relative "total"
13
+ require_relative "type"
14
+
15
+ module Inttegro
16
+ module Search
17
+ # Typed representation of the page object in the Inttegro API.
18
+ #
19
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
20
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
21
+ # field names and serialized enum values.
22
+ #
23
+ # @api public
24
+ #
25
+ # @!attribute [r] resource_types
26
+ # Value of the `resource_types` field in the Inttegro API payload.
27
+ #
28
+ # Required in the API payload. Wire name: `resource_types`.
29
+ # @return [Array<Inttegro::Search::Type>]
30
+ #
31
+ # @!attribute [r] sort
32
+ # Value of the `sort` field in the Inttegro API payload.
33
+ #
34
+ # Required in the API payload. Wire name: `sort`.
35
+ # @return [Inttegro::Search::Sort]
36
+ #
37
+ # @!attribute [r] page_size
38
+ # Value of the `page_size` field in the Inttegro API payload.
39
+ #
40
+ # Required in the API payload. Wire name: `page_size`.
41
+ # @return [Integer]
42
+ #
43
+ # @!attribute [r] result_count
44
+ # Value of the `result_count` field in the Inttegro API payload.
45
+ #
46
+ # Required in the API payload. Wire name: `result_count`.
47
+ # @return [Integer]
48
+ #
49
+ # @!attribute [r] has_more
50
+ # Value of the `has_more` field in the Inttegro API payload.
51
+ #
52
+ # Required in the API payload. Wire name: `has_more`.
53
+ # @return [Boolean]
54
+ #
55
+ # @!attribute [r] total
56
+ # Value of the `total` field in the Inttegro API payload.
57
+ #
58
+ # Required in the API payload. Wire name: `total`.
59
+ # @return [Inttegro::Search::Total]
60
+ #
61
+ # @!attribute [r] resource_totals
62
+ # Value of the `resource_totals` field in the Inttegro API payload.
63
+ #
64
+ # Required in the API payload. Wire name: `resource_totals`.
65
+ # @return [Array<Inttegro::Search::ResourceTotal>]
66
+ #
67
+ # @!attribute [r] results
68
+ # Search projections for discovery, not canonical resource snapshots.
69
+ #
70
+ # Required in the API payload. Wire name: `results`.
71
+ # @return [Array<Inttegro::Search::Result>]
72
+ #
73
+ # @!attribute [r] facets
74
+ # Value of the `facets` field in the Inttegro API payload.
75
+ #
76
+ # Required in the API payload. Wire name: `facets`.
77
+ # @return [Array<Inttegro::Search::FacetResult>]
78
+ #
79
+ # @!attribute [r] next_cursor
80
+ # Value of the `next_cursor` field in the Inttegro API payload.
81
+ #
82
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `next_cursor`.
83
+ # @return [String, nil]
84
+ #
85
+ # @!attribute [r] freshness
86
+ # Value of the `freshness` field in the Inttegro API payload.
87
+ #
88
+ # Required in the API payload. Wire name: `freshness`.
89
+ # @return [Inttegro::Search::Freshness]
90
+ class Page < T::Struct
91
+ const :resource_types, T::Array[Inttegro::Search::Type]
92
+ const :sort, Inttegro::Search::Sort
93
+ const :page_size, Integer
94
+ const :result_count, Integer
95
+ const :has_more, T::Boolean
96
+ const :total, Inttegro::Search::Total
97
+ const :resource_totals, T::Array[Inttegro::Search::ResourceTotal]
98
+ const :results, T::Array[Inttegro::Search::Result]
99
+ const :facets, T::Array[Inttegro::Search::FacetResult]
100
+ const :next_cursor, T.nilable(String), default: nil
101
+ const :freshness, Inttegro::Search::Freshness
102
+ end
103
+ end
104
+ end