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
@@ -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
@@ -17,10 +17,13 @@ module Weft
17
17
  class ApiKeyListResponse < ApiModelBase
18
18
  attr_accessor :data
19
19
 
20
+ attr_accessor :pagination
21
+
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
23
- :'data' => :'data'
25
+ :'data' => :'data',
26
+ :'pagination' => :'pagination'
24
27
  }
25
28
  end
26
29
 
@@ -37,7 +40,8 @@ module Weft
37
40
  # Attribute type mapping.
38
41
  def self.openapi_types
39
42
  {
40
- :'data' => :'Array<ApiKey>'
43
+ :'data' => :'Array<ApiKey>',
44
+ :'pagination' => :'Pagination'
41
45
  }
42
46
  end
43
47
 
@@ -70,6 +74,12 @@ module Weft
70
74
  else
71
75
  self.data = nil
72
76
  end
77
+
78
+ if attributes.key?(:'pagination')
79
+ self.pagination = attributes[:'pagination']
80
+ else
81
+ self.pagination = nil
82
+ end
73
83
  end
74
84
 
75
85
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -81,6 +91,10 @@ module Weft
81
91
  invalid_properties.push('invalid value for "data", data cannot be nil.')
82
92
  end
83
93
 
94
+ if @pagination.nil?
95
+ invalid_properties.push('invalid value for "pagination", pagination cannot be nil.')
96
+ end
97
+
84
98
  invalid_properties
85
99
  end
86
100
 
@@ -89,6 +103,7 @@ module Weft
89
103
  def valid?
90
104
  warn '[DEPRECATED] the `valid?` method is obsolete'
91
105
  return false if @data.nil?
106
+ return false if @pagination.nil?
92
107
  true
93
108
  end
94
109
 
@@ -102,12 +117,23 @@ module Weft
102
117
  @data = data
103
118
  end
104
119
 
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] pagination Value to be assigned
122
+ def pagination=(pagination)
123
+ if pagination.nil?
124
+ fail ArgumentError, 'pagination cannot be nil'
125
+ end
126
+
127
+ @pagination = pagination
128
+ end
129
+
105
130
  # Checks equality by comparing each attribute.
106
131
  # @param [Object] Object to be compared
107
132
  def ==(o)
108
133
  return true if self.equal?(o)
109
134
  self.class == o.class &&
110
- data == o.data
135
+ data == o.data &&
136
+ pagination == o.pagination
111
137
  end
112
138
 
113
139
  # @see the `==` method
@@ -119,7 +145,7 @@ module Weft
119
145
  # Calculates hash code according to all attributes.
120
146
  # @return [Integer] Hash code
121
147
  def hash
122
- [data].hash
148
+ [data, pagination].hash
123
149
  end
124
150
 
125
151
  # Builds the object from hash
@@ -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,271 @@
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
+ # Buyer's wallet snapshot. Note: unlike `/me` / `/payments` / `/api_keys`, this endpoint does NOT use a `data:` envelope — the response object is the snapshot directly.
18
+ class BalanceResponse < ApiModelBase
19
+ attr_accessor :promo
20
+
21
+ attr_accessor :wallet
22
+
23
+ # USD spent in the current calendar day (UTC), 2dp.
24
+ attr_accessor :spent_today_usd
25
+
26
+ # USD spent in the current calendar week (UTC, Monday start), 2dp.
27
+ attr_accessor :spent_week_usd
28
+
29
+ attr_accessor :policy
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'promo' => :'promo',
35
+ :'wallet' => :'wallet',
36
+ :'spent_today_usd' => :'spent_today_usd',
37
+ :'spent_week_usd' => :'spent_week_usd',
38
+ :'policy' => :'policy'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'promo' => :'PromoBalance',
56
+ :'wallet' => :'Wallet',
57
+ :'spent_today_usd' => :'String',
58
+ :'spent_week_usd' => :'String',
59
+ :'policy' => :'SpendingPolicy'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::BalanceResponse` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!acceptable_attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::BalanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'promo')
86
+ self.promo = attributes[:'promo']
87
+ else
88
+ self.promo = nil
89
+ end
90
+
91
+ if attributes.key?(:'wallet')
92
+ self.wallet = attributes[:'wallet']
93
+ else
94
+ self.wallet = nil
95
+ end
96
+
97
+ if attributes.key?(:'spent_today_usd')
98
+ self.spent_today_usd = attributes[:'spent_today_usd']
99
+ else
100
+ self.spent_today_usd = nil
101
+ end
102
+
103
+ if attributes.key?(:'spent_week_usd')
104
+ self.spent_week_usd = attributes[:'spent_week_usd']
105
+ else
106
+ self.spent_week_usd = nil
107
+ end
108
+
109
+ if attributes.key?(:'policy')
110
+ self.policy = attributes[:'policy']
111
+ else
112
+ self.policy = nil
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @promo.nil?
122
+ invalid_properties.push('invalid value for "promo", promo cannot be nil.')
123
+ end
124
+
125
+ if @wallet.nil?
126
+ invalid_properties.push('invalid value for "wallet", wallet cannot be nil.')
127
+ end
128
+
129
+ if @spent_today_usd.nil?
130
+ invalid_properties.push('invalid value for "spent_today_usd", spent_today_usd cannot be nil.')
131
+ end
132
+
133
+ if @spent_week_usd.nil?
134
+ invalid_properties.push('invalid value for "spent_week_usd", spent_week_usd cannot be nil.')
135
+ end
136
+
137
+ if @policy.nil?
138
+ invalid_properties.push('invalid value for "policy", policy cannot be nil.')
139
+ end
140
+
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ warn '[DEPRECATED] the `valid?` method is obsolete'
148
+ return false if @promo.nil?
149
+ return false if @wallet.nil?
150
+ return false if @spent_today_usd.nil?
151
+ return false if @spent_week_usd.nil?
152
+ return false if @policy.nil?
153
+ true
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] promo Value to be assigned
158
+ def promo=(promo)
159
+ if promo.nil?
160
+ fail ArgumentError, 'promo cannot be nil'
161
+ end
162
+
163
+ @promo = promo
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] wallet Value to be assigned
168
+ def wallet=(wallet)
169
+ if wallet.nil?
170
+ fail ArgumentError, 'wallet cannot be nil'
171
+ end
172
+
173
+ @wallet = wallet
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] spent_today_usd Value to be assigned
178
+ def spent_today_usd=(spent_today_usd)
179
+ if spent_today_usd.nil?
180
+ fail ArgumentError, 'spent_today_usd cannot be nil'
181
+ end
182
+
183
+ @spent_today_usd = spent_today_usd
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] spent_week_usd Value to be assigned
188
+ def spent_week_usd=(spent_week_usd)
189
+ if spent_week_usd.nil?
190
+ fail ArgumentError, 'spent_week_usd cannot be nil'
191
+ end
192
+
193
+ @spent_week_usd = spent_week_usd
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] policy Value to be assigned
198
+ def policy=(policy)
199
+ if policy.nil?
200
+ fail ArgumentError, 'policy cannot be nil'
201
+ end
202
+
203
+ @policy = policy
204
+ end
205
+
206
+ # Checks equality by comparing each attribute.
207
+ # @param [Object] Object to be compared
208
+ def ==(o)
209
+ return true if self.equal?(o)
210
+ self.class == o.class &&
211
+ promo == o.promo &&
212
+ wallet == o.wallet &&
213
+ spent_today_usd == o.spent_today_usd &&
214
+ spent_week_usd == o.spent_week_usd &&
215
+ policy == o.policy
216
+ end
217
+
218
+ # @see the `==` method
219
+ # @param [Object] Object to be compared
220
+ def eql?(o)
221
+ self == o
222
+ end
223
+
224
+ # Calculates hash code according to all attributes.
225
+ # @return [Integer] Hash code
226
+ def hash
227
+ [promo, wallet, spent_today_usd, spent_week_usd, policy].hash
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def self.build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ attributes = attributes.transform_keys(&:to_sym)
236
+ transformed_hash = {}
237
+ openapi_types.each_pair do |key, type|
238
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
239
+ transformed_hash["#{key}"] = nil
240
+ elsif type =~ /\AArray<(.*)>/i
241
+ # check to ensure the input is an array given that the attribute
242
+ # is documented as an array but the input is not
243
+ if attributes[attribute_map[key]].is_a?(Array)
244
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
245
+ end
246
+ elsif !attributes[attribute_map[key]].nil?
247
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
248
+ end
249
+ end
250
+ new(transformed_hash)
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ end
270
+
271
+ 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
@@ -14,13 +14,18 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Weft
17
+ # A single error inside an `ErrorResponse` envelope. `code` is the stable machine-readable identifier (snake_case), `message` is human-readable, `details` carries optional structured context (e.g. validation field breakdown), and `request_id` correlates with server logs for debugging.
17
18
  class Error < ApiModelBase
19
+ # Stable machine-readable error code (snake_case).
18
20
  attr_accessor :code
19
21
 
22
+ # Human-readable error description.
20
23
  attr_accessor :message
21
24
 
25
+ # Optional structured context about the failure.
22
26
  attr_accessor :details
23
27
 
28
+ # Correlates with server logs; include when reporting bugs.
24
29
  attr_accessor :request_id
25
30
 
26
31
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Weft
17
+ # Standard error envelope returned by all `/api/v1` endpoints except `/search` and `/fetch` (which use bespoke envelopes carrying additional context). `error.code` is stable across releases and safe to branch on; `error.message` is human-readable and may change.
17
18
  class ErrorResponse < ApiModelBase
18
19
  attr_accessor :error
19
20