Skip to content

Commit 7eb3f47

Browse files
feat: update generated APIs (#1408)
Co-authored-by: Rémy Léone <[email protected]>
1 parent d82b699 commit 7eb3f47

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

api/container/v1beta1/container_sdk.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,26 +780,27 @@ type SecretHashedValue struct {
780780
HashedValue string `json:"hashed_value"`
781781
}
782782

783+
// Token: token
783784
type Token struct {
785+
ID string `json:"id"`
786+
784787
Token string `json:"token"`
785-
// Deprecated
786-
PublicKey *string `json:"public_key,omitempty"`
787788

788789
// Precisely one of ContainerID, NamespaceID must be set.
789790
ContainerID *string `json:"container_id,omitempty"`
790791

791792
// Precisely one of ContainerID, NamespaceID must be set.
792793
NamespaceID *string `json:"namespace_id,omitempty"`
793-
794-
ID string `json:"id"`
794+
// Deprecated
795+
PublicKey *string `json:"public_key,omitempty"`
795796
// Status:
796797
//
797798
// Default value: unknown
798799
Status TokenStatus `json:"status"`
799800

800-
ExpiresAt *time.Time `json:"expires_at"`
801-
802801
Description *string `json:"description"`
802+
803+
ExpiresAt *time.Time `json:"expires_at"`
803804
}
804805

805806
// Service API
@@ -1979,11 +1980,12 @@ type CreateTokenRequest struct {
19791980
// Precisely one of ContainerID, NamespaceID must be set.
19801981
NamespaceID *string `json:"namespace_id,omitempty"`
19811982

1982-
ExpiresAt *time.Time `json:"expires_at"`
1983-
19841983
Description *string `json:"description"`
1984+
1985+
ExpiresAt *time.Time `json:"expires_at"`
19851986
}
19861987

1988+
// CreateToken: create a new revocable token
19871989
func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error) {
19881990
var err error
19891991

@@ -2025,6 +2027,7 @@ type GetTokenRequest struct {
20252027
TokenID string `json:"-"`
20262028
}
20272029

2030+
// GetToken: get a token
20282031
func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error) {
20292032
var err error
20302033

@@ -2075,6 +2078,7 @@ type ListTokensRequest struct {
20752078
NamespaceID *string `json:"-"`
20762079
}
20772080

2081+
// ListTokens: list all tokens
20782082
func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error) {
20792083
var err error
20802084

@@ -2124,6 +2128,7 @@ type DeleteTokenRequest struct {
21242128
TokenID string `json:"-"`
21252129
}
21262130

2131+
// DeleteToken: delete a token
21272132
func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) (*Token, error) {
21282133
var err error
21292134

api/function/v1beta1/function_sdk.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,26 +881,27 @@ type SecretHashedValue struct {
881881
HashedValue string `json:"hashed_value"`
882882
}
883883

884+
// Token: token
884885
type Token struct {
886+
ID string `json:"id"`
887+
885888
Token string `json:"token"`
886-
// Deprecated
887-
PublicKey *string `json:"public_key,omitempty"`
888889

889890
// Precisely one of FunctionID, NamespaceID must be set.
890891
FunctionID *string `json:"function_id,omitempty"`
891892

892893
// Precisely one of FunctionID, NamespaceID must be set.
893894
NamespaceID *string `json:"namespace_id,omitempty"`
894-
895-
ID string `json:"id"`
895+
// Deprecated
896+
PublicKey *string `json:"public_key,omitempty"`
896897
// Status:
897898
//
898899
// Default value: unknown
899900
Status TokenStatus `json:"status"`
900901

901-
ExpiresAt *time.Time `json:"expires_at"`
902-
903902
Description *string `json:"description"`
903+
904+
ExpiresAt *time.Time `json:"expires_at"`
904905
}
905906

906907
// UploadURL: upload url
@@ -2208,11 +2209,12 @@ type CreateTokenRequest struct {
22082209
// Precisely one of FunctionID, NamespaceID must be set.
22092210
NamespaceID *string `json:"namespace_id,omitempty"`
22102211

2211-
ExpiresAt *time.Time `json:"expires_at"`
2212-
22132212
Description *string `json:"description"`
2213+
2214+
ExpiresAt *time.Time `json:"expires_at"`
22142215
}
22152216

2217+
// CreateToken: create a new revocable token
22162218
func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error) {
22172219
var err error
22182220

@@ -2254,6 +2256,7 @@ type GetTokenRequest struct {
22542256
TokenID string `json:"-"`
22552257
}
22562258

2259+
// GetToken: get a token
22572260
func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error) {
22582261
var err error
22592262

@@ -2304,6 +2307,7 @@ type ListTokensRequest struct {
23042307
NamespaceID *string `json:"-"`
23052308
}
23062309

2310+
// ListTokens: list all tokens
23072311
func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error) {
23082312
var err error
23092313

@@ -2353,6 +2357,7 @@ type DeleteTokenRequest struct {
23532357
TokenID string `json:"-"`
23542358
}
23552359

2360+
// DeleteToken: delete a token
23562361
func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) (*Token, error) {
23572362
var err error
23582363

0 commit comments

Comments
 (0)