Skip to content

Commit

Permalink
Add is_totp and is_fido to Synthetic global variables (#2582)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec committed Aug 16, 2024
1 parent 6c9e618 commit 9be29f2
Show file tree
Hide file tree
Showing 24 changed files with 974 additions and 50 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 22:32:02.181891",
"spec_repo_commit": "07d72513"
"regenerated": "2024-08-16 13:40:36.303655",
"spec_repo_commit": "1b56c3ba"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 22:32:02.200367",
"spec_repo_commit": "07d72513"
"regenerated": "2024-08-16 13:40:36.321785",
"spec_repo_commit": "1b56c3ba"
}
}
}
57 changes: 55 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15143,6 +15143,12 @@ components:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
is_totp:
description: Determines if the global variable is a TOTP/MFA variable.
type: boolean
name:
description: Name of the global variable. Unique across Synthetic global
variables.
Expand Down Expand Up @@ -15233,6 +15239,53 @@ components:
- JSON_PATH
- REGEX
- X_PATH
SyntheticsGlobalVariableRequest:
description: Details of the global variable to create.
properties:
attributes:
$ref: '#/components/schemas/SyntheticsGlobalVariableAttributes'
description:
description: Description of the global variable.
example: Example description
type: string
id:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
is_totp:
description: Determines if the global variable is a TOTP/MFA variable.
type: boolean
name:
description: Name of the global variable. Unique across Synthetic global
variables.
example: MY_VARIABLE
type: string
parse_test_options:
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions'
parse_test_public_id:
description: A Synthetic test ID to use as a test to generate the variable
value.
example: abc-def-123
type: string
tags:
description: Tags of the global variable.
example:
- team:front
- test:workflow-1
items:
description: Tag name.
type: string
type: array
value:
$ref: '#/components/schemas/SyntheticsGlobalVariableValue'
required:
- description
- name
- tags
type: object
SyntheticsGlobalVariableTOTPParameters:
description: Parameters for the TOTP/MFA variable
properties:
Expand Down Expand Up @@ -31194,7 +31247,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
$ref: '#/components/schemas/SyntheticsGlobalVariableRequest'
description: Details of the global variable to create.
required: true
responses:
Expand Down Expand Up @@ -31328,7 +31381,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
$ref: '#/components/schemas/SyntheticsGlobalVariableRequest'
description: Details of the global variable to update.
required: true
responses:
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV1/api_synthetics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SyntheticsApi datadog.Service

// CreateGlobalVariable Create a global variable.
// Create a Synthetic global variable.
func (a *SyntheticsApi) CreateGlobalVariable(ctx _context.Context, body SyntheticsGlobalVariable) (SyntheticsGlobalVariable, *_nethttp.Response, error) {
func (a *SyntheticsApi) CreateGlobalVariable(ctx _context.Context, body SyntheticsGlobalVariableRequest) (SyntheticsGlobalVariable, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
Expand Down Expand Up @@ -506,7 +506,7 @@ func (a *SyntheticsApi) DeleteTests(ctx _context.Context, body SyntheticsDeleteT

// EditGlobalVariable Edit a global variable.
// Edit a Synthetic global variable.
func (a *SyntheticsApi) EditGlobalVariable(ctx _context.Context, variableId string, body SyntheticsGlobalVariable) (SyntheticsGlobalVariable, *_nethttp.Response, error) {
func (a *SyntheticsApi) EditGlobalVariable(ctx _context.Context, variableId string, body SyntheticsGlobalVariableRequest) (SyntheticsGlobalVariable, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
Expand Down
72 changes: 71 additions & 1 deletion api/datadogV1/model_synthetics_global_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ type SyntheticsGlobalVariable struct {
Description string `json:"description"`
// Unique identifier of the global variable.
Id *string `json:"id,omitempty"`
// Determines if the global variable is a FIDO variable.
IsFido *bool `json:"is_fido,omitempty"`
// Determines if the global variable is a TOTP/MFA variable.
IsTotp *bool `json:"is_totp,omitempty"`
// Name of the global variable. Unique across Synthetic global variables.
Name string `json:"name"`
// Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with `parse_test_public_id`.
Expand Down Expand Up @@ -133,6 +137,62 @@ func (o *SyntheticsGlobalVariable) SetId(v string) {
o.Id = &v
}

// GetIsFido returns the IsFido field value if set, zero value otherwise.
func (o *SyntheticsGlobalVariable) GetIsFido() bool {
if o == nil || o.IsFido == nil {
var ret bool
return ret
}
return *o.IsFido
}

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

// HasIsFido returns a boolean if a field has been set.
func (o *SyntheticsGlobalVariable) HasIsFido() bool {
return o != nil && o.IsFido != nil
}

// SetIsFido gets a reference to the given bool and assigns it to the IsFido field.
func (o *SyntheticsGlobalVariable) SetIsFido(v bool) {
o.IsFido = &v
}

// GetIsTotp returns the IsTotp field value if set, zero value otherwise.
func (o *SyntheticsGlobalVariable) GetIsTotp() bool {
if o == nil || o.IsTotp == nil {
var ret bool
return ret
}
return *o.IsTotp
}

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

// HasIsTotp returns a boolean if a field has been set.
func (o *SyntheticsGlobalVariable) HasIsTotp() bool {
return o != nil && o.IsTotp != nil
}

// SetIsTotp gets a reference to the given bool and assigns it to the IsTotp field.
func (o *SyntheticsGlobalVariable) SetIsTotp(v bool) {
o.IsTotp = &v
}

// GetName returns the Name field value.
func (o *SyntheticsGlobalVariable) GetName() string {
if o == nil {
Expand Down Expand Up @@ -271,6 +331,12 @@ func (o SyntheticsGlobalVariable) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.IsFido != nil {
toSerialize["is_fido"] = o.IsFido
}
if o.IsTotp != nil {
toSerialize["is_totp"] = o.IsTotp
}
toSerialize["name"] = o.Name
if o.ParseTestOptions != nil {
toSerialize["parse_test_options"] = o.ParseTestOptions
Expand All @@ -293,6 +359,8 @@ func (o *SyntheticsGlobalVariable) UnmarshalJSON(bytes []byte) (err error) {
Attributes *SyntheticsGlobalVariableAttributes `json:"attributes,omitempty"`
Description *string `json:"description"`
Id *string `json:"id,omitempty"`
IsFido *bool `json:"is_fido,omitempty"`
IsTotp *bool `json:"is_totp,omitempty"`
Name *string `json:"name"`
ParseTestOptions *SyntheticsGlobalVariableParseTestOptions `json:"parse_test_options,omitempty"`
ParseTestPublicId *string `json:"parse_test_public_id,omitempty"`
Expand All @@ -316,7 +384,7 @@ func (o *SyntheticsGlobalVariable) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "description", "id", "name", "parse_test_options", "parse_test_public_id", "tags", "value"})
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "description", "id", "is_fido", "is_totp", "name", "parse_test_options", "parse_test_public_id", "tags", "value"})
} else {
return err
}
Expand All @@ -328,6 +396,8 @@ func (o *SyntheticsGlobalVariable) UnmarshalJSON(bytes []byte) (err error) {
o.Attributes = all.Attributes
o.Description = *all.Description
o.Id = all.Id
o.IsFido = all.IsFido
o.IsTotp = all.IsTotp
o.Name = *all.Name
if all.ParseTestOptions != nil && all.ParseTestOptions.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
Expand Down
Loading

0 comments on commit 9be29f2

Please sign in to comment.