weft-sdk 0.6.1 → 0.7.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.
- checksums.yaml +4 -4
- data/docs/AccountDetails.md +8 -12
- data/docs/EnrolledResource.md +44 -0
- data/docs/Fetch403Response.md +49 -0
- data/docs/FetchBalanceSnapshot.md +5 -1
- data/docs/FetchResponse.md +1 -1
- data/docs/InsufficientScopeResponse.md +22 -0
- data/docs/MeApiKey.md +26 -0
- data/docs/MeApiKeyCreator.md +22 -0
- data/docs/ResourceEnrollmentRequest.md +24 -0
- data/docs/ResourceEnrollmentResponse.md +18 -0
- data/docs/ResourceStats.md +30 -0
- data/docs/ResourcesApi.md +72 -0
- data/docs/SearchFilters.md +1 -1
- data/docs/SearchResponse.md +1 -1
- data/docs/SearchResponseResultsInner.md +36 -0
- data/docs/Wallet.md +5 -1
- data/lib/weft/generated/api/account_api.rb +1 -1
- data/lib/weft/generated/api/api_keys_api.rb +1 -1
- data/lib/weft/generated/api/auth_api.rb +1 -1
- data/lib/weft/generated/api/balance_api.rb +1 -1
- data/lib/weft/generated/api/default_api.rb +1 -1
- data/lib/weft/generated/api/fetch_api.rb +1 -1
- data/lib/weft/generated/api/payments_api.rb +1 -1
- data/lib/weft/generated/api/resources_api.rb +90 -0
- data/lib/weft/generated/api/search_api.rb +1 -1
- data/lib/weft/generated/api_client.rb +1 -1
- data/lib/weft/generated/api_error.rb +1 -1
- data/lib/weft/generated/api_model_base.rb +1 -1
- data/lib/weft/generated/configuration.rb +1 -1
- data/lib/weft/generated/models/account_details.rb +65 -106
- data/lib/weft/generated/models/api_key.rb +1 -1
- data/lib/weft/generated/models/api_key_created.rb +1 -1
- data/lib/weft/generated/models/api_key_created_response.rb +1 -1
- data/lib/weft/generated/models/api_key_list_response.rb +1 -1
- data/lib/weft/generated/models/auth_response.rb +1 -1
- data/lib/weft/generated/models/auth_response_data.rb +1 -1
- data/lib/weft/generated/models/balance_response.rb +1 -1
- data/lib/weft/generated/models/confirm_request.rb +1 -1
- data/lib/weft/generated/models/create_api_key_request.rb +1 -1
- data/lib/weft/generated/models/enrolled_resource.rb +474 -0
- data/lib/weft/generated/models/error.rb +1 -1
- data/lib/weft/generated/models/error_response.rb +1 -1
- data/lib/weft/generated/models/fetch403_response.rb +104 -0
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +58 -3
- data/lib/weft/generated/models/fetch_error_response.rb +4 -4
- data/lib/weft/generated/models/fetch_request.rb +1 -1
- data/lib/weft/generated/models/fetch_request_body.rb +1 -1
- data/lib/weft/generated/models/fetch_response.rb +3 -3
- data/lib/weft/generated/models/insufficient_scope_response.rb +242 -0
- data/lib/weft/generated/models/me_api_key.rb +217 -0
- data/lib/weft/generated/models/me_api_key_creator.rb +200 -0
- data/lib/weft/generated/models/me_response.rb +1 -1
- data/lib/weft/generated/models/merchant.rb +1 -1
- data/lib/weft/generated/models/message_response.rb +1 -1
- data/lib/weft/generated/models/message_response_data.rb +1 -1
- data/lib/weft/generated/models/pagination.rb +1 -1
- data/lib/weft/generated/models/password_reset_request.rb +1 -1
- data/lib/weft/generated/models/password_update_request.rb +1 -1
- data/lib/weft/generated/models/payment.rb +1 -1
- data/lib/weft/generated/models/payment_list_response.rb +1 -1
- data/lib/weft/generated/models/payment_response.rb +1 -1
- data/lib/weft/generated/models/promo_balance.rb +1 -1
- data/lib/weft/generated/models/resend_confirmation_request.rb +1 -1
- data/lib/weft/generated/models/resource_enrollment_request.rb +212 -0
- data/lib/weft/generated/models/resource_enrollment_response.rb +164 -0
- data/lib/weft/generated/models/resource_stats.rb +323 -0
- data/lib/weft/generated/models/search_agent_card.rb +1 -1
- data/lib/weft/generated/models/search_endpoints.rb +1 -1
- data/lib/weft/generated/models/search_error_response.rb +1 -1
- data/lib/weft/generated/models/search_filters.rb +4 -4
- data/lib/weft/generated/models/search_pricing.rb +1 -1
- data/lib/weft/generated/models/search_ranking.rb +1 -1
- data/lib/weft/generated/models/search_request.rb +1 -1
- data/lib/weft/generated/models/search_response.rb +3 -3
- data/lib/weft/generated/models/search_response_results_inner.rb +103 -0
- data/lib/weft/generated/models/search_result.rb +3 -3
- data/lib/weft/generated/models/search_skill.rb +1 -1
- data/lib/weft/generated/models/search_skill_endpoint.rb +1 -1
- data/lib/weft/generated/models/sign_in_request.rb +1 -1
- data/lib/weft/generated/models/sign_up_request.rb +1 -1
- data/lib/weft/generated/models/spending_policy.rb +1 -1
- data/lib/weft/generated/models/user.rb +1 -1
- data/lib/weft/generated/models/wallet.rb +57 -3
- data/lib/weft/generated/version.rb +2 -2
- data/lib/weft/sdk.rb +1 -1
- metadata +22 -2
|
@@ -0,0 +1,164 @@
|
|
|
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.7.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 ResourceEnrollmentResponse < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'data' => :'data'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'data' => :'EnrolledResource'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::ResourceEnrollmentResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::ResourceEnrollmentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'data')
|
|
67
|
+
self.data = attributes[:'data']
|
|
68
|
+
else
|
|
69
|
+
self.data = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @data.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @data.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] data Value to be assigned
|
|
95
|
+
def data=(data)
|
|
96
|
+
if data.nil?
|
|
97
|
+
fail ArgumentError, 'data cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@data = data
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
data == o.data
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[data].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = nil
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
@@ -0,0 +1,323 @@
|
|
|
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.7.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
|
+
# Aggregate public payment stats for the resource.
|
|
18
|
+
class ResourceStats < ApiModelBase
|
|
19
|
+
# Total atomic units paid out by this resource.
|
|
20
|
+
attr_accessor :total_paid
|
|
21
|
+
|
|
22
|
+
# Total atomic units received by this resource.
|
|
23
|
+
attr_accessor :total_received
|
|
24
|
+
|
|
25
|
+
attr_accessor :payments_made
|
|
26
|
+
|
|
27
|
+
attr_accessor :payments_received
|
|
28
|
+
|
|
29
|
+
attr_accessor :unique_counterparties
|
|
30
|
+
|
|
31
|
+
attr_accessor :first_seen
|
|
32
|
+
|
|
33
|
+
attr_accessor :last_active
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'total_paid' => :'total_paid',
|
|
39
|
+
:'total_received' => :'total_received',
|
|
40
|
+
:'payments_made' => :'payments_made',
|
|
41
|
+
:'payments_received' => :'payments_received',
|
|
42
|
+
:'unique_counterparties' => :'unique_counterparties',
|
|
43
|
+
:'first_seen' => :'first_seen',
|
|
44
|
+
:'last_active' => :'last_active'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'total_paid' => :'Integer',
|
|
62
|
+
:'total_received' => :'Integer',
|
|
63
|
+
:'payments_made' => :'Integer',
|
|
64
|
+
:'payments_received' => :'Integer',
|
|
65
|
+
:'unique_counterparties' => :'Integer',
|
|
66
|
+
:'first_seen' => :'Time',
|
|
67
|
+
:'last_active' => :'Time'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List of attributes with nullable: true
|
|
72
|
+
def self.openapi_nullable
|
|
73
|
+
Set.new([
|
|
74
|
+
])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes the object
|
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
79
|
+
def initialize(attributes = {})
|
|
80
|
+
if (!attributes.is_a?(Hash))
|
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::ResourceStats` initialize method"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::ResourceStats`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
|
+
end
|
|
90
|
+
h[k.to_sym] = v
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'total_paid')
|
|
94
|
+
self.total_paid = attributes[:'total_paid']
|
|
95
|
+
else
|
|
96
|
+
self.total_paid = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'total_received')
|
|
100
|
+
self.total_received = attributes[:'total_received']
|
|
101
|
+
else
|
|
102
|
+
self.total_received = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'payments_made')
|
|
106
|
+
self.payments_made = attributes[:'payments_made']
|
|
107
|
+
else
|
|
108
|
+
self.payments_made = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'payments_received')
|
|
112
|
+
self.payments_received = attributes[:'payments_received']
|
|
113
|
+
else
|
|
114
|
+
self.payments_received = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'unique_counterparties')
|
|
118
|
+
self.unique_counterparties = attributes[:'unique_counterparties']
|
|
119
|
+
else
|
|
120
|
+
self.unique_counterparties = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'first_seen')
|
|
124
|
+
self.first_seen = attributes[:'first_seen']
|
|
125
|
+
else
|
|
126
|
+
self.first_seen = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'last_active')
|
|
130
|
+
self.last_active = attributes[:'last_active']
|
|
131
|
+
else
|
|
132
|
+
self.last_active = nil
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
137
|
+
# @return Array for valid properties with the reasons
|
|
138
|
+
def list_invalid_properties
|
|
139
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
140
|
+
invalid_properties = Array.new
|
|
141
|
+
if @total_paid.nil?
|
|
142
|
+
invalid_properties.push('invalid value for "total_paid", total_paid cannot be nil.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if @total_received.nil?
|
|
146
|
+
invalid_properties.push('invalid value for "total_received", total_received cannot be nil.')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if @payments_made.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "payments_made", payments_made cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @payments_received.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "payments_received", payments_received cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @unique_counterparties.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "unique_counterparties", unique_counterparties cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if @first_seen.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "first_seen", first_seen cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if @last_active.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "last_active", last_active cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
invalid_properties
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Check to see if the all the properties in the model are valid
|
|
173
|
+
# @return true if the model is valid
|
|
174
|
+
def valid?
|
|
175
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
176
|
+
return false if @total_paid.nil?
|
|
177
|
+
return false if @total_received.nil?
|
|
178
|
+
return false if @payments_made.nil?
|
|
179
|
+
return false if @payments_received.nil?
|
|
180
|
+
return false if @unique_counterparties.nil?
|
|
181
|
+
return false if @first_seen.nil?
|
|
182
|
+
return false if @last_active.nil?
|
|
183
|
+
true
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] total_paid Value to be assigned
|
|
188
|
+
def total_paid=(total_paid)
|
|
189
|
+
if total_paid.nil?
|
|
190
|
+
fail ArgumentError, 'total_paid cannot be nil'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@total_paid = total_paid
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] total_received Value to be assigned
|
|
198
|
+
def total_received=(total_received)
|
|
199
|
+
if total_received.nil?
|
|
200
|
+
fail ArgumentError, 'total_received cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@total_received = total_received
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] payments_made Value to be assigned
|
|
208
|
+
def payments_made=(payments_made)
|
|
209
|
+
if payments_made.nil?
|
|
210
|
+
fail ArgumentError, 'payments_made cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
@payments_made = payments_made
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Custom attribute writer method with validation
|
|
217
|
+
# @param [Object] payments_received Value to be assigned
|
|
218
|
+
def payments_received=(payments_received)
|
|
219
|
+
if payments_received.nil?
|
|
220
|
+
fail ArgumentError, 'payments_received cannot be nil'
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
@payments_received = payments_received
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Custom attribute writer method with validation
|
|
227
|
+
# @param [Object] unique_counterparties Value to be assigned
|
|
228
|
+
def unique_counterparties=(unique_counterparties)
|
|
229
|
+
if unique_counterparties.nil?
|
|
230
|
+
fail ArgumentError, 'unique_counterparties cannot be nil'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
@unique_counterparties = unique_counterparties
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Custom attribute writer method with validation
|
|
237
|
+
# @param [Object] first_seen Value to be assigned
|
|
238
|
+
def first_seen=(first_seen)
|
|
239
|
+
if first_seen.nil?
|
|
240
|
+
fail ArgumentError, 'first_seen cannot be nil'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
@first_seen = first_seen
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Custom attribute writer method with validation
|
|
247
|
+
# @param [Object] last_active Value to be assigned
|
|
248
|
+
def last_active=(last_active)
|
|
249
|
+
if last_active.nil?
|
|
250
|
+
fail ArgumentError, 'last_active cannot be nil'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
@last_active = last_active
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Checks equality by comparing each attribute.
|
|
257
|
+
# @param [Object] Object to be compared
|
|
258
|
+
def ==(o)
|
|
259
|
+
return true if self.equal?(o)
|
|
260
|
+
self.class == o.class &&
|
|
261
|
+
total_paid == o.total_paid &&
|
|
262
|
+
total_received == o.total_received &&
|
|
263
|
+
payments_made == o.payments_made &&
|
|
264
|
+
payments_received == o.payments_received &&
|
|
265
|
+
unique_counterparties == o.unique_counterparties &&
|
|
266
|
+
first_seen == o.first_seen &&
|
|
267
|
+
last_active == o.last_active
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# @see the `==` method
|
|
271
|
+
# @param [Object] Object to be compared
|
|
272
|
+
def eql?(o)
|
|
273
|
+
self == o
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Calculates hash code according to all attributes.
|
|
277
|
+
# @return [Integer] Hash code
|
|
278
|
+
def hash
|
|
279
|
+
[total_paid, total_received, payments_made, payments_received, unique_counterparties, first_seen, last_active].hash
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Builds the object from hash
|
|
283
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
284
|
+
# @return [Object] Returns the model itself
|
|
285
|
+
def self.build_from_hash(attributes)
|
|
286
|
+
return nil unless attributes.is_a?(Hash)
|
|
287
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
288
|
+
transformed_hash = {}
|
|
289
|
+
openapi_types.each_pair do |key, type|
|
|
290
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
291
|
+
transformed_hash["#{key}"] = nil
|
|
292
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
293
|
+
# check to ensure the input is an array given that the attribute
|
|
294
|
+
# is documented as an array but the input is not
|
|
295
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
296
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
297
|
+
end
|
|
298
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
299
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
new(transformed_hash)
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Returns the object in the form of hash
|
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
|
307
|
+
def to_hash
|
|
308
|
+
hash = {}
|
|
309
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
310
|
+
value = self.send(attr)
|
|
311
|
+
if value.nil?
|
|
312
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
313
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
hash[param] = _to_hash(value)
|
|
317
|
+
end
|
|
318
|
+
hash
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -25,7 +25,7 @@ module Weft
|
|
|
25
25
|
# Payment protocol the agent settles on.
|
|
26
26
|
attr_accessor :payment_protocol
|
|
27
27
|
|
|
28
|
-
# Agent protocol surface (Agent-to-Agent, MCP,
|
|
28
|
+
# Agent protocol surface (Agent-to-Agent, MCP, raw OpenAPI, or AgentNet).
|
|
29
29
|
attr_accessor :agent_protocol
|
|
30
30
|
|
|
31
31
|
# Substring match against any of the agent's declared domain tags (e.g. `email`, `sales`, `enrichment`).
|
|
@@ -154,7 +154,7 @@ module Weft
|
|
|
154
154
|
return false if !@max_price_usd.nil? && @max_price_usd !~ Regexp.new(/^\d+(\.\d{1,6})?$/)
|
|
155
155
|
payment_protocol_validator = EnumAttributeValidator.new('String', ["x402", "mpp", "free"])
|
|
156
156
|
return false unless payment_protocol_validator.valid?(@payment_protocol)
|
|
157
|
-
agent_protocol_validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi"])
|
|
157
|
+
agent_protocol_validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi", "AgentNet"])
|
|
158
158
|
return false unless agent_protocol_validator.valid?(@agent_protocol)
|
|
159
159
|
true
|
|
160
160
|
end
|
|
@@ -202,7 +202,7 @@ module Weft
|
|
|
202
202
|
# Custom attribute writer method checking allowed values (enum).
|
|
203
203
|
# @param [Object] agent_protocol Object to be assigned
|
|
204
204
|
def agent_protocol=(agent_protocol)
|
|
205
|
-
validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi"])
|
|
205
|
+
validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi", "AgentNet"])
|
|
206
206
|
unless validator.valid?(agent_protocol)
|
|
207
207
|
fail ArgumentError, "invalid value for \"agent_protocol\", must be one of #{validator.allowable_values}."
|
|
208
208
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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.
|
|
6
|
+
The version of the OpenAPI document: 0.7.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Weft
|
|
17
|
-
# Spec-11 search envelope. `paid_usd`, `tx_hash`, and `artifact_id` are reserved for a later release that adds per-call billing and artifact persistence; they are always `null` in v1. `_mock: true` is set only by the mock backend.
|
|
17
|
+
# Spec-11 search envelope. `paid_usd`, `tx_hash`, and `artifact_id` are reserved for a later release that adds per-call billing and artifact persistence; they are always `null` in v1. `_mock: true` is set only by the mock backend. Result rows: the mock backend (`SEARCH_BACKEND=mock`, the default while the real index is unshipped) emits the rich, SDK-facing `SearchResult` shape. The legacy `platform` backend proxies the upstream search service and passes its result rows through verbatim — Weft does not own or reshape that payload, so those rows are typed as a free-form object. SDK clients on v1 should treat unknown row shapes defensively until the platform backend is retrofitted to the `SearchResult` contract (specs 07 + 10). Because the `PlatformSearchResult` branch is intentionally permissive (free-form, to admit the un-owned platform rows), the `anyOf` is satisfied by any object — so the committee response-validation gate does NOT strictly validate result-row shapes; the rich `SearchResult` contract is instead guarded by the `/api/v1/search` request spec.
|
|
18
18
|
class SearchResponse < ApiModelBase
|
|
19
19
|
attr_accessor :results
|
|
20
20
|
|
|
@@ -54,7 +54,7 @@ module Weft
|
|
|
54
54
|
# Attribute type mapping.
|
|
55
55
|
def self.openapi_types
|
|
56
56
|
{
|
|
57
|
-
:'results' => :'Array<
|
|
57
|
+
:'results' => :'Array<SearchResponseResultsInner>',
|
|
58
58
|
:'paid_usd' => :'String',
|
|
59
59
|
:'tx_hash' => :'String',
|
|
60
60
|
:'artifact_id' => :'String',
|