weft-sdk 0.10.1 → 0.14.1

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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AccountApi.md +1 -1
  3. data/docs/AccountBootstrapApproval.md +21 -0
  4. data/docs/AccountBootstrapCreated.md +29 -0
  5. data/docs/AccountBootstrapCreatedApproval.md +23 -0
  6. data/docs/AccountBootstrapCreatedResponse.md +17 -0
  7. data/docs/AccountBootstrapRequest.md +27 -0
  8. data/docs/AccountBootstrapStatus.md +25 -0
  9. data/docs/AccountBootstrapStatusResponse.md +17 -0
  10. data/docs/AgentBootstrapApi.md +209 -0
  11. data/docs/BalanceApi.md +1 -1
  12. data/docs/CuratedMarketplaceContract.md +31 -0
  13. data/docs/FetchApi.md +1 -1
  14. data/docs/FetchBalanceSnapshot.md +1 -1
  15. data/docs/FetchRequest.md +5 -1
  16. data/docs/RateLimitResponse.md +19 -0
  17. data/docs/SearchAccessMethod.md +37 -0
  18. data/docs/SearchApi.md +68 -1
  19. data/docs/SearchCuratedCallability.md +19 -0
  20. data/docs/SearchCuratedExecution.md +17 -0
  21. data/docs/SearchCuratedOperation.md +21 -0
  22. data/docs/SearchCuratedService.md +19 -0
  23. data/docs/SearchCuratedSource.md +21 -0
  24. data/docs/SearchEndpointHit.md +18 -0
  25. data/docs/SearchExecutionModeFilter.md +19 -0
  26. data/docs/SearchFilterSpec.md +11 -1
  27. data/docs/SearchMethodFilter.md +19 -0
  28. data/docs/SearchResponse.md +1 -3
  29. data/docs/SearchStringSetFilter.md +19 -0
  30. data/docs/SearchWeftFetchCompatibility.md +21 -0
  31. data/docs/Wallet.md +7 -3
  32. data/lib/weft/generated/api/account_api.rb +4 -4
  33. data/lib/weft/generated/api/agent_bootstrap_api.rb +224 -0
  34. data/lib/weft/generated/api/api_keys_api.rb +2 -2
  35. data/lib/weft/generated/api/auth_api.rb +2 -2
  36. data/lib/weft/generated/api/balance_api.rb +4 -4
  37. data/lib/weft/generated/api/default_api.rb +2 -2
  38. data/lib/weft/generated/api/fetch_api.rb +4 -4
  39. data/lib/weft/generated/api/payments_api.rb +2 -2
  40. data/lib/weft/generated/api/purchases_api.rb +2 -2
  41. data/lib/weft/generated/api/resources_api.rb +2 -2
  42. data/lib/weft/generated/api/search_api.rb +83 -4
  43. data/lib/weft/generated/api_client.rb +2 -2
  44. data/lib/weft/generated/api_error.rb +2 -2
  45. data/lib/weft/generated/api_model_base.rb +2 -2
  46. data/lib/weft/generated/configuration.rb +10 -2
  47. data/lib/weft/generated/models/account_bootstrap_approval.rb +259 -0
  48. data/lib/weft/generated/models/account_bootstrap_created.rb +349 -0
  49. data/lib/weft/generated/models/account_bootstrap_created_approval.rb +297 -0
  50. data/lib/weft/generated/models/account_bootstrap_created_response.rb +164 -0
  51. data/lib/weft/generated/models/account_bootstrap_request.rb +317 -0
  52. data/lib/weft/generated/models/account_bootstrap_status.rb +282 -0
  53. data/lib/weft/generated/models/account_bootstrap_status_response.rb +164 -0
  54. data/lib/weft/generated/models/account_details.rb +2 -2
  55. data/lib/weft/generated/models/api_key.rb +2 -2
  56. data/lib/weft/generated/models/api_key_created.rb +2 -2
  57. data/lib/weft/generated/models/api_key_created_response.rb +2 -2
  58. data/lib/weft/generated/models/api_key_list_response.rb +2 -2
  59. data/lib/weft/generated/models/auth_response.rb +2 -2
  60. data/lib/weft/generated/models/auth_response_data.rb +2 -2
  61. data/lib/weft/generated/models/balance_response.rb +2 -2
  62. data/lib/weft/generated/models/confirm_request.rb +2 -2
  63. data/lib/weft/generated/models/create_api_key_request.rb +2 -2
  64. data/lib/weft/generated/models/curated_marketplace_contract.rb +384 -0
  65. data/lib/weft/generated/models/enrolled_resource.rb +2 -2
  66. data/lib/weft/generated/models/error.rb +2 -2
  67. data/lib/weft/generated/models/error_response.rb +2 -2
  68. data/lib/weft/generated/models/fetch403_response.rb +2 -2
  69. data/lib/weft/generated/models/fetch_balance_snapshot.rb +3 -3
  70. data/lib/weft/generated/models/fetch_error_response.rb +4 -4
  71. data/lib/weft/generated/models/fetch_request.rb +26 -6
  72. data/lib/weft/generated/models/fetch_request_body.rb +2 -2
  73. data/lib/weft/generated/models/fetch_response.rb +2 -2
  74. data/lib/weft/generated/models/insufficient_scope_response.rb +2 -2
  75. data/lib/weft/generated/models/me_api_key.rb +2 -2
  76. data/lib/weft/generated/models/me_api_key_creator.rb +2 -2
  77. data/lib/weft/generated/models/me_response.rb +2 -2
  78. data/lib/weft/generated/models/me_response_data.rb +2 -2
  79. data/lib/weft/generated/models/merchant.rb +2 -2
  80. data/lib/weft/generated/models/message_response.rb +2 -2
  81. data/lib/weft/generated/models/message_response_data.rb +2 -2
  82. data/lib/weft/generated/models/pagination.rb +2 -2
  83. data/lib/weft/generated/models/password_reset_request.rb +2 -2
  84. data/lib/weft/generated/models/password_update_request.rb +2 -2
  85. data/lib/weft/generated/models/payment.rb +2 -2
  86. data/lib/weft/generated/models/payment_list_response.rb +2 -2
  87. data/lib/weft/generated/models/payment_response.rb +2 -2
  88. data/lib/weft/generated/models/principal_wallet.rb +2 -2
  89. data/lib/weft/generated/models/promo_balance.rb +2 -2
  90. data/lib/weft/generated/models/purchase.rb +2 -2
  91. data/lib/weft/generated/models/purchase_artifact.rb +2 -2
  92. data/lib/weft/generated/models/purchase_list_response.rb +2 -2
  93. data/lib/weft/generated/models/purchase_response.rb +2 -2
  94. data/lib/weft/generated/models/rate_limit_response.rb +214 -0
  95. data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
  96. data/lib/weft/generated/models/resource_enrollment_request.rb +2 -2
  97. data/lib/weft/generated/models/resource_enrollment_response.rb +2 -2
  98. data/lib/weft/generated/models/resource_stats.rb +2 -2
  99. data/lib/weft/generated/models/search_access_method.rb +341 -0
  100. data/lib/weft/generated/models/search_capability_ref.rb +2 -2
  101. data/lib/weft/generated/models/search_curated_callability.rb +216 -0
  102. data/lib/weft/generated/models/search_curated_execution.rb +181 -0
  103. data/lib/weft/generated/models/search_curated_operation.rb +199 -0
  104. data/lib/weft/generated/models/search_curated_service.rb +190 -0
  105. data/lib/weft/generated/models/search_curated_source.rb +240 -0
  106. data/lib/weft/generated/models/search_endpoint_call.rb +2 -2
  107. data/lib/weft/generated/models/search_endpoint_hit.rb +86 -3
  108. data/lib/weft/generated/models/search_endpoint_price.rb +2 -2
  109. data/lib/weft/generated/models/search_error_response.rb +2 -2
  110. data/lib/weft/generated/models/search_execution_mode_filter.rb +197 -0
  111. data/lib/weft/generated/models/search_filter_spec.rb +55 -6
  112. data/lib/weft/generated/models/search_method_filter.rb +197 -0
  113. data/lib/weft/generated/models/search_payment_offer.rb +2 -2
  114. data/lib/weft/generated/models/search_price_atomic_filter.rb +2 -2
  115. data/lib/weft/generated/models/search_price_usd_filter.rb +2 -2
  116. data/lib/weft/generated/models/search_protocol_filter.rb +2 -2
  117. data/lib/weft/generated/models/search_provider_ref.rb +2 -2
  118. data/lib/weft/generated/models/search_request.rb +2 -2
  119. data/lib/weft/generated/models/search_resource_type_filter.rb +2 -2
  120. data/lib/weft/generated/models/search_response.rb +7 -17
  121. data/lib/weft/generated/models/search_response_warnings_inner.rb +2 -2
  122. data/lib/weft/generated/models/search_result.rb +2 -2
  123. data/lib/weft/generated/models/search_string_set_filter.rb +177 -0
  124. data/lib/weft/generated/models/search_weft_fetch_compatibility.rb +240 -0
  125. data/lib/weft/generated/models/sign_in_request.rb +2 -2
  126. data/lib/weft/generated/models/sign_up_request.rb +2 -2
  127. data/lib/weft/generated/models/spending_policy.rb +2 -2
  128. data/lib/weft/generated/models/user.rb +2 -2
  129. data/lib/weft/generated/models/user_principal.rb +2 -2
  130. data/lib/weft/generated/models/wallet.rb +84 -6
  131. data/lib/weft/generated/version.rb +3 -3
  132. data/lib/weft/sdk.rb +1 -1
  133. metadata +42 -2
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key or an OAuth access token with the relevant scope. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. The two key types are not interchangeable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
4
+ #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key, an OAuth access token with the relevant scope, or a claimed `wbt_*` bearer on its fixed allowlist. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. These credential types are not interchangeable. Before claim, a `wbt_*` bearer is temporary and permits only search plus its own status/cancel operations for 30 minutes. Human approval binds it to the User and promotes the same secret to durable identity, search, balance, fetch, purchase-history, status, and revocation capabilities. It remains valid until revoked. Seller, organization, API-key administration, dashboard-session, transfer, withdrawal, and MCP surfaces always refuse it. Bootstrap lifecycle successes follow the API-standard `{ \"data\": ... }` envelope. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
5
5
 
6
- The version of the OpenAPI document: 0.10.1
6
+ The version of the OpenAPI document: 0.14.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -0,0 +1,341 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key, an OAuth access token with the relevant scope, or a claimed `wbt_*` bearer on its fixed allowlist. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. These credential types are not interchangeable. Before claim, a `wbt_*` bearer is temporary and permits only search plus its own status/cancel operations for 30 minutes. Human approval binds it to the User and promotes the same secret to durable identity, search, balance, fetch, purchase-history, status, and revocation capabilities. It remains valid until revoked. Seller, organization, API-key administration, dashboard-session, transfer, withdrawal, and MCP surfaces always refuse it. Bootstrap lifecycle successes follow the API-standard `{ \"data\": ... }` envelope. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
5
+
6
+ The version of the OpenAPI document: 0.14.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Weft
17
+ class SearchAccessMethod < ApiModelBase
18
+ attr_accessor :access_method_id
19
+
20
+ attr_accessor :protocol
21
+
22
+ attr_accessor :scheme
23
+
24
+ attr_accessor :network
25
+
26
+ attr_accessor :asset
27
+
28
+ attr_accessor :asset_decimals
29
+
30
+ attr_accessor :price
31
+
32
+ attr_accessor :merchant
33
+
34
+ attr_accessor :terms
35
+
36
+ attr_accessor :status
37
+
38
+ attr_accessor :weft_fetch
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'access_method_id' => :'access_method_id',
66
+ :'protocol' => :'protocol',
67
+ :'scheme' => :'scheme',
68
+ :'network' => :'network',
69
+ :'asset' => :'asset',
70
+ :'asset_decimals' => :'asset_decimals',
71
+ :'price' => :'price',
72
+ :'merchant' => :'merchant',
73
+ :'terms' => :'terms',
74
+ :'status' => :'status',
75
+ :'weft_fetch' => :'weft_fetch'
76
+ }
77
+ end
78
+
79
+ # Returns attribute mapping this model knows about
80
+ def self.acceptable_attribute_map
81
+ attribute_map
82
+ end
83
+
84
+ # Returns all the JSON keys this model knows about
85
+ def self.acceptable_attributes
86
+ acceptable_attribute_map.values
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.openapi_types
91
+ {
92
+ :'access_method_id' => :'String',
93
+ :'protocol' => :'String',
94
+ :'scheme' => :'String',
95
+ :'network' => :'String',
96
+ :'asset' => :'String',
97
+ :'asset_decimals' => :'Integer',
98
+ :'price' => :'Object',
99
+ :'merchant' => :'Object',
100
+ :'terms' => :'Object',
101
+ :'status' => :'String',
102
+ :'weft_fetch' => :'SearchWeftFetchCompatibility'
103
+ }
104
+ end
105
+
106
+ # List of attributes with nullable: true
107
+ def self.openapi_nullable
108
+ Set.new([
109
+ ])
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ if (!attributes.is_a?(Hash))
116
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchAccessMethod` initialize method"
117
+ end
118
+
119
+ # check to see if the attribute exists and convert string to symbol for hash key
120
+ acceptable_attribute_map = self.class.acceptable_attribute_map
121
+ attributes = attributes.each_with_object({}) { |(k, v), h|
122
+ if (!acceptable_attribute_map.key?(k.to_sym))
123
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchAccessMethod`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
124
+ end
125
+ h[k.to_sym] = v
126
+ }
127
+
128
+ if attributes.key?(:'access_method_id')
129
+ self.access_method_id = attributes[:'access_method_id']
130
+ else
131
+ self.access_method_id = nil
132
+ end
133
+
134
+ if attributes.key?(:'protocol')
135
+ self.protocol = attributes[:'protocol']
136
+ else
137
+ self.protocol = nil
138
+ end
139
+
140
+ if attributes.key?(:'scheme')
141
+ self.scheme = attributes[:'scheme']
142
+ end
143
+
144
+ if attributes.key?(:'network')
145
+ self.network = attributes[:'network']
146
+ end
147
+
148
+ if attributes.key?(:'asset')
149
+ self.asset = attributes[:'asset']
150
+ end
151
+
152
+ if attributes.key?(:'asset_decimals')
153
+ self.asset_decimals = attributes[:'asset_decimals']
154
+ end
155
+
156
+ if attributes.key?(:'price')
157
+ self.price = attributes[:'price']
158
+ else
159
+ self.price = nil
160
+ end
161
+
162
+ if attributes.key?(:'merchant')
163
+ self.merchant = attributes[:'merchant']
164
+ end
165
+
166
+ if attributes.key?(:'terms')
167
+ self.terms = attributes[:'terms']
168
+ end
169
+
170
+ if attributes.key?(:'status')
171
+ self.status = attributes[:'status']
172
+ end
173
+
174
+ if attributes.key?(:'weft_fetch')
175
+ self.weft_fetch = attributes[:'weft_fetch']
176
+ else
177
+ self.weft_fetch = nil
178
+ end
179
+ end
180
+
181
+ # Show invalid properties with the reasons. Usually used together with valid?
182
+ # @return Array for valid properties with the reasons
183
+ def list_invalid_properties
184
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
185
+ invalid_properties = Array.new
186
+ if @access_method_id.nil?
187
+ invalid_properties.push('invalid value for "access_method_id", access_method_id cannot be nil.')
188
+ end
189
+
190
+ if @protocol.nil?
191
+ invalid_properties.push('invalid value for "protocol", protocol cannot be nil.')
192
+ end
193
+
194
+ if @price.nil?
195
+ invalid_properties.push('invalid value for "price", price cannot be nil.')
196
+ end
197
+
198
+ if @weft_fetch.nil?
199
+ invalid_properties.push('invalid value for "weft_fetch", weft_fetch cannot be nil.')
200
+ end
201
+
202
+ invalid_properties
203
+ end
204
+
205
+ # Check to see if the all the properties in the model are valid
206
+ # @return true if the model is valid
207
+ def valid?
208
+ warn '[DEPRECATED] the `valid?` method is obsolete'
209
+ return false if @access_method_id.nil?
210
+ return false if @protocol.nil?
211
+ protocol_validator = EnumAttributeValidator.new('String', ["x402", "mpp", "free"])
212
+ return false unless protocol_validator.valid?(@protocol)
213
+ return false if @price.nil?
214
+ status_validator = EnumAttributeValidator.new('String', ["listed", "observed", "unavailable"])
215
+ return false unless status_validator.valid?(@status)
216
+ return false if @weft_fetch.nil?
217
+ true
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] access_method_id Value to be assigned
222
+ def access_method_id=(access_method_id)
223
+ if access_method_id.nil?
224
+ fail ArgumentError, 'access_method_id cannot be nil'
225
+ end
226
+
227
+ @access_method_id = access_method_id
228
+ end
229
+
230
+ # Custom attribute writer method checking allowed values (enum).
231
+ # @param [Object] protocol Object to be assigned
232
+ def protocol=(protocol)
233
+ validator = EnumAttributeValidator.new('String', ["x402", "mpp", "free"])
234
+ unless validator.valid?(protocol)
235
+ fail ArgumentError, "invalid value for \"protocol\", must be one of #{validator.allowable_values}."
236
+ end
237
+ @protocol = protocol
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] price Value to be assigned
242
+ def price=(price)
243
+ if price.nil?
244
+ fail ArgumentError, 'price cannot be nil'
245
+ end
246
+
247
+ @price = price
248
+ end
249
+
250
+ # Custom attribute writer method checking allowed values (enum).
251
+ # @param [Object] status Object to be assigned
252
+ def status=(status)
253
+ validator = EnumAttributeValidator.new('String', ["listed", "observed", "unavailable"])
254
+ unless validator.valid?(status)
255
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
256
+ end
257
+ @status = status
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] weft_fetch Value to be assigned
262
+ def weft_fetch=(weft_fetch)
263
+ if weft_fetch.nil?
264
+ fail ArgumentError, 'weft_fetch cannot be nil'
265
+ end
266
+
267
+ @weft_fetch = weft_fetch
268
+ end
269
+
270
+ # Checks equality by comparing each attribute.
271
+ # @param [Object] Object to be compared
272
+ def ==(o)
273
+ return true if self.equal?(o)
274
+ self.class == o.class &&
275
+ access_method_id == o.access_method_id &&
276
+ protocol == o.protocol &&
277
+ scheme == o.scheme &&
278
+ network == o.network &&
279
+ asset == o.asset &&
280
+ asset_decimals == o.asset_decimals &&
281
+ price == o.price &&
282
+ merchant == o.merchant &&
283
+ terms == o.terms &&
284
+ status == o.status &&
285
+ weft_fetch == o.weft_fetch
286
+ end
287
+
288
+ # @see the `==` method
289
+ # @param [Object] Object to be compared
290
+ def eql?(o)
291
+ self == o
292
+ end
293
+
294
+ # Calculates hash code according to all attributes.
295
+ # @return [Integer] Hash code
296
+ def hash
297
+ [access_method_id, protocol, scheme, network, asset, asset_decimals, price, merchant, terms, status, weft_fetch].hash
298
+ end
299
+
300
+ # Builds the object from hash
301
+ # @param [Hash] attributes Model attributes in the form of hash
302
+ # @return [Object] Returns the model itself
303
+ def self.build_from_hash(attributes)
304
+ return nil unless attributes.is_a?(Hash)
305
+ attributes = attributes.transform_keys(&:to_sym)
306
+ transformed_hash = {}
307
+ openapi_types.each_pair do |key, type|
308
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
309
+ transformed_hash["#{key}"] = nil
310
+ elsif type =~ /\AArray<(.*)>/i
311
+ # check to ensure the input is an array given that the attribute
312
+ # is documented as an array but the input is not
313
+ if attributes[attribute_map[key]].is_a?(Array)
314
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
315
+ end
316
+ elsif !attributes[attribute_map[key]].nil?
317
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
318
+ end
319
+ end
320
+ new(transformed_hash)
321
+ end
322
+
323
+ # Returns the object in the form of hash
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_hash
326
+ hash = {}
327
+ self.class.attribute_map.each_pair do |attr, param|
328
+ value = self.send(attr)
329
+ if value.nil?
330
+ is_nullable = self.class.openapi_nullable.include?(attr)
331
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
332
+ end
333
+
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ end
340
+
341
+ end
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key or an OAuth access token with the relevant scope. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. The two key types are not interchangeable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
4
+ #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key, an OAuth access token with the relevant scope, or a claimed `wbt_*` bearer on its fixed allowlist. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. These credential types are not interchangeable. Before claim, a `wbt_*` bearer is temporary and permits only search plus its own status/cancel operations for 30 minutes. Human approval binds it to the User and promotes the same secret to durable identity, search, balance, fetch, purchase-history, status, and revocation capabilities. It remains valid until revoked. Seller, organization, API-key administration, dashboard-session, transfer, withdrawal, and MCP surfaces always refuse it. Bootstrap lifecycle successes follow the API-standard `{ \"data\": ... }` envelope. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
5
5
 
6
- The version of the OpenAPI document: 0.10.1
6
+ The version of the OpenAPI document: 0.14.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #The Weft API powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and third-party applications that discover and pay for resources on Weft. The buyer runtime covers six concerns: 1. Account creation and recovery (`/api/v1/auth/*`) 2. Credential identity (`/api/v1/me`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Buyer runtime calls require a dashboard-created `wk_*` account key, an OAuth access token with the relevant scope, or a claimed `wbt_*` bearer on its fixed allowlist. The organization-scoped API key and payment operations in this document are seller administration surfaces and require an `ax_live_*` resource key. These credential types are not interchangeable. Before claim, a `wbt_*` bearer is temporary and permits only search plus its own status/cancel operations for 30 minutes. Human approval binds it to the User and promotes the same secret to durable identity, search, balance, fetch, purchase-history, status, and revocation capabilities. It remains valid until revoked. Seller, organization, API-key administration, dashboard-session, transfer, withdrawal, and MCP surfaces always refuse it. Bootstrap lifecycle successes follow the API-standard `{ \"data\": ... }` envelope. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
5
+
6
+ The version of the OpenAPI document: 0.14.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Weft
17
+ class SearchCuratedCallability < ApiModelBase
18
+ attr_accessor :state
19
+
20
+ attr_accessor :missing
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'state' => :'state',
48
+ :'missing' => :'missing'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'state' => :'String',
66
+ :'missing' => :'Array<String>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchCuratedCallability` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchCuratedCallability`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'state')
93
+ self.state = attributes[:'state']
94
+ else
95
+ self.state = nil
96
+ end
97
+
98
+ if attributes.key?(:'missing')
99
+ if (value = attributes[:'missing']).is_a?(Array)
100
+ self.missing = value
101
+ end
102
+ else
103
+ self.missing = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @state.nil?
113
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
114
+ end
115
+
116
+ if @missing.nil?
117
+ invalid_properties.push('invalid value for "missing", missing cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @state.nil?
128
+ state_validator = EnumAttributeValidator.new('String', ["complete", "incomplete"])
129
+ return false unless state_validator.valid?(@state)
130
+ return false if @missing.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] state Object to be assigned
136
+ def state=(state)
137
+ validator = EnumAttributeValidator.new('String', ["complete", "incomplete"])
138
+ unless validator.valid?(state)
139
+ fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @state = state
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] missing Value to be assigned
146
+ def missing=(missing)
147
+ if missing.nil?
148
+ fail ArgumentError, 'missing cannot be nil'
149
+ end
150
+
151
+ @missing = missing
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ state == o.state &&
160
+ missing == o.missing
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [state, missing].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end