Skip to content

Commit

Permalink
Fix typo in service definition field (#2266)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 8, 2023
1 parent e1e0f74 commit 7d447c3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 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": "2023-11-06 16:31:23.277431",
"spec_repo_commit": "62fc6756"
"regenerated": "2023-11-07 09:02:07.260512",
"spec_repo_commit": "c7428dad"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-06 16:31:23.296834",
"spec_repo_commit": "62fc6756"
"regenerated": "2023-11-07 09:02:07.281798",
"spec_repo_commit": "c7428dad"
}
}
}
2 changes: 1 addition & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16378,7 +16378,7 @@ components:
type: object
integrations:
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Integrations'
langauges:
languages:
description: 'The service''s programming language. Datadog recognizes the
following languages: `dotnet`, `go`, `java`, `js`, `php`, `python`, `ruby`,
and `c++`.'
Expand Down
40 changes: 20 additions & 20 deletions api/datadogV2/model_service_definition_v2_dot2.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type ServiceDefinitionV2Dot2 struct {
// Third party integrations that Datadog supports.
Integrations *ServiceDefinitionV2Dot2Integrations `json:"integrations,omitempty"`
// The service's programming language. Datadog recognizes the following languages: `dotnet`, `go`, `java`, `js`, `php`, `python`, `ruby`, and `c++`.
Langauges []string `json:"langauges,omitempty"`
Languages []string `json:"languages,omitempty"`
// The current life cycle phase of the service.
Lifecycle *string `json:"lifecycle,omitempty"`
// A list of links related to the services.
Expand Down Expand Up @@ -231,32 +231,32 @@ func (o *ServiceDefinitionV2Dot2) SetIntegrations(v ServiceDefinitionV2Dot2Integ
o.Integrations = &v
}

// GetLangauges returns the Langauges field value if set, zero value otherwise.
func (o *ServiceDefinitionV2Dot2) GetLangauges() []string {
if o == nil || o.Langauges == nil {
// GetLanguages returns the Languages field value if set, zero value otherwise.
func (o *ServiceDefinitionV2Dot2) GetLanguages() []string {
if o == nil || o.Languages == nil {
var ret []string
return ret
}
return o.Langauges
return o.Languages
}

// GetLangaugesOk returns a tuple with the Langauges field value if set, nil otherwise
// GetLanguagesOk returns a tuple with the Languages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ServiceDefinitionV2Dot2) GetLangaugesOk() (*[]string, bool) {
if o == nil || o.Langauges == nil {
func (o *ServiceDefinitionV2Dot2) GetLanguagesOk() (*[]string, bool) {
if o == nil || o.Languages == nil {
return nil, false
}
return &o.Langauges, true
return &o.Languages, true
}

// HasLangauges returns a boolean if a field has been set.
func (o *ServiceDefinitionV2Dot2) HasLangauges() bool {
return o != nil && o.Langauges != nil
// HasLanguages returns a boolean if a field has been set.
func (o *ServiceDefinitionV2Dot2) HasLanguages() bool {
return o != nil && o.Languages != nil
}

// SetLangauges gets a reference to the given []string and assigns it to the Langauges field.
func (o *ServiceDefinitionV2Dot2) SetLangauges(v []string) {
o.Langauges = v
// SetLanguages gets a reference to the given []string and assigns it to the Languages field.
func (o *ServiceDefinitionV2Dot2) SetLanguages(v []string) {
o.Languages = v
}

// GetLifecycle returns the Lifecycle field value if set, zero value otherwise.
Expand Down Expand Up @@ -472,8 +472,8 @@ func (o ServiceDefinitionV2Dot2) MarshalJSON() ([]byte, error) {
if o.Integrations != nil {
toSerialize["integrations"] = o.Integrations
}
if o.Langauges != nil {
toSerialize["langauges"] = o.Langauges
if o.Languages != nil {
toSerialize["languages"] = o.Languages
}
if o.Lifecycle != nil {
toSerialize["lifecycle"] = o.Lifecycle
Expand Down Expand Up @@ -510,7 +510,7 @@ func (o *ServiceDefinitionV2Dot2) UnmarshalJSON(bytes []byte) (err error) {
Description *string `json:"description,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
Integrations *ServiceDefinitionV2Dot2Integrations `json:"integrations,omitempty"`
Langauges []string `json:"langauges,omitempty"`
Languages []string `json:"languages,omitempty"`
Lifecycle *string `json:"lifecycle,omitempty"`
Links []ServiceDefinitionV2Dot2Link `json:"links,omitempty"`
SchemaVersion *ServiceDefinitionV2Dot2Version `json:"schema-version"`
Expand All @@ -530,7 +530,7 @@ func (o *ServiceDefinitionV2Dot2) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"application", "contacts", "dd-service", "description", "extensions", "integrations", "langauges", "lifecycle", "links", "schema-version", "tags", "team", "tier", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"application", "contacts", "dd-service", "description", "extensions", "integrations", "languages", "lifecycle", "links", "schema-version", "tags", "team", "tier", "type"})
} else {
return err
}
Expand All @@ -545,7 +545,7 @@ func (o *ServiceDefinitionV2Dot2) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Integrations = all.Integrations
o.Langauges = all.Langauges
o.Languages = all.Languages
o.Lifecycle = all.Lifecycle
o.Links = all.Links
if !all.SchemaVersion.IsValid() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
ServiceUrl: datadog.PtrString("https://my-org.pagerduty.com/service-directory/PMyService"),
},
},
Langauges: []string{
Languages: []string{
"dotnet",
"go",
"java",
Expand Down
6 changes: 3 additions & 3 deletions tests/scenarios/features/v2/service_definition.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ Feature: Service Definition
@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "Bad Request" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "langauges": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "CREATED" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "langauges": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 200 CREATED

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "Conflict" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "langauges": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 409 Conflict

Expand Down

0 comments on commit 7d447c3

Please sign in to comment.