Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #1713

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions api.md

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions zero_trust/accessbookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewAccessBookmarkService(opts ...option.RequestOption) (r *AccessBookmarkSe
}

// Create a new Bookmark application.
func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid string, body AccessBookmarkNewParams, opts ...option.RequestOption) (res *Bookmarks, err error) {
func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid string, body AccessBookmarkNewParams, opts ...option.RequestOption) (res *Bookmark, err error) {
opts = append(r.Options[:], opts...)
var env AccessBookmarkNewResponseEnvelope
path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid)
Expand All @@ -48,7 +48,7 @@ func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid
}

// Updates a configured Bookmark application.
func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, uuid string, body AccessBookmarkUpdateParams, opts ...option.RequestOption) (res *Bookmarks, err error) {
func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, uuid string, body AccessBookmarkUpdateParams, opts ...option.RequestOption) (res *Bookmark, err error) {
opts = append(r.Options[:], opts...)
var env AccessBookmarkUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid)
Expand All @@ -61,7 +61,7 @@ func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, u
}

// Lists Bookmark applications.
func (r *AccessBookmarkService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *pagination.SinglePage[Bookmarks], err error) {
func (r *AccessBookmarkService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *pagination.SinglePage[Bookmark], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -79,7 +79,7 @@ func (r *AccessBookmarkService) List(ctx context.Context, identifier string, opt
}

// Lists Bookmark applications.
func (r *AccessBookmarkService) ListAutoPaging(ctx context.Context, identifier string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Bookmarks] {
func (r *AccessBookmarkService) ListAutoPaging(ctx context.Context, identifier string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Bookmark] {
return pagination.NewSinglePageAutoPager(r.List(ctx, identifier, opts...))
}

Expand All @@ -97,7 +97,7 @@ func (r *AccessBookmarkService) Delete(ctx context.Context, identifier string, u
}

// Fetches a single Bookmark application.
func (r *AccessBookmarkService) Get(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *Bookmarks, err error) {
func (r *AccessBookmarkService) Get(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *Bookmark, err error) {
opts = append(r.Options[:], opts...)
var env AccessBookmarkGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid)
Expand All @@ -109,7 +109,7 @@ func (r *AccessBookmarkService) Get(ctx context.Context, identifier string, uuid
return
}

type Bookmarks struct {
type Bookmark struct {
// The unique identifier for the Bookmark application.
ID string `json:"id"`
// Displays the application in the App Launcher.
Expand All @@ -120,13 +120,13 @@ type Bookmarks struct {
// The image URL for the logo shown in the App Launcher dashboard.
LogoURL string `json:"logo_url"`
// The name of the Bookmark application.
Name string `json:"name"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON bookmarksJSON `json:"-"`
Name string `json:"name"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON bookmarkJSON `json:"-"`
}

// bookmarksJSON contains the JSON metadata for the struct [Bookmarks]
type bookmarksJSON struct {
// bookmarkJSON contains the JSON metadata for the struct [Bookmark]
type bookmarkJSON struct {
ID apijson.Field
AppLauncherVisible apijson.Field
CreatedAt apijson.Field
Expand All @@ -138,11 +138,11 @@ type bookmarksJSON struct {
ExtraFields map[string]apijson.Field
}

func (r *Bookmarks) UnmarshalJSON(data []byte) (err error) {
func (r *Bookmark) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r bookmarksJSON) RawJSON() string {
func (r bookmarkJSON) RawJSON() string {
return r.raw
}

Expand Down Expand Up @@ -179,7 +179,7 @@ func (r AccessBookmarkNewParams) MarshalJSON() (data []byte, err error) {
type AccessBookmarkNewResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result Bookmarks `json:"result,required"`
Result Bookmark `json:"result,required"`
// Whether the API call was successful
Success AccessBookmarkNewResponseEnvelopeSuccess `json:"success,required"`
JSON accessBookmarkNewResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -230,7 +230,7 @@ func (r AccessBookmarkUpdateParams) MarshalJSON() (data []byte, err error) {
type AccessBookmarkUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result Bookmarks `json:"result,required"`
Result Bookmark `json:"result,required"`
// Whether the API call was successful
Success AccessBookmarkUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON accessBookmarkUpdateResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -324,7 +324,7 @@ func (r AccessBookmarkDeleteResponseEnvelopeSuccess) IsKnown() bool {
type AccessBookmarkGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result Bookmarks `json:"result,required"`
Result Bookmark `json:"result,required"`
// Whether the API call was successful
Success AccessBookmarkGetResponseEnvelopeSuccess `json:"success,required"`
JSON accessBookmarkGetResponseEnvelopeJSON `json:"-"`
Expand Down
32 changes: 16 additions & 16 deletions zero_trust/accessservicetoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (r *AccessServiceTokenService) New(ctx context.Context, params AccessServic
}

// Updates a configured service token.
func (r *AccessServiceTokenService) Update(ctx context.Context, uuid string, params AccessServiceTokenUpdateParams, opts ...option.RequestOption) (res *ErviceToken, err error) {
func (r *AccessServiceTokenService) Update(ctx context.Context, uuid string, params AccessServiceTokenUpdateParams, opts ...option.RequestOption) (res *ServiceToken, err error) {
opts = append(r.Options[:], opts...)
var env AccessServiceTokenUpdateResponseEnvelope
var accountOrZone string
Expand All @@ -81,7 +81,7 @@ func (r *AccessServiceTokenService) Update(ctx context.Context, uuid string, par
}

// Lists all service tokens.
func (r *AccessServiceTokenService) List(ctx context.Context, query AccessServiceTokenListParams, opts ...option.RequestOption) (res *pagination.SinglePage[ErviceToken], err error) {
func (r *AccessServiceTokenService) List(ctx context.Context, query AccessServiceTokenListParams, opts ...option.RequestOption) (res *pagination.SinglePage[ServiceToken], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -108,12 +108,12 @@ func (r *AccessServiceTokenService) List(ctx context.Context, query AccessServic
}

// Lists all service tokens.
func (r *AccessServiceTokenService) ListAutoPaging(ctx context.Context, query AccessServiceTokenListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[ErviceToken] {
func (r *AccessServiceTokenService) ListAutoPaging(ctx context.Context, query AccessServiceTokenListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[ServiceToken] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

// Deletes a service token.
func (r *AccessServiceTokenService) Delete(ctx context.Context, uuid string, body AccessServiceTokenDeleteParams, opts ...option.RequestOption) (res *ErviceToken, err error) {
func (r *AccessServiceTokenService) Delete(ctx context.Context, uuid string, body AccessServiceTokenDeleteParams, opts ...option.RequestOption) (res *ServiceToken, err error) {
opts = append(r.Options[:], opts...)
var env AccessServiceTokenDeleteResponseEnvelope
var accountOrZone string
Expand All @@ -135,7 +135,7 @@ func (r *AccessServiceTokenService) Delete(ctx context.Context, uuid string, bod
}

// Refreshes the expiration of a service token.
func (r *AccessServiceTokenService) Refresh(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *ErviceToken, err error) {
func (r *AccessServiceTokenService) Refresh(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *ServiceToken, err error) {
opts = append(r.Options[:], opts...)
var env AccessServiceTokenRefreshResponseEnvelope
path := fmt.Sprintf("accounts/%s/access/service_tokens/%s/refresh", identifier, uuid)
Expand All @@ -160,7 +160,7 @@ func (r *AccessServiceTokenService) Rotate(ctx context.Context, identifier strin
return
}

type ErviceToken struct {
type ServiceToken struct {
// The ID of the service token.
ID interface{} `json:"id"`
// The Client ID for the service token. Access will check for this value in the
Expand All @@ -172,13 +172,13 @@ type ErviceToken struct {
// default is 1 year in hours (8760h).
Duration string `json:"duration"`
// The name of the service token.
Name string `json:"name"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON erviceTokenJSON `json:"-"`
Name string `json:"name"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON serviceTokenJSON `json:"-"`
}

// erviceTokenJSON contains the JSON metadata for the struct [ErviceToken]
type erviceTokenJSON struct {
// serviceTokenJSON contains the JSON metadata for the struct [ServiceToken]
type serviceTokenJSON struct {
ID apijson.Field
ClientID apijson.Field
CreatedAt apijson.Field
Expand All @@ -189,11 +189,11 @@ type erviceTokenJSON struct {
ExtraFields map[string]apijson.Field
}

func (r *ErviceToken) UnmarshalJSON(data []byte) (err error) {
func (r *ServiceToken) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r erviceTokenJSON) RawJSON() string {
func (r serviceTokenJSON) RawJSON() string {
return r.raw
}

Expand Down Expand Up @@ -361,7 +361,7 @@ func (r AccessServiceTokenUpdateParams) MarshalJSON() (data []byte, err error) {
type AccessServiceTokenUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ErviceToken `json:"result,required"`
Result ServiceToken `json:"result,required"`
// Whether the API call was successful
Success AccessServiceTokenUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON accessServiceTokenUpdateResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -418,7 +418,7 @@ type AccessServiceTokenDeleteParams struct {
type AccessServiceTokenDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ErviceToken `json:"result,required"`
Result ServiceToken `json:"result,required"`
// Whether the API call was successful
Success AccessServiceTokenDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON accessServiceTokenDeleteResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -461,7 +461,7 @@ func (r AccessServiceTokenDeleteResponseEnvelopeSuccess) IsKnown() bool {
type AccessServiceTokenRefreshResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ErviceToken `json:"result,required"`
Result ServiceToken `json:"result,required"`
// Whether the API call was successful
Success AccessServiceTokenRefreshResponseEnvelopeSuccess `json:"success,required"`
JSON accessServiceTokenRefreshResponseEnvelopeJSON `json:"-"`
Expand Down
Loading