Skip to content

Commit d1e66e2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Rename service-type to type and change it to an enum field (#1373)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent ef4a4ad commit d1e66e2

File tree

8 files changed

+77
-21
lines changed

8 files changed

+77
-21
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-10-12 18:33:15.737741",
8-
"spec_repo_commit": "1ddbcdce"
7+
"regenerated": "2023-10-12 21:14:51.256355",
8+
"spec_repo_commit": "d4c17bf0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-10-12 18:33:15.759453",
13-
"spec_repo_commit": "1ddbcdce"
12+
"regenerated": "2023-10-12 21:14:51.274723",
13+
"spec_repo_commit": "d4c17bf0"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15836,11 +15836,6 @@ components:
1583615836
type: array
1583715837
schema-version:
1583815838
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Version'
15839-
service-type:
15840-
description: 'The type of service. Datadog recognizes the following service
15841-
types: `database`, `cache`, `function`, `web`, `browser`, and `mobile`.'
15842-
example: web
15843-
type: string
1584415839
tags:
1584515840
description: A set of custom tags.
1584615841
example:
@@ -15858,6 +15853,8 @@ components:
1585815853
description: Importance of the service.
1585915854
example: High
1586015855
type: string
15856+
type:
15857+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Type'
1586115858
required:
1586215859
- schema-version
1586315860
- dd-service
@@ -15945,6 +15942,26 @@ components:
1594515942
example: https://my-org.pagerduty.com/service-directory/PMyService
1594615943
type: string
1594715944
type: object
15945+
ServiceDefinitionV2Dot2Type:
15946+
description: The type of service.
15947+
enum:
15948+
- web
15949+
- db
15950+
- cache
15951+
- function
15952+
- browser
15953+
- mobile
15954+
- custom
15955+
example: web
15956+
type: string
15957+
x-enum-varnames:
15958+
- WEB
15959+
- DB
15960+
- CACHE
15961+
- FUNCTION
15962+
- BROSWER
15963+
- MOBILE
15964+
- CUSTOM
1594815965
ServiceDefinitionV2Dot2Version:
1594915966
default: v2.2
1595015967
description: Schema version being used.

examples/v2/service-definition/CreateOrUpdateServiceDefinitions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ const params: v2.ServiceDefinitionApiCreateOrUpdateServiceDefinitionsRequest = {
4343
},
4444
],
4545
schemaVersion: "v2.2",
46-
serviceType: "web",
4746
tags: ["my:tag", "service:tag"],
4847
team: "my-team",
4948
tier: "High",
49+
type: "web",
5050
},
5151
};
5252

features/v2/service_definition.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ Feature: Service Definition
1010
@generated @skip @team:DataDog/service-catalog
1111
Scenario: Create or update service definition returns "Bad Request" response
1212
Given new "CreateOrUpdateServiceDefinitions" request
13-
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", "service-type": "web", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High"}
13+
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"}
1414
When the request is sent
1515
Then the response status is 400 Bad Request
1616

1717
@generated @skip @team:DataDog/service-catalog
1818
Scenario: Create or update service definition returns "CREATED" response
1919
Given new "CreateOrUpdateServiceDefinitions" request
20-
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", "service-type": "web", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High"}
20+
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"}
2121
When the request is sent
2222
Then the response status is 200 CREATED
2323

2424
@generated @skip @team:DataDog/service-catalog
2525
Scenario: Create or update service definition returns "Conflict" response
2626
Given new "CreateOrUpdateServiceDefinitions" request
27-
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", "service-type": "web", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High"}
27+
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"}
2828
When the request is sent
2929
Then the response status is 409 Conflict
3030

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ export { ServiceDefinitionV2Dot2Link } from "./models/ServiceDefinitionV2Dot2Lin
14031403
export { ServiceDefinitionV2Dot2Opsgenie } from "./models/ServiceDefinitionV2Dot2Opsgenie";
14041404
export { ServiceDefinitionV2Dot2OpsgenieRegion } from "./models/ServiceDefinitionV2Dot2OpsgenieRegion";
14051405
export { ServiceDefinitionV2Dot2Pagerduty } from "./models/ServiceDefinitionV2Dot2Pagerduty";
1406+
export { ServiceDefinitionV2Dot2Type } from "./models/ServiceDefinitionV2Dot2Type";
14061407
export { ServiceDefinitionV2Dot2Version } from "./models/ServiceDefinitionV2Dot2Version";
14071408
export { ServiceDefinitionV2Email } from "./models/ServiceDefinitionV2Email";
14081409
export { ServiceDefinitionV2EmailType } from "./models/ServiceDefinitionV2EmailType";

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,15 @@ const enumsMap: { [key: string]: any[] } = {
13141314
ServiceDefinitionV2Dot1SlackType: ["slack"],
13151315
ServiceDefinitionV2Dot1Version: ["v2.1"],
13161316
ServiceDefinitionV2Dot2OpsgenieRegion: ["US", "EU"],
1317+
ServiceDefinitionV2Dot2Type: [
1318+
"web",
1319+
"db",
1320+
"cache",
1321+
"function",
1322+
"browser",
1323+
"mobile",
1324+
"custom",
1325+
],
13171326
ServiceDefinitionV2Dot2Version: ["v2.2"],
13181327
ServiceDefinitionV2EmailType: ["email"],
13191328
ServiceDefinitionV2LinkType: [

packages/datadog-api-client-v2/models/ServiceDefinitionV2Dot2.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { ServiceDefinitionV2Dot2Contact } from "./ServiceDefinitionV2Dot2Contact";
77
import { ServiceDefinitionV2Dot2Integrations } from "./ServiceDefinitionV2Dot2Integrations";
88
import { ServiceDefinitionV2Dot2Link } from "./ServiceDefinitionV2Dot2Link";
9+
import { ServiceDefinitionV2Dot2Type } from "./ServiceDefinitionV2Dot2Type";
910
import { ServiceDefinitionV2Dot2Version } from "./ServiceDefinitionV2Dot2Version";
1011

1112
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
@@ -54,10 +55,6 @@ export class ServiceDefinitionV2Dot2 {
5455
* Schema version being used.
5556
*/
5657
"schemaVersion": ServiceDefinitionV2Dot2Version;
57-
/**
58-
* The type of service. Datadog recognizes the following service types: `database`, `cache`, `function`, `web`, `browser`, and `mobile`.
59-
*/
60-
"serviceType"?: string;
6158
/**
6259
* A set of custom tags.
6360
*/
@@ -70,6 +67,10 @@ export class ServiceDefinitionV2Dot2 {
7067
* Importance of the service.
7168
*/
7269
"tier"?: string;
70+
/**
71+
* The type of service.
72+
*/
73+
"type"?: ServiceDefinitionV2Dot2Type;
7374

7475
/**
7576
* @ignore
@@ -122,10 +123,6 @@ export class ServiceDefinitionV2Dot2 {
122123
type: "ServiceDefinitionV2Dot2Version",
123124
required: true,
124125
},
125-
serviceType: {
126-
baseName: "service-type",
127-
type: "string",
128-
},
129126
tags: {
130127
baseName: "tags",
131128
type: "Array<string>",
@@ -138,6 +135,10 @@ export class ServiceDefinitionV2Dot2 {
138135
baseName: "tier",
139136
type: "string",
140137
},
138+
type: {
139+
baseName: "type",
140+
type: "ServiceDefinitionV2Dot2Type",
141+
},
141142
};
142143

143144
/**
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* The type of service.
11+
*/
12+
13+
export type ServiceDefinitionV2Dot2Type =
14+
| typeof WEB
15+
| typeof DB
16+
| typeof CACHE
17+
| typeof FUNCTION
18+
| typeof BROSWER
19+
| typeof MOBILE
20+
| typeof CUSTOM
21+
| UnparsedObject;
22+
export const WEB = "web";
23+
export const DB = "db";
24+
export const CACHE = "cache";
25+
export const FUNCTION = "function";
26+
export const BROSWER = "browser";
27+
export const MOBILE = "mobile";
28+
export const CUSTOM = "custom";

0 commit comments

Comments
 (0)