Skip to content

Commit e322ab6

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(tokens): move token value model to shared (#3609)
1 parent 5c223fb commit e322ab6

89 files changed

Lines changed: 426 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎accounts/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎accounts/token.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ type TokenNewResponse struct {
189189
// Status of the token.
190190
Status TokenNewResponseStatus `json:"status"`
191191
// The token value.
192-
Value user.Value `json:"value"`
192+
Value shared.TokenValue `json:"value"`
193193
JSON tokenNewResponseJSON `json:"-"`
194194
}
195195

‎accounts/tokenvalue.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
1414
"github.com/cloudflare/cloudflare-go/v3/option"
1515
"github.com/cloudflare/cloudflare-go/v3/shared"
16-
"github.com/cloudflare/cloudflare-go/v3/user"
1716
)
1817

1918
// TokenValueService contains methods and other services that help with interacting
@@ -36,7 +35,7 @@ func NewTokenValueService(opts ...option.RequestOption) (r *TokenValueService) {
3635
}
3736

3837
// Roll the Account Owned API token secret.
39-
func (r *TokenValueService) Update(ctx context.Context, tokenID string, params TokenValueUpdateParams, opts ...option.RequestOption) (res *user.Value, err error) {
38+
func (r *TokenValueService) Update(ctx context.Context, tokenID string, params TokenValueUpdateParams, opts ...option.RequestOption) (res *shared.TokenValue, err error) {
4039
var env TokenValueUpdateResponseEnvelope
4140
opts = append(r.Options[:], opts...)
4241
if params.AccountID.Value == "" {
@@ -72,7 +71,7 @@ type TokenValueUpdateResponseEnvelope struct {
7271
// Whether the API call was successful
7372
Success TokenValueUpdateResponseEnvelopeSuccess `json:"success,required"`
7473
// The token value.
75-
Result user.Value `json:"result"`
74+
Result shared.TokenValue `json:"result"`
7675
JSON tokenValueUpdateResponseEnvelopeJSON `json:"-"`
7776
}
7877

‎acm/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎addressing/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎ai_gateway/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎alerting/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

‎api.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#ResponseInfo">ResponseInfo</a>
2525
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#Role">Role</a>
2626
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#Subscription">Subscription</a>
27+
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#TokenValue">TokenValue</a>
2728

2829
# Accounts
2930

@@ -110,7 +111,7 @@ Methods:
110111

111112
Methods:
112113

113-
- <code title="put /accounts/{account_id}/tokens/{token_id}/value">client.Accounts.Tokens.Value.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts#TokenValueService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, tokenID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts">accounts</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts#TokenValueUpdateParams">TokenValueUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user">user</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#Value">Value</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
114+
- <code title="put /accounts/{account_id}/tokens/{token_id}/value">client.Accounts.Tokens.Value.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts#TokenValueService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, tokenID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts">accounts</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/accounts#TokenValueUpdateParams">TokenValueUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#TokenValue">TokenValue</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
114115

115116
# OriginCACertificates
116117

@@ -270,13 +271,9 @@ Methods:
270271

271272
### Value
272273

273-
Response Types:
274-
275-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user">user</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#Value">Value</a>
276-
277274
Methods:
278275

279-
- <code title="put /user/tokens/{token_id}/value">client.User.Tokens.Value.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#TokenValueService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, tokenID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user">user</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#TokenValueUpdateParams">TokenValueUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user">user</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#Value">Value</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
276+
- <code title="put /user/tokens/{token_id}/value">client.User.Tokens.Value.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#TokenValueService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, tokenID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user">user</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/user#TokenValueUpdateParams">TokenValueUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared">shared</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/shared#TokenValue">TokenValue</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
280277

281278
# Zones
282279

‎api_gateway/aliases.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,8 @@ const SubscriptionStateExpired = shared.SubscriptionStateExpired
285285

286286
// This is an alias to an internal type.
287287
type SubscriptionParam = shared.SubscriptionParam
288+
289+
// The token value.
290+
//
291+
// This is an alias to an internal type.
292+
type TokenValue = shared.TokenValue

0 commit comments

Comments
 (0)