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
@@ -0,0 +1,181 @@
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 SearchCuratedExecution < ApiModelBase
18
+ attr_accessor :mode
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'mode' => :'mode'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'mode' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchCuratedExecution` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchCuratedExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'mode')
89
+ self.mode = attributes[:'mode']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ mode_validator = EnumAttributeValidator.new('String', ["sync", "async", "stream"])
106
+ return false unless mode_validator.valid?(@mode)
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method checking allowed values (enum).
111
+ # @param [Object] mode Object to be assigned
112
+ def mode=(mode)
113
+ validator = EnumAttributeValidator.new('String', ["sync", "async", "stream"])
114
+ unless validator.valid?(mode)
115
+ fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}."
116
+ end
117
+ @mode = mode
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ mode == o.mode
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [mode].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ transformed_hash = {}
147
+ openapi_types.each_pair do |key, type|
148
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = nil
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[attribute_map[key]].is_a?(Array)
154
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
+ end
156
+ elsif !attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
+ end
159
+ end
160
+ new(transformed_hash)
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ if value.nil?
170
+ is_nullable = self.class.openapi_nullable.include?(attr)
171
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
+ end
173
+
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ end
180
+
181
+ end
@@ -0,0 +1,199 @@
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 SearchCuratedOperation < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :description
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'name' => :'name',
29
+ :'description' => :'description'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'id' => :'String',
47
+ :'name' => :'String',
48
+ :'description' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchCuratedOperation` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchCuratedOperation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'id')
75
+ self.id = attributes[:'id']
76
+ else
77
+ self.id = nil
78
+ end
79
+
80
+ if attributes.key?(:'name')
81
+ self.name = attributes[:'name']
82
+ else
83
+ self.name = nil
84
+ end
85
+
86
+ if attributes.key?(:'description')
87
+ self.description = attributes[:'description']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @id.nil?
97
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
98
+ end
99
+
100
+ if @name.nil?
101
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @id.nil?
112
+ return false if @name.nil?
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] id Value to be assigned
118
+ def id=(id)
119
+ if id.nil?
120
+ fail ArgumentError, 'id cannot be nil'
121
+ end
122
+
123
+ @id = id
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] name Value to be assigned
128
+ def name=(name)
129
+ if name.nil?
130
+ fail ArgumentError, 'name cannot be nil'
131
+ end
132
+
133
+ @name = name
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ id == o.id &&
142
+ name == o.name &&
143
+ description == o.description
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [id, name, description].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end
@@ -0,0 +1,190 @@
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 SearchCuratedService < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'name' => :'name'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'id' => :'String',
44
+ :'name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchCuratedService` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchCuratedService`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ else
73
+ self.id = nil
74
+ end
75
+
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ else
79
+ self.name = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
90
+ end
91
+
92
+ if @name.nil?
93
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @id.nil?
104
+ return false if @name.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] id Value to be assigned
110
+ def id=(id)
111
+ if id.nil?
112
+ fail ArgumentError, 'id cannot be nil'
113
+ end
114
+
115
+ @id = id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] name Value to be assigned
120
+ def name=(name)
121
+ if name.nil?
122
+ fail ArgumentError, 'name cannot be nil'
123
+ end
124
+
125
+ @name = name
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ id == o.id &&
134
+ name == o.name
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [id, name].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end