weft-sdk 0.6.2 → 0.9.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/APIKeysApi.md +1 -2
- data/docs/AccountApi.md +6 -5
- data/docs/AccountDetails.md +10 -13
- data/docs/ApiKey.md +0 -1
- data/docs/ApiKeyCreated.md +0 -1
- data/docs/ApiKeyCreatedResponse.md +0 -1
- data/docs/ApiKeyListResponse.md +0 -1
- data/docs/AuthApi.md +6 -7
- data/docs/AuthResponse.md +0 -1
- data/docs/AuthResponseData.md +0 -1
- data/docs/BalanceApi.md +1 -2
- data/docs/BalanceResponse.md +3 -4
- data/docs/ConfirmRequest.md +0 -1
- data/docs/CreateApiKeyRequest.md +0 -1
- data/docs/DefaultApi.md +0 -1
- data/docs/EnrolledResource.md +43 -0
- data/docs/Error.md +0 -1
- data/docs/ErrorResponse.md +0 -1
- data/docs/Fetch403Response.md +48 -0
- data/docs/FetchApi.md +10 -7
- data/docs/FetchBalanceSnapshot.md +5 -2
- data/docs/FetchErrorResponse.md +0 -1
- data/docs/FetchRequest.md +0 -1
- data/docs/FetchRequestBody.md +0 -1
- data/docs/FetchResponse.md +6 -3
- data/docs/InsufficientScopeResponse.md +21 -0
- data/docs/MeApiKey.md +25 -0
- data/docs/MeApiKeyCreator.md +21 -0
- data/docs/MeResponse.md +1 -2
- data/docs/MeResponseData.md +78 -0
- data/docs/Merchant.md +0 -1
- data/docs/MessageResponse.md +0 -1
- data/docs/MessageResponseData.md +0 -1
- data/docs/Pagination.md +0 -1
- data/docs/PasswordResetRequest.md +0 -1
- data/docs/PasswordUpdateRequest.md +0 -1
- data/docs/Payment.md +0 -3
- data/docs/PaymentListResponse.md +0 -1
- data/docs/PaymentResponse.md +0 -1
- data/docs/PaymentsApi.md +0 -1
- data/docs/PrincipalWallet.md +19 -0
- data/docs/PromoBalance.md +0 -1
- data/docs/Purchase.md +43 -0
- data/docs/PurchaseArtifact.md +23 -0
- data/docs/PurchaseListResponse.md +19 -0
- data/docs/PurchaseResponse.md +17 -0
- data/docs/PurchasesApi.md +148 -0
- data/docs/ResendConfirmationRequest.md +0 -1
- data/docs/ResourceEnrollmentRequest.md +23 -0
- data/docs/ResourceEnrollmentResponse.md +17 -0
- data/docs/ResourceStats.md +29 -0
- data/docs/ResourcesApi.md +71 -0
- data/docs/SearchApi.md +2 -3
- data/docs/SearchCapabilityRef.md +19 -0
- data/docs/SearchEndpointCall.md +23 -0
- data/docs/SearchEndpointHit.md +41 -0
- data/docs/SearchEndpointPrice.md +25 -0
- data/docs/SearchErrorResponse.md +0 -1
- data/docs/SearchFilterSpec.md +23 -0
- data/docs/SearchPaymentOffer.md +31 -0
- data/docs/SearchPriceAtomicFilter.md +25 -0
- data/docs/SearchPriceUsdFilter.md +25 -0
- data/docs/SearchProtocolFilter.md +19 -0
- data/docs/SearchProviderRef.md +21 -0
- data/docs/SearchRequest.md +3 -4
- data/docs/SearchResourceTypeFilter.md +19 -0
- data/docs/SearchResponse.md +35 -8
- data/docs/SearchResponseWarningsInner.md +23 -0
- data/docs/SearchResult.md +8 -21
- data/docs/SignInRequest.md +0 -1
- data/docs/SignUpRequest.md +0 -1
- data/docs/SpendingPolicy.md +0 -1
- data/docs/User.md +0 -1
- data/docs/UserPrincipal.md +33 -0
- data/docs/Wallet.md +5 -2
- data/lib/weft/generated/api/account_api.rb +6 -4
- data/lib/weft/generated/api/api_keys_api.rb +4 -4
- data/lib/weft/generated/api/auth_api.rb +14 -14
- data/lib/weft/generated/api/balance_api.rb +4 -4
- data/lib/weft/generated/api/default_api.rb +2 -2
- data/lib/weft/generated/api/fetch_api.rb +22 -6
- data/lib/weft/generated/api/payments_api.rb +2 -2
- data/lib/weft/generated/api/purchases_api.rb +150 -0
- data/lib/weft/generated/api/resources_api.rb +90 -0
- data/lib/weft/generated/api/search_api.rb +6 -6
- data/lib/weft/generated/api_client.rb +2 -2
- data/lib/weft/generated/api_error.rb +2 -2
- data/lib/weft/generated/api_model_base.rb +2 -2
- data/lib/weft/generated/configuration.rb +2 -2
- data/lib/weft/generated/models/account_details.rb +94 -85
- data/lib/weft/generated/models/api_key.rb +2 -2
- data/lib/weft/generated/models/api_key_created.rb +2 -2
- data/lib/weft/generated/models/api_key_created_response.rb +2 -2
- data/lib/weft/generated/models/api_key_list_response.rb +2 -2
- data/lib/weft/generated/models/auth_response.rb +2 -2
- data/lib/weft/generated/models/auth_response_data.rb +2 -2
- data/lib/weft/generated/models/balance_response.rb +5 -5
- data/lib/weft/generated/models/confirm_request.rb +2 -2
- data/lib/weft/generated/models/create_api_key_request.rb +2 -2
- data/lib/weft/generated/models/enrolled_resource.rb +474 -0
- data/lib/weft/generated/models/error.rb +3 -3
- data/lib/weft/generated/models/error_response.rb +3 -3
- data/lib/weft/generated/models/fetch403_response.rb +104 -0
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +59 -4
- data/lib/weft/generated/models/fetch_error_response.rb +5 -5
- data/lib/weft/generated/models/fetch_request.rb +5 -5
- data/lib/weft/generated/models/fetch_request_body.rb +2 -2
- data/lib/weft/generated/models/fetch_response.rb +85 -7
- data/lib/weft/generated/models/insufficient_scope_response.rb +242 -0
- data/lib/weft/generated/models/{search_skill.rb → me_api_key.rb} +50 -92
- data/lib/weft/generated/models/me_api_key_creator.rb +200 -0
- data/lib/weft/generated/models/me_response.rb +3 -3
- data/lib/weft/generated/models/me_response_data.rb +55 -0
- data/lib/weft/generated/models/merchant.rb +2 -2
- data/lib/weft/generated/models/message_response.rb +2 -2
- data/lib/weft/generated/models/message_response_data.rb +2 -2
- data/lib/weft/generated/models/pagination.rb +2 -2
- data/lib/weft/generated/models/password_reset_request.rb +2 -2
- data/lib/weft/generated/models/password_update_request.rb +2 -2
- data/lib/weft/generated/models/payment.rb +3 -12
- data/lib/weft/generated/models/payment_list_response.rb +2 -2
- data/lib/weft/generated/models/payment_response.rb +2 -2
- data/lib/weft/generated/models/principal_wallet.rb +190 -0
- data/lib/weft/generated/models/promo_balance.rb +3 -3
- data/lib/weft/generated/models/purchase.rb +427 -0
- data/lib/weft/generated/models/purchase_artifact.rb +237 -0
- data/lib/weft/generated/models/purchase_list_response.rb +192 -0
- data/lib/weft/generated/models/purchase_response.rb +164 -0
- data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
- data/lib/weft/generated/models/{search_agent_card.rb → resource_enrollment_request.rb} +59 -75
- 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_skill_endpoint.rb → search_capability_ref.rb} +18 -19
- data/lib/weft/generated/models/search_endpoint_call.rb +179 -0
- data/lib/weft/generated/models/search_endpoint_hit.rb +296 -0
- data/lib/weft/generated/models/search_endpoint_price.rb +223 -0
- data/lib/weft/generated/models/search_error_response.rb +5 -5
- data/lib/weft/generated/models/search_filter_spec.rb +175 -0
- data/lib/weft/generated/models/{search_pricing.rb → search_payment_offer.rb} +64 -67
- data/lib/weft/generated/models/search_price_atomic_filter.rb +284 -0
- data/lib/weft/generated/models/search_price_usd_filter.rb +294 -0
- data/lib/weft/generated/models/search_protocol_filter.rb +200 -0
- data/lib/weft/generated/models/{search_endpoints.rb → search_provider_ref.rb} +26 -36
- data/lib/weft/generated/models/search_request.rb +36 -27
- data/lib/weft/generated/models/search_resource_type_filter.rb +200 -0
- data/lib/weft/generated/models/search_response.rb +366 -30
- data/lib/weft/generated/models/search_response_warnings_inner.rb +210 -0
- data/lib/weft/generated/models/search_result.rb +68 -220
- data/lib/weft/generated/models/sign_in_request.rb +2 -2
- data/lib/weft/generated/models/sign_up_request.rb +2 -2
- data/lib/weft/generated/models/spending_policy.rb +2 -2
- data/lib/weft/generated/models/user.rb +2 -2
- data/lib/weft/generated/models/user_principal.rb +370 -0
- data/lib/weft/generated/models/wallet.rb +58 -4
- data/lib/weft/generated/version.rb +3 -3
- data/lib/weft/generated.rb +10 -4
- data/lib/weft/sdk.rb +1 -1
- metadata +75 -17
- data/docs/SearchAgentCard.md +0 -34
- data/docs/SearchEndpoints.md +0 -24
- data/docs/SearchFilters.md +0 -26
- data/docs/SearchPricing.md +0 -24
- data/docs/SearchRanking.md +0 -26
- data/docs/SearchSkill.md +0 -36
- data/docs/SearchSkillEndpoint.md +0 -20
- data/lib/weft/generated/models/search_filters.rb +0 -277
- data/lib/weft/generated/models/search_ranking.rb +0 -277
|
@@ -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/purchases`) 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.9.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/purchases`) 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.9.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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
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/
|
|
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/purchases`) 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.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -14,17 +14,16 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Weft
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
attr_accessor :method
|
|
17
|
+
class SearchCapabilityRef < ApiModelBase
|
|
18
|
+
attr_accessor :capability_id
|
|
20
19
|
|
|
21
|
-
attr_accessor :
|
|
20
|
+
attr_accessor :capability_type
|
|
22
21
|
|
|
23
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
23
|
def self.attribute_map
|
|
25
24
|
{
|
|
26
|
-
:'
|
|
27
|
-
:'
|
|
25
|
+
:'capability_id' => :'capability_id',
|
|
26
|
+
:'capability_type' => :'capability_type'
|
|
28
27
|
}
|
|
29
28
|
end
|
|
30
29
|
|
|
@@ -41,8 +40,8 @@ module Weft
|
|
|
41
40
|
# Attribute type mapping.
|
|
42
41
|
def self.openapi_types
|
|
43
42
|
{
|
|
44
|
-
:'
|
|
45
|
-
:'
|
|
43
|
+
:'capability_id' => :'String',
|
|
44
|
+
:'capability_type' => :'String'
|
|
46
45
|
}
|
|
47
46
|
end
|
|
48
47
|
|
|
@@ -56,24 +55,24 @@ module Weft
|
|
|
56
55
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
56
|
def initialize(attributes = {})
|
|
58
57
|
if (!attributes.is_a?(Hash))
|
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchCapabilityRef` initialize method"
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
62
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
64
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchCapabilityRef`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
66
|
end
|
|
68
67
|
h[k.to_sym] = v
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
if attributes.key?(:'
|
|
72
|
-
self.
|
|
70
|
+
if attributes.key?(:'capability_id')
|
|
71
|
+
self.capability_id = attributes[:'capability_id']
|
|
73
72
|
end
|
|
74
73
|
|
|
75
|
-
if attributes.key?(:'
|
|
76
|
-
self.
|
|
74
|
+
if attributes.key?(:'capability_type')
|
|
75
|
+
self.capability_type = attributes[:'capability_type']
|
|
77
76
|
end
|
|
78
77
|
end
|
|
79
78
|
|
|
@@ -97,8 +96,8 @@ module Weft
|
|
|
97
96
|
def ==(o)
|
|
98
97
|
return true if self.equal?(o)
|
|
99
98
|
self.class == o.class &&
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
capability_id == o.capability_id &&
|
|
100
|
+
capability_type == o.capability_type
|
|
102
101
|
end
|
|
103
102
|
|
|
104
103
|
# @see the `==` method
|
|
@@ -110,7 +109,7 @@ module Weft
|
|
|
110
109
|
# Calculates hash code according to all attributes.
|
|
111
110
|
# @return [Integer] Hash code
|
|
112
111
|
def hash
|
|
113
|
-
[
|
|
112
|
+
[capability_id, capability_type].hash
|
|
114
113
|
end
|
|
115
114
|
|
|
116
115
|
# Builds the object from hash
|