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

Revert the earlier spelling change #2775

Merged
merged 1 commit into from
Nov 12, 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
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-11-11 17:25:14.651723",
"spec_repo_commit": "9de1804a"
"regenerated": "2024-11-12 16:11:25.057465",
"spec_repo_commit": "67b7e114"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-11 17:25:14.670393",
"spec_repo_commit": "9de1804a"
"regenerated": "2024-11-12 16:11:25.076160",
"spec_repo_commit": "67b7e114"
}
}
}
6 changes: 3 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17027,12 +17027,12 @@ components:
SyntheticsTestRestrictionPolicyBinding:
description: Objects describing the binding used for a mobile test.
properties:
principal:
$ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBindingPrincipal'
principals:
$ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBindingPrincipals'
relation:
$ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBindingRelation'
type: object
SyntheticsTestRestrictionPolicyBindingPrincipal:
SyntheticsTestRestrictionPolicyBindingPrincipals:
description: List of principals for a mobile test binding.
items:
description: A principal for a mobile test binding.
Expand Down
42 changes: 21 additions & 21 deletions api/datadogV1/model_synthetics_test_restriction_policy_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// SyntheticsTestRestrictionPolicyBinding Objects describing the binding used for a mobile test.
type SyntheticsTestRestrictionPolicyBinding struct {
// List of principals for a mobile test binding.
Principal []string `json:"principal,omitempty"`
Principals []string `json:"principals,omitempty"`
// The type of relation for the binding.
Relation *SyntheticsTestRestrictionPolicyBindingRelation `json:"relation,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -36,32 +36,32 @@ func NewSyntheticsTestRestrictionPolicyBindingWithDefaults() *SyntheticsTestRest
return &this
}

// GetPrincipal returns the Principal field value if set, zero value otherwise.
func (o *SyntheticsTestRestrictionPolicyBinding) GetPrincipal() []string {
if o == nil || o.Principal == nil {
// GetPrincipals returns the Principals field value if set, zero value otherwise.
func (o *SyntheticsTestRestrictionPolicyBinding) GetPrincipals() []string {
if o == nil || o.Principals == nil {
var ret []string
return ret
}
return o.Principal
return o.Principals
}

// GetPrincipalOk returns a tuple with the Principal field value if set, nil otherwise
// GetPrincipalsOk returns a tuple with the Principals field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTestRestrictionPolicyBinding) GetPrincipalOk() (*[]string, bool) {
if o == nil || o.Principal == nil {
func (o *SyntheticsTestRestrictionPolicyBinding) GetPrincipalsOk() (*[]string, bool) {
if o == nil || o.Principals == nil {
return nil, false
}
return &o.Principal, true
return &o.Principals, true
}

// HasPrincipal returns a boolean if a field has been set.
func (o *SyntheticsTestRestrictionPolicyBinding) HasPrincipal() bool {
return o != nil && o.Principal != nil
// HasPrincipals returns a boolean if a field has been set.
func (o *SyntheticsTestRestrictionPolicyBinding) HasPrincipals() bool {
return o != nil && o.Principals != nil
}

// SetPrincipal gets a reference to the given []string and assigns it to the Principal field.
func (o *SyntheticsTestRestrictionPolicyBinding) SetPrincipal(v []string) {
o.Principal = v
// SetPrincipals gets a reference to the given []string and assigns it to the Principals field.
func (o *SyntheticsTestRestrictionPolicyBinding) SetPrincipals(v []string) {
o.Principals = v
}

// GetRelation returns the Relation field value if set, zero value otherwise.
Expand Down Expand Up @@ -98,8 +98,8 @@ func (o SyntheticsTestRestrictionPolicyBinding) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Principal != nil {
toSerialize["principal"] = o.Principal
if o.Principals != nil {
toSerialize["principals"] = o.Principals
}
if o.Relation != nil {
toSerialize["relation"] = o.Relation
Expand All @@ -114,21 +114,21 @@ func (o SyntheticsTestRestrictionPolicyBinding) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *SyntheticsTestRestrictionPolicyBinding) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Principal []string `json:"principal,omitempty"`
Relation *SyntheticsTestRestrictionPolicyBindingRelation `json:"relation,omitempty"`
Principals []string `json:"principals,omitempty"`
Relation *SyntheticsTestRestrictionPolicyBindingRelation `json:"relation,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"principal", "relation"})
datadog.DeleteKeys(additionalProperties, &[]string{"principals", "relation"})
} else {
return err
}

hasInvalidField := false
o.Principal = all.Principal
o.Principals = all.Principals
if all.Relation != nil && !all.Relation.IsValid() {
hasInvalidField = true
} else {
Expand Down
8 changes: 4 additions & 4 deletions tests/scenarios/features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Feature: Synthetics
@generated @skip @team:DataDog/synthetics-ct
Scenario: Create a mobile test returns "- JSON format is wrong" response
Given new "CreateSyntheticsMobileTest" request
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principal": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
When the request is sent
Then the response status is 400 - JSON format is wrong

Expand All @@ -147,7 +147,7 @@ Feature: Synthetics
@generated @skip @team:DataDog/synthetics-ct
Scenario: Create a mobile test returns "Test quota is reached" response
Given new "CreateSyntheticsMobileTest" request
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principal": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
When the request is sent
Then the response status is 402 Test quota is reached

Expand Down Expand Up @@ -361,15 +361,15 @@ Feature: Synthetics
Scenario: Edit a Mobile test returns "- JSON format is wrong" response
Given new "UpdateMobileTest" request
And request contains "public_id" parameter from "REPLACE.ME"
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principal": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
When the request is sent
Then the response status is 400 - JSON format is wrong

@generated @skip @team:DataDog/synthetics-ct
Scenario: Edit a Mobile test returns "- Synthetic Monitoring is not activated for the user" response
Given new "UpdateMobileTest" request
And request contains "public_id" parameter from "REPLACE.ME"
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principal": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"}
When the request is sent
Then the response status is 404 - Synthetic Monitoring is not activated for the user

Expand Down
Loading