weft-sdk 0.3.0 → 0.5.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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/docs/ApiKeyListResponse.md +3 -1
  3. data/docs/BalanceApi.md +74 -0
  4. data/docs/BalanceResponse.md +26 -0
  5. data/docs/DefaultApi.md +12 -12
  6. data/docs/Error.md +7 -7
  7. data/docs/FetchApi.md +77 -0
  8. data/docs/FetchBalanceSnapshot.md +22 -0
  9. data/docs/FetchErrorResponse.md +26 -0
  10. data/docs/FetchRequest.md +26 -0
  11. data/docs/FetchRequestBody.md +49 -0
  12. data/docs/FetchResponse.md +30 -0
  13. data/docs/Merchant.md +24 -0
  14. data/docs/PromoBalance.md +22 -0
  15. data/docs/SearchAgentCard.md +34 -0
  16. data/docs/SearchApi.md +77 -0
  17. data/docs/SearchEndpoints.md +24 -0
  18. data/docs/SearchErrorResponse.md +20 -0
  19. data/docs/SearchFilters.md +26 -0
  20. data/docs/SearchPricing.md +24 -0
  21. data/docs/SearchRanking.md +26 -0
  22. data/docs/SearchRequest.md +22 -0
  23. data/docs/SearchResponse.md +26 -0
  24. data/docs/SearchResult.md +36 -0
  25. data/docs/SearchSkill.md +36 -0
  26. data/docs/SearchSkillEndpoint.md +20 -0
  27. data/docs/SpendingPolicy.md +22 -0
  28. data/docs/Wallet.md +22 -0
  29. data/lib/weft/generated/api/account_api.rb +2 -2
  30. data/lib/weft/generated/api/api_keys_api.rb +2 -2
  31. data/lib/weft/generated/api/auth_api.rb +2 -2
  32. data/lib/weft/generated/api/balance_api.rb +79 -0
  33. data/lib/weft/generated/api/default_api.rb +11 -11
  34. data/lib/weft/generated/api/fetch_api.rb +90 -0
  35. data/lib/weft/generated/api/payments_api.rb +2 -2
  36. data/lib/weft/generated/api/search_api.rb +90 -0
  37. data/lib/weft/generated/api_client.rb +2 -2
  38. data/lib/weft/generated/api_error.rb +2 -2
  39. data/lib/weft/generated/api_model_base.rb +2 -2
  40. data/lib/weft/generated/configuration.rb +2 -2
  41. data/lib/weft/generated/models/account_details.rb +2 -2
  42. data/lib/weft/generated/models/api_key.rb +2 -2
  43. data/lib/weft/generated/models/api_key_created.rb +2 -2
  44. data/lib/weft/generated/models/api_key_created_response.rb +2 -2
  45. data/lib/weft/generated/models/api_key_list_response.rb +32 -6
  46. data/lib/weft/generated/models/auth_response.rb +2 -2
  47. data/lib/weft/generated/models/auth_response_data.rb +2 -2
  48. data/lib/weft/generated/models/balance_response.rb +271 -0
  49. data/lib/weft/generated/models/confirm_request.rb +2 -2
  50. data/lib/weft/generated/models/create_api_key_request.rb +2 -2
  51. data/lib/weft/generated/models/error.rb +7 -2
  52. data/lib/weft/generated/models/error_response.rb +3 -2
  53. data/lib/weft/generated/models/fetch_balance_snapshot.rb +217 -0
  54. data/lib/weft/generated/models/fetch_error_response.rb +298 -0
  55. data/lib/weft/generated/models/fetch_request.rb +266 -0
  56. data/lib/weft/generated/models/fetch_request_body.rb +105 -0
  57. data/lib/weft/generated/models/fetch_response.rb +330 -0
  58. data/lib/weft/generated/models/me_response.rb +2 -2
  59. data/lib/weft/generated/models/merchant.rb +264 -0
  60. data/lib/weft/generated/models/message_response.rb +2 -2
  61. data/lib/weft/generated/models/message_response_data.rb +2 -2
  62. data/lib/weft/generated/models/pagination.rb +2 -2
  63. data/lib/weft/generated/models/password_reset_request.rb +2 -2
  64. data/lib/weft/generated/models/password_update_request.rb +2 -2
  65. data/lib/weft/generated/models/payment.rb +2 -2
  66. data/lib/weft/generated/models/payment_list_response.rb +2 -2
  67. data/lib/weft/generated/models/payment_response.rb +2 -2
  68. data/lib/weft/generated/models/promo_balance.rb +218 -0
  69. data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
  70. data/lib/weft/generated/models/search_agent_card.rb +228 -0
  71. data/lib/weft/generated/models/{agent_stats.rb → search_endpoints.rb} +33 -57
  72. data/lib/weft/generated/models/search_error_response.rb +202 -0
  73. data/lib/weft/generated/models/search_filters.rb +277 -0
  74. data/lib/weft/generated/models/search_pricing.rb +232 -0
  75. data/lib/weft/generated/models/search_ranking.rb +277 -0
  76. data/lib/weft/generated/models/search_request.rb +223 -0
  77. data/lib/weft/generated/models/{agent_response.rb → search_response.rb} +64 -21
  78. data/lib/weft/generated/models/search_result.rb +414 -0
  79. data/lib/weft/generated/models/search_skill.rb +259 -0
  80. data/lib/weft/generated/models/{agent_list_response.rb → search_skill_endpoint.rb} +19 -54
  81. data/lib/weft/generated/models/sign_in_request.rb +2 -2
  82. data/lib/weft/generated/models/sign_up_request.rb +2 -2
  83. data/lib/weft/generated/models/spending_policy.rb +219 -0
  84. data/lib/weft/generated/models/user.rb +2 -2
  85. data/lib/weft/generated/models/wallet.rb +219 -0
  86. data/lib/weft/generated/version.rb +3 -3
  87. data/lib/weft/sdk.rb +1 -1
  88. metadata +50 -12
  89. data/docs/Agent.md +0 -38
  90. data/docs/AgentListResponse.md +0 -20
  91. data/docs/AgentResponse.md +0 -18
  92. data/docs/AgentStats.md +0 -30
  93. data/docs/AgentsApi.md +0 -147
  94. data/lib/weft/generated/api/agents_api.rb +0 -148
  95. data/lib/weft/generated/models/agent.rb +0 -417
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.5.0
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 Merchant < ApiModelBase
18
+ # EVM address that received the payment.
19
+ attr_accessor :address
20
+
21
+ # All-time settlement count for this merchant address.
22
+ attr_accessor :settlement_count
23
+
24
+ # First time Weft observed a payment to this address.
25
+ attr_accessor :first_seen_at
26
+
27
+ # All-time dispute count for this merchant address.
28
+ attr_accessor :dispute_count
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'address' => :'address',
34
+ :'settlement_count' => :'settlement_count',
35
+ :'first_seen_at' => :'first_seen_at',
36
+ :'dispute_count' => :'dispute_count'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'address' => :'String',
54
+ :'settlement_count' => :'Integer',
55
+ :'first_seen_at' => :'Time',
56
+ :'dispute_count' => :'Integer'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::Merchant` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::Merchant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'address')
83
+ self.address = attributes[:'address']
84
+ else
85
+ self.address = nil
86
+ end
87
+
88
+ if attributes.key?(:'settlement_count')
89
+ self.settlement_count = attributes[:'settlement_count']
90
+ else
91
+ self.settlement_count = nil
92
+ end
93
+
94
+ if attributes.key?(:'first_seen_at')
95
+ self.first_seen_at = attributes[:'first_seen_at']
96
+ else
97
+ self.first_seen_at = nil
98
+ end
99
+
100
+ if attributes.key?(:'dispute_count')
101
+ self.dispute_count = attributes[:'dispute_count']
102
+ else
103
+ self.dispute_count = 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 @address.nil?
113
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
114
+ end
115
+
116
+ if @settlement_count.nil?
117
+ invalid_properties.push('invalid value for "settlement_count", settlement_count cannot be nil.')
118
+ end
119
+
120
+ if @settlement_count < 0
121
+ invalid_properties.push('invalid value for "settlement_count", must be greater than or equal to 0.')
122
+ end
123
+
124
+ if @first_seen_at.nil?
125
+ invalid_properties.push('invalid value for "first_seen_at", first_seen_at cannot be nil.')
126
+ end
127
+
128
+ if @dispute_count.nil?
129
+ invalid_properties.push('invalid value for "dispute_count", dispute_count cannot be nil.')
130
+ end
131
+
132
+ if @dispute_count < 0
133
+ invalid_properties.push('invalid value for "dispute_count", must be greater than or equal to 0.')
134
+ end
135
+
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ return false if @address.nil?
144
+ return false if @settlement_count.nil?
145
+ return false if @settlement_count < 0
146
+ return false if @first_seen_at.nil?
147
+ return false if @dispute_count.nil?
148
+ return false if @dispute_count < 0
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] address Value to be assigned
154
+ def address=(address)
155
+ if address.nil?
156
+ fail ArgumentError, 'address cannot be nil'
157
+ end
158
+
159
+ @address = address
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] settlement_count Value to be assigned
164
+ def settlement_count=(settlement_count)
165
+ if settlement_count.nil?
166
+ fail ArgumentError, 'settlement_count cannot be nil'
167
+ end
168
+
169
+ if settlement_count < 0
170
+ fail ArgumentError, 'invalid value for "settlement_count", must be greater than or equal to 0.'
171
+ end
172
+
173
+ @settlement_count = settlement_count
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] first_seen_at Value to be assigned
178
+ def first_seen_at=(first_seen_at)
179
+ if first_seen_at.nil?
180
+ fail ArgumentError, 'first_seen_at cannot be nil'
181
+ end
182
+
183
+ @first_seen_at = first_seen_at
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] dispute_count Value to be assigned
188
+ def dispute_count=(dispute_count)
189
+ if dispute_count.nil?
190
+ fail ArgumentError, 'dispute_count cannot be nil'
191
+ end
192
+
193
+ if dispute_count < 0
194
+ fail ArgumentError, 'invalid value for "dispute_count", must be greater than or equal to 0.'
195
+ end
196
+
197
+ @dispute_count = dispute_count
198
+ end
199
+
200
+ # Checks equality by comparing each attribute.
201
+ # @param [Object] Object to be compared
202
+ def ==(o)
203
+ return true if self.equal?(o)
204
+ self.class == o.class &&
205
+ address == o.address &&
206
+ settlement_count == o.settlement_count &&
207
+ first_seen_at == o.first_seen_at &&
208
+ dispute_count == o.dispute_count
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [address, settlement_count, first_seen_at, dispute_count].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ attributes = attributes.transform_keys(&:to_sym)
229
+ transformed_hash = {}
230
+ openapi_types.each_pair do |key, type|
231
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = nil
233
+ elsif type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[attribute_map[key]].is_a?(Array)
237
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
238
+ end
239
+ elsif !attributes[attribute_map[key]].nil?
240
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
241
+ end
242
+ end
243
+ new(transformed_hash)
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ end
263
+
264
+ end
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.5.0
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
+ # Freemium promo credit. v1 returns zero values; once the promo ledger ships (deferred from spec 10), real balances appear here without a shape change.
18
+ class PromoBalance < ApiModelBase
19
+ attr_accessor :balance_usd
20
+
21
+ # Where the promo can be spent.
22
+ attr_accessor :scope
23
+
24
+ attr_accessor :expires_at
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'balance_usd' => :'balance_usd',
30
+ :'scope' => :'scope',
31
+ :'expires_at' => :'expires_at'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'balance_usd' => :'String',
49
+ :'scope' => :'String',
50
+ :'expires_at' => :'Time'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::PromoBalance` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::PromoBalance`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'balance_usd')
77
+ self.balance_usd = attributes[:'balance_usd']
78
+ else
79
+ self.balance_usd = nil
80
+ end
81
+
82
+ if attributes.key?(:'scope')
83
+ self.scope = attributes[:'scope']
84
+ else
85
+ self.scope = nil
86
+ end
87
+
88
+ if attributes.key?(:'expires_at')
89
+ self.expires_at = attributes[:'expires_at']
90
+ else
91
+ self.expires_at = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @balance_usd.nil?
101
+ invalid_properties.push('invalid value for "balance_usd", balance_usd cannot be nil.')
102
+ end
103
+
104
+ if @scope.nil?
105
+ invalid_properties.push('invalid value for "scope", scope cannot be nil.')
106
+ end
107
+
108
+ if @expires_at.nil?
109
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @balance_usd.nil?
120
+ return false if @scope.nil?
121
+ return false if @expires_at.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] balance_usd Value to be assigned
127
+ def balance_usd=(balance_usd)
128
+ if balance_usd.nil?
129
+ fail ArgumentError, 'balance_usd cannot be nil'
130
+ end
131
+
132
+ @balance_usd = balance_usd
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] scope Value to be assigned
137
+ def scope=(scope)
138
+ if scope.nil?
139
+ fail ArgumentError, 'scope cannot be nil'
140
+ end
141
+
142
+ @scope = scope
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] expires_at Value to be assigned
147
+ def expires_at=(expires_at)
148
+ if expires_at.nil?
149
+ fail ArgumentError, 'expires_at cannot be nil'
150
+ end
151
+
152
+ @expires_at = expires_at
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ balance_usd == o.balance_usd &&
161
+ scope == o.scope &&
162
+ expires_at == o.expires_at
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [balance_usd, scope, expires_at].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Weft API
3
3
 
4
- #API for agent-first payments and discovery.
4
+ #The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/payments`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. 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.3.0
6
+ The version of the OpenAPI document: 0.5.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.19.0