Skip to content
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
22 changes: 8 additions & 14 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,9 @@ components:
schema:
type: string
PersonalAccessTokenID:
description: The UUID of the personal access token.
description: The ID of the personal access token.
in: path
name: pat_uuid
name: pat_id
required: true
schema:
example: "00000000-0000-1234-0000-000000000000"
Expand Down Expand Up @@ -29288,11 +29288,6 @@ components:
FullPersonalAccessTokenAttributes:
description: Attributes of a full personal access token, including the token key.
properties:
alias:
description: The alias (short identifier) of the personal access token.
example: "2H9MCNMBM8FQjQ16YucXkX"
readOnly: true
type: string
created_at:
description: Creation date of the personal access token.
example: "2024-01-01T00:00:00+00:00"
Expand Down Expand Up @@ -53523,11 +53518,6 @@ components:
PersonalAccessTokenAttributes:
description: Attributes of a personal access token.
properties:
alias:
description: The alias (short identifier) of the personal access token.
example: "2H9MCNMBM8FQjQ16YucXkX"
readOnly: true
type: string
created_at:
description: Creation date of the personal access token.
example: "2024-01-01T00:00:00+00:00"
Expand Down Expand Up @@ -78073,6 +78063,10 @@ components:
description: Title of the user.
nullable: true
type: string
uuid:
description: UUID of the user.
readOnly: true
type: string
verified:
description: Whether the user is verified.
type: boolean
Expand Down Expand Up @@ -109765,7 +109759,7 @@ paths:
operator: OR
permissions:
- user_app_keys
/api/v2/personal_access_tokens/{pat_uuid}:
/api/v2/personal_access_tokens/{pat_id}:
delete:
description: Revoke a specific personal access token.
operationId: RevokePersonalAccessToken
Expand Down Expand Up @@ -121344,7 +121338,7 @@ paths:
operator: OR
permissions:
- service_account_write
/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}:
/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}:
delete:
description: Revoke a specific access token for a service account.
operationId: RevokeServiceAccountAccessToken
Expand Down
18 changes: 9 additions & 9 deletions api/datadogV2/api_key_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ func (a *KeyManagementApi) GetCurrentUserApplicationKey(ctx _context.Context, ap

// GetPersonalAccessToken Get a personal access token.
// Get a specific personal access token by its UUID.
func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patUuid string) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patId string) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
Expand All @@ -765,8 +765,8 @@ func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patUuid
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down Expand Up @@ -1519,7 +1519,7 @@ func (a *KeyManagementApi) ListPersonalAccessTokens(ctx _context.Context, o ...L

// RevokePersonalAccessToken Revoke a personal access token.
// Revoke a specific personal access token.
func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patUuid string) (*_nethttp.Response, error) {
func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
Expand All @@ -1530,8 +1530,8 @@ func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patUu
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down Expand Up @@ -1831,7 +1831,7 @@ func (a *KeyManagementApi) UpdateCurrentUserApplicationKey(ctx _context.Context,

// UpdatePersonalAccessToken Update a personal access token.
// Update a specific personal access token.
func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patUuid string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patId string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
Expand All @@ -1843,8 +1843,8 @@ func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patUu
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down
18 changes: 9 additions & 9 deletions api/datadogV2/api_service_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (a *ServiceAccountsApi) DeleteServiceAccountApplicationKey(ctx _context.Con

// GetServiceAccountAccessToken Get an access token for a service account.
// Get a specific access token for a service account by its UUID.
func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
Expand All @@ -340,9 +340,9 @@ func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context,
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}"
localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down Expand Up @@ -778,7 +778,7 @@ func (a *ServiceAccountsApi) ListServiceAccountApplicationKeys(ctx _context.Cont

// RevokeServiceAccountAccessToken Revoke an access token for a service account.
// Revoke a specific access token for a service account.
func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string) (*_nethttp.Response, error) {
func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
Expand All @@ -789,9 +789,9 @@ func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Contex
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}"
localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down Expand Up @@ -847,7 +847,7 @@ func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Contex

// UpdateServiceAccountAccessToken Update an access token for a service account.
// Update a specific access token for a service account.
func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
Expand All @@ -859,9 +859,9 @@ func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Contex
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}"
localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, "")))
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
Expand Down
37 changes: 1 addition & 36 deletions api/datadogV2/model_full_personal_access_token_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (

// FullPersonalAccessTokenAttributes Attributes of a full personal access token, including the token key.
type FullPersonalAccessTokenAttributes struct {
// The alias (short identifier) of the personal access token.
Alias *string `json:"alias,omitempty"`
// Creation date of the personal access token.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Expiration date of the personal access token.
Expand Down Expand Up @@ -48,34 +46,6 @@ func NewFullPersonalAccessTokenAttributesWithDefaults() *FullPersonalAccessToken
return &this
}

// GetAlias returns the Alias field value if set, zero value otherwise.
func (o *FullPersonalAccessTokenAttributes) GetAlias() string {
if o == nil || o.Alias == nil {
var ret string
return ret
}
return *o.Alias
}

// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FullPersonalAccessTokenAttributes) GetAliasOk() (*string, bool) {
if o == nil || o.Alias == nil {
return nil, false
}
return o.Alias, true
}

// HasAlias returns a boolean if a field has been set.
func (o *FullPersonalAccessTokenAttributes) HasAlias() bool {
return o != nil && o.Alias != nil
}

// SetAlias gets a reference to the given string and assigns it to the Alias field.
func (o *FullPersonalAccessTokenAttributes) SetAlias(v string) {
o.Alias = &v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *FullPersonalAccessTokenAttributes) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
Expand Down Expand Up @@ -261,9 +231,6 @@ func (o FullPersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Alias != nil {
toSerialize["alias"] = o.Alias
}
if o.CreatedAt != nil {
if o.CreatedAt.Nanosecond() == 0 {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
Expand Down Expand Up @@ -296,7 +263,6 @@ func (o FullPersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *FullPersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Alias *string `json:"alias,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ExpiresAt datadog.NullableTime `json:"expires_at,omitempty"`
Key *string `json:"key,omitempty"`
Expand All @@ -309,11 +275,10 @@ func (o *FullPersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err err
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"alias", "created_at", "expires_at", "key", "name", "public_portion", "scopes"})
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "expires_at", "key", "name", "public_portion", "scopes"})
} else {
return err
}
o.Alias = all.Alias
o.CreatedAt = all.CreatedAt
o.ExpiresAt = all.ExpiresAt
o.Key = all.Key
Expand Down
37 changes: 1 addition & 36 deletions api/datadogV2/model_personal_access_token_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (

// PersonalAccessTokenAttributes Attributes of a personal access token.
type PersonalAccessTokenAttributes struct {
// The alias (short identifier) of the personal access token.
Alias *string `json:"alias,omitempty"`
// Creation date of the personal access token.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Expiration date of the personal access token.
Expand Down Expand Up @@ -50,34 +48,6 @@ func NewPersonalAccessTokenAttributesWithDefaults() *PersonalAccessTokenAttribut
return &this
}

// GetAlias returns the Alias field value if set, zero value otherwise.
func (o *PersonalAccessTokenAttributes) GetAlias() string {
if o == nil || o.Alias == nil {
var ret string
return ret
}
return *o.Alias
}

// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PersonalAccessTokenAttributes) GetAliasOk() (*string, bool) {
if o == nil || o.Alias == nil {
return nil, false
}
return o.Alias, true
}

// HasAlias returns a boolean if a field has been set.
func (o *PersonalAccessTokenAttributes) HasAlias() bool {
return o != nil && o.Alias != nil
}

// SetAlias gets a reference to the given string and assigns it to the Alias field.
func (o *PersonalAccessTokenAttributes) SetAlias(v string) {
o.Alias = &v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *PersonalAccessTokenAttributes) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
Expand Down Expand Up @@ -313,9 +283,6 @@ func (o PersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Alias != nil {
toSerialize["alias"] = o.Alias
}
if o.CreatedAt != nil {
if o.CreatedAt.Nanosecond() == 0 {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
Expand Down Expand Up @@ -351,7 +318,6 @@ func (o PersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *PersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Alias *string `json:"alias,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ExpiresAt datadog.NullableTime `json:"expires_at,omitempty"`
LastUsedAt datadog.NullableTime `json:"last_used_at,omitempty"`
Expand All @@ -365,11 +331,10 @@ func (o *PersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"alias", "created_at", "expires_at", "last_used_at", "modified_at", "name", "public_portion", "scopes"})
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "expires_at", "last_used_at", "modified_at", "name", "public_portion", "scopes"})
} else {
return err
}
o.Alias = all.Alias
o.CreatedAt = all.CreatedAt
o.ExpiresAt = all.ExpiresAt
o.LastUsedAt = all.LastUsedAt
Expand Down
Loading
Loading