diff --git a/.apigentools-info b/.apigentools-info index c5560ffb2a95..7c7df01485c9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-10 18:01:23.455805", - "spec_repo_commit": "c0a45137" + "regenerated": "2025-04-11 12:59:04.852679", + "spec_repo_commit": "7307da21" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-10 18:01:23.473008", - "spec_repo_commit": "c0a45137" + "regenerated": "2025-04-11 12:59:04.868530", + "spec_repo_commit": "7307da21" } } } \ No newline at end of file diff --git a/.generator/conftest.py b/.generator/conftest.py index f0ac2860d1a2..3057db843fba 100644 --- a/.generator/conftest.py +++ b/.generator/conftest.py @@ -281,7 +281,8 @@ def operation_specs(specs): def api(context, api_version, specs, name): """Return an API instance.""" assert name in {tag["name"].replace(" ", "") for tag in specs[api_version]["tags"]} - context["api_instance"] = {"name": name} + api_name = name.replace("-", "") + context["api_instance"] = {"name": api_name} @given(parsers.parse('operation "{name}" enabled')) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d2075b54e4c5..7004492f437b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17557,6 +17557,164 @@ components: - index - caseIndex type: object + Layer: + description: Encapsulates a layer resource, holding attributes like rotation + details, plus relationships to the members covering that layer. + properties: + attributes: + $ref: '#/components/schemas/LayerAttributes' + id: + description: A unique identifier for this layer. + type: string + relationships: + $ref: '#/components/schemas/LayerRelationships' + type: + $ref: '#/components/schemas/LayerType' + type: object + LayerAttributes: + description: Describes key properties of a Layer, including rotation details, + name, start/end times, and any restrictions. + properties: + effective_date: + description: When the layer becomes active (ISO 8601). + format: date-time + type: string + end_date: + description: When the layer ceases to be active (ISO 8601). + format: date-time + type: string + interval: + $ref: '#/components/schemas/LayerAttributesInterval' + name: + description: The name of this layer. + example: Weekend Layer + type: string + restrictions: + description: An optional list of time restrictions for when this layer is + in effect. + items: + $ref: '#/components/schemas/LayerAttributesRestrictionsItems' + type: array + rotation_start: + description: The date/time when the rotation starts (ISO 8601). + format: date-time + type: string + type: object + LayerAttributesInterval: + description: Defines how often the rotation repeats, using a combination of + days and optional seconds. + properties: + days: + description: The number of days in each rotation cycle. + format: int32 + maximum: 400 + type: integer + seconds: + description: Any additional seconds for the rotation cycle (up to 30 days). + format: int64 + maximum: 2592000 + type: integer + type: object + LayerAttributesRestrictionsItems: + description: 'Represents a time restriction within a layer, specifying the days + and times + + when this layer is active or inactive.' + properties: + end_day: + $ref: '#/components/schemas/LayerAttributesRestrictionsItemsEndDay' + end_time: + description: The time of day the restriction ends (hh:mm:ss). + type: string + start_day: + $ref: '#/components/schemas/LayerAttributesRestrictionsItemsStartDay' + start_time: + description: The time of day the restriction begins (hh:mm:ss). + type: string + type: object + LayerAttributesRestrictionsItemsEndDay: + description: Defines the end day of the restriction within a Layer. + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + LayerAttributesRestrictionsItemsStartDay: + description: Defines the start day of the restriction within a Layer. + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + LayerRelationships: + description: Holds references to objects related to the Layer entity, such as + its members. + properties: + members: + $ref: '#/components/schemas/LayerRelationshipsMembers' + type: object + LayerRelationshipsMembers: + description: Holds an array of references to the members of a Layer, each containing + member IDs. + properties: + data: + description: The list of members who belong to this layer. + items: + $ref: '#/components/schemas/LayerRelationshipsMembersDataItems' + type: array + type: object + LayerRelationshipsMembersDataItems: + description: 'Represents a single member object in a layer''s `members` array, + referencing + + a unique Datadog user ID.' + properties: + id: + description: The unique user ID of the layer member. + type: string + type: + $ref: '#/components/schemas/LayerRelationshipsMembersDataItemsType' + type: object + LayerRelationshipsMembersDataItemsType: + default: members + description: Members resource type. + enum: + - members + type: string + x-enum-varnames: + - MEMBERS + LayerType: + default: layers + description: Layers resource type. + enum: + - layers + type: string + x-enum-varnames: + - LAYERS LeakedKey: description: The definition of LeakedKey object. properties: @@ -26877,6 +27035,500 @@ components: type: $ref: '#/components/schemas/ScalarFormulaResponseType' type: object + Schedule: + description: Top-level container for a schedule object, including both the `data` + payload and any related `included` resources (such as teams, layers, or members). + example: + data: + attributes: + name: On-Call Schedule + tags: + - tag1 + - tag2 + time_zone: America/New_York + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + layers: + data: + - id: 00000000-0000-0000-0000-000000000001 + type: layers + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: schedules + included: + - attributes: + avatar: '' + description: Team 1 description + handle: team1 + name: Team 1 + id: 00000000-da3a-0000-0000-000000000000 + type: teams + - attributes: + effective_date: '2025-02-03T05:00:00Z' + end_date: '2025-12-31T00:00:00Z' + interval: + days: 1 + name: Layer 1 + restrictions: + - end_day: friday + end_time: '17:00:00' + start_day: monday + start_time: 09:00:00 + rotation_start: '2025-02-01T00:00:00Z' + id: 00000000-0000-0000-0000-000000000001 + relationships: + members: + data: + - id: 00000000-0000-0000-0000-000000000002 + type: members + type: layers + - id: 00000000-0000-0000-0000-000000000002 + relationships: + user: + data: + id: 00000000-aba1-0000-0000-000000000000 + type: users + type: members + - attributes: + email: foo@bar.com + name: User 1 + id: 00000000-aba1-0000-0000-000000000000 + type: users + properties: + data: + $ref: '#/components/schemas/ScheduleData' + included: + description: Any additional resources related to this schedule, such as + teams and layers. + items: + $ref: '#/components/schemas/ScheduleDataIncludedItem' + type: array + type: object + ScheduleCreateRequest: + description: The top-level request body for schedule creation, wrapping a `data` + object. + example: + data: + attributes: + layers: + - effective_date: '2025-02-03T05:00:00Z' + end_date: '2025-12-31T00:00:00Z' + interval: + days: 1 + members: + - user: + id: 00000000-aba1-0000-0000-000000000000 + name: Layer 1 + restrictions: + - end_day: friday + end_time: '17:00:00' + start_day: monday + start_time: 09:00:00 + rotation_start: '2025-02-01T00:00:00Z' + name: On-Call Schedule + tags: + - tag1 + - tag2 + time_zone: America/New_York + relationships: + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: schedules + properties: + data: + $ref: '#/components/schemas/ScheduleCreateRequestData' + required: + - data + type: object + ScheduleCreateRequestData: + description: The core data wrapper for creating a schedule, encompassing attributes, + relationships, and the resource type. + properties: + attributes: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributes' + relationships: + $ref: '#/components/schemas/ScheduleCreateRequestDataRelationships' + type: + $ref: '#/components/schemas/ScheduleCreateRequestDataType' + required: + - attributes + - type + type: object + ScheduleCreateRequestDataAttributes: + description: Describes the main attributes for creating a new schedule, including + name, layers, time zone, and tags. + properties: + layers: + description: The layers of on-call coverage that define rotation intervals + and restrictions. + items: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItems' + type: array + name: + description: A human-readable name for the new schedule. + example: Team A On-Call + type: string + tags: + description: A list of tags for categorizing or filtering the schedule. + items: + type: string + type: array + time_zone: + description: The time zone in which the schedule is defined. + example: America/New_York + type: string + required: + - name + - time_zone + - layers + type: object + ScheduleCreateRequestDataAttributesLayersItems: + description: Describes a schedule layer, including rotation intervals, members, + restrictions, and timeline settings. + properties: + effective_date: + description: The date/time when this layer becomes active (in ISO 8601). + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + end_date: + description: The date/time after which this layer no longer applies (in + ISO 8601). + format: date-time + type: string + interval: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsInterval' + members: + description: A list of members who participate in this layer's rotation. + items: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsMembersItems' + type: array + name: + description: The name of this layer. + example: Primary On-Call Layer + type: string + restrictions: + description: Zero or more time-based restrictions (for example, only weekdays, + during business hours). + items: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems' + type: array + rotation_start: + description: The date/time when the rotation for this layer starts (in ISO + 8601). + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + required: + - name + - interval + - rotation_start + - effective_date + - members + type: object + ScheduleCreateRequestDataAttributesLayersItemsInterval: + description: Defines how frequently the rotation repeats, using days and/or + seconds (up to certain limits). + properties: + days: + description: The number of full days in each rotation period. + format: int32 + maximum: 400 + type: integer + seconds: + description: Extra seconds that may be added to extend the rotation beyond + whole days. + format: int64 + maximum: 2592000 + type: integer + type: object + ScheduleCreateRequestDataAttributesLayersItemsMembersItems: + description: Defines a single member within a schedule layer, including the + reference to the underlying user. + properties: + user: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser' + type: object + ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser: + description: Identifies the user participating in this layer as a single object + with an `id`. + properties: + id: + description: The user's ID. + type: string + type: object + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems: + description: 'Defines a time restriction for a schedule layer, including which + day of the week + + it starts and ends, along with start/end times.' + properties: + end_day: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay' + end_time: + description: The time of day when the restriction ends (hh:mm:ss). + type: string + start_day: + $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay' + start_time: + description: The time of day when the restriction begins (hh:mm:ss). + type: string + type: object + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: + description: The weekday when the restriction period ends (Monday through Sunday). + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: + description: The weekday when the restriction period starts (Monday through + Sunday). + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + ScheduleCreateRequestDataRelationships: + description: Gathers relationship objects for the schedule creation request, + including the teams to associate. + properties: + teams: + $ref: '#/components/schemas/ScheduleCreateRequestDataRelationshipsTeams' + type: object + ScheduleCreateRequestDataRelationshipsTeams: + description: Associates the new schedule with one or more teams. + properties: + data: + description: An array of team references for this schedule. + items: + $ref: '#/components/schemas/ScheduleCreateRequestDataRelationshipsTeamsDataItems' + type: array + type: object + ScheduleCreateRequestDataRelationshipsTeamsDataItems: + description: 'Holds the relationship data linking this schedule to a particular + team, + + identified by `id` and `type`.' + properties: + id: + description: A unique identifier for the team. + type: string + type: + $ref: '#/components/schemas/ScheduleCreateRequestDataRelationshipsTeamsDataItemsType' + type: object + ScheduleCreateRequestDataRelationshipsTeamsDataItemsType: + default: teams + description: Teams resource type. + enum: + - teams + type: string + x-enum-varnames: + - TEAMS + ScheduleCreateRequestDataType: + default: schedules + description: Schedules resource type. + enum: + - schedules + example: schedules + type: string + x-enum-varnames: + - SCHEDULES + ScheduleData: + description: Represents the primary data object for a schedule, linking attributes + and relationships. + properties: + attributes: + $ref: '#/components/schemas/ScheduleDataAttributes' + id: + description: The schedule's unique identifier. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + relationships: + $ref: '#/components/schemas/ScheduleDataRelationships' + type: + $ref: '#/components/schemas/ScheduleDataType' + type: object + ScheduleDataAttributes: + description: Provides core properties of a schedule object, such as its name, + time zone, and tags. + properties: + name: + description: A short name for the schedule. + example: Primary On-Call + type: string + tags: + description: A list of tags associated with this schedule. + items: + type: string + type: array + time_zone: + description: The time zone in which this schedule operates. + example: America/New_York + type: string + type: object + ScheduleDataIncludedItem: + description: Any additional resources related to this schedule, such as teams + and layers. + oneOf: + - $ref: '#/components/schemas/TeamReference' + - $ref: '#/components/schemas/Layer' + - $ref: '#/components/schemas/ScheduleMember' + - $ref: '#/components/schemas/ScheduleUser' + ScheduleDataRelationships: + description: Groups the relationships for a schedule object, referencing layers + and teams. + properties: + layers: + $ref: '#/components/schemas/ScheduleDataRelationshipsLayers' + teams: + $ref: '#/components/schemas/ScheduleDataRelationshipsTeams' + type: object + ScheduleDataRelationshipsLayers: + description: Associates layers with this schedule in a data structure. + properties: + data: + description: An array of layer references for this schedule. + items: + $ref: '#/components/schemas/ScheduleDataRelationshipsLayersDataItems' + type: array + type: object + ScheduleDataRelationshipsLayersDataItems: + description: Relates a layer to this schedule, identified by `id` and `type` + (must be `layers`). + properties: + id: + description: The unique identifier of the layer in this relationship. + example: 67963b57-d67c-dfa7-b180-62ee9301d2f5 + type: string + type: + $ref: '#/components/schemas/ScheduleDataRelationshipsLayersDataItemsType' + type: object + ScheduleDataRelationshipsLayersDataItemsType: + default: layers + description: Layers resource type. + enum: + - layers + example: layers + type: string + x-enum-varnames: + - LAYERS + ScheduleDataRelationshipsTeams: + description: Associates teams with this schedule in a data structure. + properties: + data: + description: An array of team references for this schedule. + items: + $ref: '#/components/schemas/ScheduleDataRelationshipsTeamsDataItems' + type: array + type: object + ScheduleDataRelationshipsTeamsDataItems: + description: Relates a team to this schedule, identified by `id` and `type` + (must be `teams`). + properties: + id: + description: The unique identifier of the team in this relationship. + example: 00000000-da3a-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/ScheduleDataRelationshipsTeamsDataItemsType' + type: object + ScheduleDataRelationshipsTeamsDataItemsType: + default: teams + description: Teams resource type. + enum: + - teams + example: teams + type: string + x-enum-varnames: + - TEAMS + ScheduleDataType: + default: schedules + description: Schedules resource type. + enum: + - schedules + type: string + x-enum-varnames: + - SCHEDULES + ScheduleMember: + description: Represents a single member entry in a schedule, referencing a specific + user. + properties: + id: + description: The unique identifier for this schedule member. + type: string + relationships: + $ref: '#/components/schemas/ScheduleMemberRelationships' + type: + $ref: '#/components/schemas/ScheduleMemberType' + type: object + ScheduleMemberRelationships: + description: Defines relationships for a schedule member, primarily referencing + a single user. + properties: + user: + $ref: '#/components/schemas/ScheduleMemberRelationshipsUser' + type: object + ScheduleMemberRelationshipsUser: + description: Wraps the user data reference for a schedule member. + properties: + data: + $ref: '#/components/schemas/ScheduleMemberRelationshipsUserData' + type: object + ScheduleMemberRelationshipsUserData: + description: Points to the user data associated with this schedule member, including + an ID and type. + properties: + id: + description: The user's unique identifier. + type: string + type: + $ref: '#/components/schemas/ScheduleMemberRelationshipsUserDataType' + type: object + ScheduleMemberRelationshipsUserDataType: + default: users + description: Users resource type. + enum: + - users + type: string + x-enum-varnames: + - USERS + ScheduleMemberType: + default: members + description: Schedule Members resource type. + enum: + - members + type: string + x-enum-varnames: + - MEMBERS ScheduleTrigger: description: Trigger a workflow from a Schedule. The workflow must be published. properties: @@ -26897,6 +27549,296 @@ components: required: - scheduleTrigger type: object + ScheduleUpdateRequest: + description: A top-level wrapper for a schedule update request, referring to + the `data` object with the new details. + example: + data: + attributes: + layers: + - effective_date: '2025-02-03T05:00:00Z' + end_date: '2025-12-31T00:00:00Z' + interval: + seconds: 300 + members: + - user: + id: 00000000-aba1-0000-0000-000000000000 + name: Layer 1 + restrictions: + - end_day: friday + end_time: '17:00:00' + start_day: monday + start_time: 09:00:00 + rotation_start: '2025-02-01T00:00:00Z' + name: On-Call Schedule Updated + tags: + - tag1 + - tag2 + - tag3 + time_zone: America/New_York + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: schedules + properties: + data: + $ref: '#/components/schemas/ScheduleUpdateRequestData' + required: + - data + type: object + ScheduleUpdateRequestData: + description: Contains all data needed to update an existing schedule, including + its attributes (such as name, layers, or tags) and any relationships to teams. + properties: + attributes: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributes' + id: + description: The ID of the schedule to be updated. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + relationships: + $ref: '#/components/schemas/ScheduleUpdateRequestDataRelationships' + type: + $ref: '#/components/schemas/ScheduleUpdateRequestDataType' + required: + - attributes + - type + - id + type: object + ScheduleUpdateRequestDataAttributes: + description: Defines the updatable attributes for a schedule, such as name, + time zone, tags, and layers. + properties: + layers: + description: The updated list of layers (rotations) for this schedule. + items: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItems' + type: array + name: + description: A short name for the schedule. + example: Primary On-Call + type: string + tags: + description: A list of tags that you can associate with this schedule. + example: + - front-end + - team-a + items: + type: string + type: array + time_zone: + description: The time zone used when interpreting rotation times. + example: America/New_York + type: string + required: + - name + - time_zone + - layers + type: object + ScheduleUpdateRequestDataAttributesLayersItems: + description: 'Represents a layer within a schedule update, including rotation + details, members, + + and optional restrictions.' + properties: + effective_date: + description: When this updated layer takes effect (ISO 8601 format). + format: date-time + type: string + end_date: + description: When this updated layer should stop being active (ISO 8601 + format). + format: date-time + type: string + id: + description: A unique identifier for the layer being updated. + type: string + interval: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsInterval' + members: + description: The members assigned to this layer. + items: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsMembersItems' + type: array + name: + description: "The name for this layer (for example, \u201CSecondary Coverage\u201D)." + type: string + restrictions: + description: Any time restrictions that define when this layer is active. + items: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems' + type: array + rotation_start: + description: The date/time at which the rotation begins (ISO 8601 format). + format: date-time + type: string + type: object + ScheduleUpdateRequestDataAttributesLayersItemsInterval: + description: 'Specifies how the rotation repeats: number of days, plus optional + seconds, up to the given maximums.' + properties: + days: + description: How many days each rotation cycle should span. + format: int32 + maximum: 400 + type: integer + seconds: + description: Additional seconds to add to the rotation cycle (for example, + partial days). + format: int64 + maximum: 2592000 + type: integer + type: object + ScheduleUpdateRequestDataAttributesLayersItemsMembersItems: + description: 'Defines a single member within a layer during an update request, + referring + + to a specific user.' + properties: + user: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser' + type: object + ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser: + description: Identifies the user who is assigned to this member object. Only + `id` is required. + properties: + id: + description: The user's ID. + type: string + type: object + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems: + description: 'Defines a time restriction object for a layer within a schedule + update, including + + start and end days, as well as times.' + properties: + end_day: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay' + end_time: + description: The time at which this restriction ends (hh:mm:ss). + type: string + start_day: + $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay' + start_time: + description: The time at which this restriction starts (hh:mm:ss). + type: string + type: object + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: + description: Defines the day of the week on which the time restriction ends. + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: + description: Defines the day of the week on which the time restriction starts. + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + ScheduleUpdateRequestDataRelationships: + description: Houses relationships for the schedule update, typically referencing + teams. + properties: + teams: + $ref: '#/components/schemas/ScheduleUpdateRequestDataRelationshipsTeams' + type: object + ScheduleUpdateRequestDataRelationshipsTeams: + description: Defines the teams that this schedule update is associated with. + properties: + data: + description: An array of team references. + items: + $ref: '#/components/schemas/ScheduleUpdateRequestDataRelationshipsTeamsDataItems' + type: array + type: object + ScheduleUpdateRequestDataRelationshipsTeamsDataItems: + description: Links the schedule to a team within an update request, identified + by `id` and `type`. + properties: + id: + description: The unique team identifier. + type: string + type: + $ref: '#/components/schemas/ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType' + type: object + ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType: + default: teams + description: Teams resource type. + enum: + - teams + type: string + x-enum-varnames: + - TEAMS + ScheduleUpdateRequestDataType: + default: schedules + description: Schedules resource type. + enum: + - schedules + example: schedules + type: string + x-enum-varnames: + - SCHEDULES + ScheduleUser: + description: Represents a user object in the context of a schedule, including + their `id`, type, and basic attributes. + properties: + attributes: + $ref: '#/components/schemas/ScheduleUserAttributes' + id: + description: The unique user identifier. + type: string + type: + $ref: '#/components/schemas/ScheduleUserType' + type: object + ScheduleUserAttributes: + description: Provides basic user information for a schedule, including a name + and email address. + properties: + email: + description: The user's email address. + type: string + name: + description: The user's name. + example: Jane Doe + type: string + type: object + ScheduleUserType: + default: users + description: Users resource type. + enum: + - users + type: string + x-enum-varnames: + - USERS ScorecardType: default: scorecard description: The JSON:API type for scorecard. @@ -32573,6 +33515,79 @@ components: $ref: '#/components/schemas/TeamPermissionSetting' type: array type: object + TeamReference: + description: Provides a reference to a team, including ID, type, and basic attributes/relationships. + properties: + attributes: + $ref: '#/components/schemas/TeamReferenceAttributes' + id: + description: The team's unique identifier. + type: string + relationships: + $ref: '#/components/schemas/TeamReferenceRelationships' + type: + $ref: '#/components/schemas/TeamReferenceType' + type: object + TeamReferenceAttributes: + description: Encapsulates the basic attributes of a Team reference, such as + name, handle, and an optional avatar or description. + properties: + avatar: + description: URL or reference for the team's avatar (if available). + type: string + description: + description: A short text describing the team. + type: string + handle: + description: A unique handle/slug for the team. + type: string + name: + description: The full, human-readable name of the team. + type: string + type: object + TeamReferenceRelationships: + description: Collects the key relationship fields for a team reference, specifically + on-call users. + properties: + oncall_users: + $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsers' + type: object + TeamReferenceRelationshipsOncallUsers: + description: Defines which users are on-call within a team, stored as an array + of references. + properties: + data: + description: The list of user references who are on-call for this team. + items: + $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsersDataItems' + type: array + type: object + TeamReferenceRelationshipsOncallUsersDataItems: + description: References a user who is on-call within this team, identified by + `id` and `type`. + properties: + id: + description: The unique identifier of the user. + type: string + type: + $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsersDataItemsType' + type: object + TeamReferenceRelationshipsOncallUsersDataItemsType: + default: users + description: Users resource type. + enum: + - users + type: string + x-enum-varnames: + - USERS + TeamReferenceType: + default: teams + description: Teams resource type. + enum: + - teams + type: string + x-enum-varnames: + - TEAMS TeamRelationships: description: Resources related to a team properties: @@ -45194,6 +46209,161 @@ paths: x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/on-call/schedules: + post: + description: Create a new on-call schedule + operationId: CreateOnCallSchedule + parameters: + - description: 'Comma-separated list of included relationships to be returned. + Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`.' + in: query + name: include + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create on-call schedule + tags: + - On-Call + /api/v2/on-call/schedules/{schedule_id}: + delete: + description: Delete an on-call schedule + operationId: DeleteOnCallSchedule + parameters: + - description: The ID of the schedule + in: path + name: schedule_id + required: true + schema: + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + responses: + '204': + description: No Content + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete on-call schedule + tags: + - On-Call + get: + description: Get an on-call schedule + operationId: GetOnCallSchedule + parameters: + - description: 'Comma-separated list of included relationships to be returned. + Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`.' + in: query + name: include + schema: + type: string + - description: The ID of the schedule + in: path + name: schedule_id + required: true + schema: + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + description: OK + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get on-call schedule + tags: + - On-Call + put: + description: Update a new on-call schedule + operationId: UpdateOnCallSchedule + parameters: + - description: 'Comma-separated list of included relationships to be returned. + Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`.' + in: query + name: include + schema: + type: string + - description: The ID of the schedule + in: path + name: schedule_id + required: true + schema: + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Update on-call schedule + tags: + - On-Call /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -54896,6 +56066,12 @@ tags: - description: Configure your [Datadog Okta integration](https://docs.datadoghq.com/integrations/okta/) directly through the Datadog API. name: Okta Integration +- description: 'Configure your [Datadog On-Call](https://docs.datadoghq.com/service_management/on-call/) + + directly through the Datadog API.' + externalDocs: + url: https://docs.datadoghq.com/service_management/on-call/ + name: On-Call - description: 'Configure your [Datadog Opsgenie integration](https://docs.datadoghq.com/integrations/opsgenie/) directly through the Datadog API.' diff --git a/.generator/src/generator/cli.py b/.generator/src/generator/cli.py index 80d1f05816b0..b93e60394d3e 100644 --- a/.generator/src/generator/cli.py +++ b/.generator/src/generator/cli.py @@ -102,7 +102,7 @@ def cli(specs, output): fp.write(model_j2.render(name=name, model=model)) for name, operations in apis.items(): - filename = name.replace(" ", "") + "Api.ts" + filename = name.replace(" ", "").replace("-", "") + "Api.ts" api_path = package_path / "apis" / filename api_path.parent.mkdir(parents=True, exist_ok=True) with api_path.open("w+") as fp: diff --git a/.generator/src/generator/templates/api/api.j2 b/.generator/src/generator/templates/api/api.j2 index d8b965116ba5..689d8f2b6870 100644 --- a/.generator/src/generator/templates/api/api.j2 +++ b/.generator/src/generator/templates/api/api.j2 @@ -17,7 +17,7 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { {{ model }} } from "../models/{{ model }}"; {%- endfor %} -{%- set className = name.replace(" ", "") + "Api" %} +{%- set className = name.replace(" ", "").replace("-", "") + "Api" %} export class {{ className }}RequestFactory extends BaseAPIRequestFactory { {%- for path, method, operation in operations|sort(attribute="2.operationId") %} diff --git a/.generator/src/generator/templates/index.j2 b/.generator/src/generator/templates/index.j2 index 2465316d490d..c0be4b25c40c 100644 --- a/.generator/src/generator/templates/index.j2 +++ b/.generator/src/generator/templates/index.j2 @@ -1,5 +1,5 @@ {%- for api, operations in apis.items()|sort(attribute="0", case_sensitive=True) %} -{%- set classname = api.replace(" ", "") + "Api" %} +{%- set classname = api.replace(" ", "").replace("-", "") + "Api" %} export { {%- for path, method, operation in operations|sort(attribute="2.operationId", case_sensitive=True) %} diff --git a/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/frozen.json b/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/frozen.json new file mode 100644 index 000000000000..3a89004aa831 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/frozen.json @@ -0,0 +1 @@ +"2025-04-07T02:59:16.973Z" diff --git a/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/recording.har b/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/recording.har new file mode 100644 index 000000000000..508d5778068b --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Create-on-call-schedule-returns-Created-response_3639525244/recording.har @@ -0,0 +1,289 @@ +{ + "log": { + "_recordingName": "On-Call/Create on-call schedule returns \"Created\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "4a679f9b1f8ec16da7a703da1fc04677", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 150, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 548, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_on_call_schedule_returns_Created_response-1743994756@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 701, + "content": { + "mimeType": "application/json", + "size": 701, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"4bc206fa-135c-11f0-9459-42e8e154a89e\",\"attributes\":{\"name\":null,\"handle\":\"test-create_on_call_schedule_returns_created_response-1743994756@datadoghq.com\",\"created_at\":\"2025-04-07T02:59:17.741162+00:00\",\"modified_at\":\"2025-04-07T02:59:17.741162+00:00\",\"email\":\"test-create_on_call_schedule_returns_created_response-1743994756@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/5fc9aee35e4a0e1e0d7a278ccee14b90?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 650, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T02:59:16.977Z", + "time": 900 + }, + { + "_id": "bbfab8897e9e7fe17f3bf7ada79535ad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 114, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 556, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_on_call_schedule_returns_Created_response-1743994756\"},\"type\":\"teams\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/teams" + }, + "response": { + "bodySize": 997, + "content": { + "mimeType": "application/json", + "size": 997, + "text": "{\"data\":{\"type\":\"teams\",\"id\":\"c520d001-9324-5025-aa51-803fd459d7d2\",\"attributes\":{\"name\":\"Test-Create_on_call_schedule_returns_Created_response-1743994756\",\"created\":\"2025-04-07T02:59:18.413985+00:00\",\"modified\":\"2025-04-07T02:59:18.413985+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-03-28T02:01:08.410658+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 647, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T02:59:17.891Z", + "time": 631 + }, + { + "_id": "e5c20a3d9496877d96baf72780c76d49", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 620, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-03-28T02:59:16.973Z\",\"end_date\":\"2025-04-17T02:59:16.973Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"4bc206fa-135c-11f0-9459-42e8e154a89e\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-04-02T02:59:16.973Z\"}],\"name\":\"Test-Create_on_call_schedule_returns_Created_response-1743994756\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"c520d001-9324-5025-aa51-803fd459d7d2\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 396, + "content": { + "mimeType": "application/vnd.api+json", + "size": 396, + "text": "{\"data\":{\"id\":\"5528e710-1704-455c-a872-4986774cad7f\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_on_call_schedule_returns_Created_response-1743994756\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"9448d443-2122-41c8-90cc-20e27875d44c\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"c520d001-9324-5025-aa51-803fd459d7d2\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T02:59:18.541Z", + "time": 252 + }, + { + "_id": "3dfa6dcf897eac80e025a860a08a950b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/5528e710-1704-455c-a872-4986774cad7f" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T02:59:18.815Z", + "time": 824 + }, + { + "_id": "df90b51dbb413381d08a31f33df7d934", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 529, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/teams/c520d001-9324-5025-aa51-803fd459d7d2" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 634, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T02:59:19.643Z", + "time": 632 + }, + { + "_id": "911597a5d3c5dc84794d1e7cd89dc78e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/4bc206fa-135c-11f0-9459-42e8e154a89e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T02:59:20.285Z", + "time": 941 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/frozen.json b/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/frozen.json new file mode 100644 index 000000000000..5b07bb9e8452 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/frozen.json @@ -0,0 +1 @@ +"2025-04-07T03:17:06.571Z" diff --git a/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/recording.har b/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/recording.har new file mode 100644 index 000000000000..d0da747ae5aa --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Delete-on-call-schedule-returns-No-Content-response_1104695853/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "On-Call/Delete on-call schedule returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "525d377929e34192a103845453343d1d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 623, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-03-28T03:17:06.571Z\",\"end_date\":\"2025-04-17T03:17:06.571Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-04-02T03:17:06.571Z\"}],\"name\":\"Test-Delete_on_call_schedule_returns_No_Content_response-1743995826\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 399, + "content": { + "mimeType": "application/vnd.api+json", + "size": 399, + "text": "{\"data\":{\"id\":\"b19a9712-e8f9-43a4-b38b-d5277608e001\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_on_call_schedule_returns_No_Content_response-1743995826\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"e82fe752-2c1a-4e05-a8a6-fe4ae5e0c889\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T03:17:06.980Z", + "time": 324 + }, + { + "_id": "2ca574dad16b39e4b31b28fffa5fb380", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/b19a9712-e8f9-43a4-b38b-d5277608e001" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T03:17:07.311Z", + "time": 350 + }, + { + "_id": "2ca574dad16b39e4b31b28fffa5fb380", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/b19a9712-e8f9-43a4-b38b-d5277608e001" + }, + "response": { + "bodySize": 106, + "content": { + "mimeType": "application/vnd.api+json", + "size": 106, + "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[b19a9712-e8f9-43a4-b38b-d5277608e001] not found\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-07T03:17:07.666Z", + "time": 247 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/frozen.json b/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/frozen.json new file mode 100644 index 000000000000..50228d7dbbe1 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/frozen.json @@ -0,0 +1 @@ +"2025-04-07T03:17:07.923Z" diff --git a/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/recording.har b/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/recording.har new file mode 100644 index 000000000000..4232e085c30e --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-on-call-schedule-returns-OK-response_3626643402/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "On-Call/Get on-call schedule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "de67da947e176ba94de6c1f52631d2ea", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 612, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-03-28T03:17:07.923Z\",\"end_date\":\"2025-04-17T03:17:07.923Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-04-02T03:17:07.923Z\"}],\"name\":\"Test-Get_on_call_schedule_returns_OK_response-1743995827\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 388, + "content": { + "mimeType": "application/vnd.api+json", + "size": 388, + "text": "{\"data\":{\"id\":\"e1168897-a10f-490d-a790-9b81aa6c3417\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_on_call_schedule_returns_OK_response-1743995827\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"cc6bfcfb-a227-4ac5-aa27-b64bca857e02\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T03:17:07.925Z", + "time": 323 + }, + { + "_id": "420437fe1ace3341c2031441985df86c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 552, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/e1168897-a10f-490d-a790-9b81aa6c3417" + }, + "response": { + "bodySize": 388, + "content": { + "mimeType": "application/vnd.api+json", + "size": 388, + "text": "{\"data\":{\"id\":\"e1168897-a10f-490d-a790-9b81aa6c3417\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_on_call_schedule_returns_OK_response-1743995827\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"cc6bfcfb-a227-4ac5-aa27-b64bca857e02\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-07T03:17:08.253Z", + "time": 447 + }, + { + "_id": "5e881b583164a07ab8f09ab9041a161d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/e1168897-a10f-490d-a790-9b81aa6c3417" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T03:17:08.716Z", + "time": 362 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/frozen.json b/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/frozen.json new file mode 100644 index 000000000000..171fbf0b6539 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/frozen.json @@ -0,0 +1 @@ +"2025-04-07T03:17:09.085Z" diff --git a/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/recording.har b/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/recording.har new file mode 100644 index 000000000000..19ec663345ee --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Update-on-call-schedule-returns-OK-response_2578247627/recording.har @@ -0,0 +1,342 @@ +{ + "log": { + "_recordingName": "On-Call/Update on-call schedule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "2a7371622b9457f3bcf549aab3cda103", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 615, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-03-28T03:17:09.085Z\",\"end_date\":\"2025-04-17T03:17:09.085Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-04-02T03:17:09.085Z\"}],\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 391, + "content": { + "mimeType": "application/vnd.api+json", + "size": 391, + "text": "{\"data\":{\"id\":\"191778c4-9051-4c9d-b09f-14885fcbc680\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\",\"tags\":[\"tag1\",\"tag2\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"f095f9ef-6372-4a49-8d70-7553f5d047cc\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T03:17:09.088Z", + "time": 336 + }, + { + "_id": "6eac200d58bcee4f6667975e4d91310f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 109, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\"},\"type\":\"teams\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/teams" + }, + "response": { + "bodySize": 1036, + "content": { + "mimeType": "application/json", + "size": 1036, + "text": "{\"data\":{\"type\":\"teams\",\"id\":\"15da5494-6da3-5c57-b5e4-38c4e44077e8\",\"attributes\":{\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\",\"created\":\"2025-04-07T03:17:09.733170+00:00\",\"modified\":\"2025-04-07T03:17:09.733170+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"attributes\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"created_at\":\"2020-12-29T22:58:44.733921+00:00\",\"modified_at\":\"2021-04-27T13:54:01.547888+00:00\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 648, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T03:17:09.429Z", + "time": 361 + }, + { + "_id": "f1593323453065cc6a1863ebc2e1fcf4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 145, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 691, + "content": { + "mimeType": "application/json", + "size": 691, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"caf2d527-135e-11f0-ab67-9afbb444f569\",\"attributes\":{\"name\":null,\"handle\":\"test-update_on_call_schedule_returns_ok_response-1743995829@datadoghq.com\",\"created_at\":\"2025-04-07T03:17:10.125124+00:00\",\"modified_at\":\"2025-04-07T03:17:10.125124+00:00\",\"email\":\"test-update_on_call_schedule_returns_ok_response-1743995829@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/8ff13bebf0ad3938e62b638f1ea5691f?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 650, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-04-07T03:17:09.796Z", + "time": 408 + }, + { + "_id": "a5fcc6251ebe5081eada61dba0a7ee12", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 715, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 608, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-03-28T03:17:09.085Z\",\"end_date\":\"2025-04-17T03:17:09.085Z\",\"id\":\"f095f9ef-6372-4a49-8d70-7553f5d047cc\",\"interval\":{\"seconds\":300},\"members\":[{\"user\":{\"id\":\"caf2d527-135e-11f0-ab67-9afbb444f569\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-04-02T03:17:09.085Z\"}],\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\",\"tags\":[\"tag1\",\"tag2\",\"tag3\"],\"time_zone\":\"America/New_York\"},\"id\":\"191778c4-9051-4c9d-b09f-14885fcbc680\",\"relationships\":{\"teams\":{\"data\":[{\"id\":\"15da5494-6da3-5c57-b5e4-38c4e44077e8\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/191778c4-9051-4c9d-b09f-14885fcbc680" + }, + "response": { + "bodySize": 398, + "content": { + "mimeType": "application/vnd.api+json", + "size": 398, + "text": "{\"data\":{\"id\":\"191778c4-9051-4c9d-b09f-14885fcbc680\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_on_call_schedule_returns_OK_response-1743995829\",\"tags\":[\"tag1\",\"tag2\",\"tag3\"],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"f095f9ef-6372-4a49-8d70-7553f5d047cc\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"15da5494-6da3-5c57-b5e4-38c4e44077e8\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-07T03:17:10.214Z", + "time": 357 + }, + { + "_id": "1a42091166e6d28d4e0c73f859c5c7b1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/caf2d527-135e-11f0-ab67-9afbb444f569" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T03:17:10.575Z", + "time": 444 + }, + { + "_id": "eb76e63cd4dbb39553ac64bd5ffee909", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/teams/15da5494-6da3-5c57-b5e4-38c4e44077e8" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 634, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T03:17:11.022Z", + "time": 335 + }, + { + "_id": "d7ba7adb5e53060775b06d91f66d4e9a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/191778c4-9051-4c9d-b09f-14885fcbc680" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-07T03:17:11.359Z", + "time": 341 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/on-call/CreateOnCallSchedule.ts b/examples/v2/on-call/CreateOnCallSchedule.ts new file mode 100644 index 000000000000..2b0c21633e89 --- /dev/null +++ b/examples/v2/on-call/CreateOnCallSchedule.ts @@ -0,0 +1,72 @@ +/** + * Create on-call schedule returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "user" in the system +const USER_DATA_ID = process.env.USER_DATA_ID as string; + +// there is a valid "team" in the system +const TEAM_DATA_ID = process.env.TEAM_DATA_ID as string; + +const params: v2.OnCallApiCreateOnCallScheduleRequest = { + body: { + data: { + attributes: { + layers: [ + { + effectiveDate: new Date(new Date().getTime() + -10 * 86400 * 1000), + endDate: new Date(new Date().getTime() + 10 * 86400 * 1000), + interval: { + days: 1, + }, + members: [ + { + user: { + id: USER_DATA_ID, + }, + }, + ], + name: "Layer 1", + restrictions: [ + { + endDay: "friday", + endTime: "17:00:00", + startDay: "monday", + startTime: "09:00:00", + }, + ], + rotationStart: new Date(new Date().getTime() + -5 * 86400 * 1000), + }, + ], + name: "Example-On-Call", + tags: ["tag1", "tag2"], + timeZone: "America/New_York", + }, + relationships: { + teams: { + data: [ + { + id: TEAM_DATA_ID, + type: "teams", + }, + ], + }, + }, + type: "schedules", + }, + }, +}; + +apiInstance + .createOnCallSchedule(params) + .then((data: v2.Schedule) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/DeleteOnCallSchedule.ts b/examples/v2/on-call/DeleteOnCallSchedule.ts new file mode 100644 index 000000000000..4d5bd47c0290 --- /dev/null +++ b/examples/v2/on-call/DeleteOnCallSchedule.ts @@ -0,0 +1,24 @@ +/** + * Delete on-call schedule returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; + +const params: v2.OnCallApiDeleteOnCallScheduleRequest = { + scheduleId: SCHEDULE_DATA_ID, +}; + +apiInstance + .deleteOnCallSchedule(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/GetOnCallSchedule.ts b/examples/v2/on-call/GetOnCallSchedule.ts new file mode 100644 index 000000000000..fb7602bb8224 --- /dev/null +++ b/examples/v2/on-call/GetOnCallSchedule.ts @@ -0,0 +1,24 @@ +/** + * Get on-call schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; + +const params: v2.OnCallApiGetOnCallScheduleRequest = { + scheduleId: SCHEDULE_DATA_ID, +}; + +apiInstance + .getOnCallSchedule(params) + .then((data: v2.Schedule) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/UpdateOnCallSchedule.ts b/examples/v2/on-call/UpdateOnCallSchedule.ts new file mode 100644 index 000000000000..0d5ea41993ad --- /dev/null +++ b/examples/v2/on-call/UpdateOnCallSchedule.ts @@ -0,0 +1,80 @@ +/** + * Update on-call schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; +const SCHEDULE_DATA_RELATIONSHIPS_LAYERS_DATA_0_ID = process.env + .SCHEDULE_DATA_RELATIONSHIPS_LAYERS_DATA_0_ID as string; + +// there is a valid "user" in the system +const USER_DATA_ID = process.env.USER_DATA_ID as string; + +// there is a valid "team" in the system +const TEAM_DATA_ID = process.env.TEAM_DATA_ID as string; + +const params: v2.OnCallApiUpdateOnCallScheduleRequest = { + body: { + data: { + id: SCHEDULE_DATA_ID, + attributes: { + layers: [ + { + id: SCHEDULE_DATA_RELATIONSHIPS_LAYERS_DATA_0_ID, + effectiveDate: new Date(new Date().getTime() + -10 * 86400 * 1000), + endDate: new Date(new Date().getTime() + 10 * 86400 * 1000), + interval: { + seconds: 300, + }, + members: [ + { + user: { + id: USER_DATA_ID, + }, + }, + ], + name: "Layer 1", + restrictions: [ + { + endDay: "friday", + endTime: "17:00:00", + startDay: "monday", + startTime: "09:00:00", + }, + ], + rotationStart: new Date(new Date().getTime() + -5 * 86400 * 1000), + }, + ], + name: "Example-On-Call", + tags: ["tag1", "tag2", "tag3"], + timeZone: "America/New_York", + }, + relationships: { + teams: { + data: [ + { + id: TEAM_DATA_ID, + type: "teams", + }, + ], + }, + }, + type: "schedules", + }, + }, + scheduleId: SCHEDULE_DATA_ID, +}; + +apiInstance + .updateOnCallSchedule(params) + .then((data: v2.Schedule) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/step_definitions/request_steps.ts b/features/step_definitions/request_steps.ts index 126f08f329b9..6923c3718c04 100644 --- a/features/step_definitions/request_steps.ts +++ b/features/step_definitions/request_steps.ts @@ -27,7 +27,7 @@ Given('a valid "appKeyAuth" key in the system', function (this: World) { Given("an instance of {string} API", function (this: World, apiName: string) { // TODO add support for DEBUG=true when supported in configuration - this.apiName = apiName; + this.apiName = apiName.replace("-", ""); }); Given( diff --git a/features/support/given.ts b/features/support/given.ts index 70bed8280ca8..6dbbd3146834 100644 --- a/features/support/given.ts +++ b/features/support/given.ts @@ -35,7 +35,7 @@ for (const apiVersion of Versions) { const givenSteps = JSON.parse(content) as IGivenStep[]; for (const operation of givenSteps) { Given(operation.step, async function (this: World) { - const apiName: string = operation.tag.replace(/\s/g, ""); + const apiName: string = operation.tag.replace(/[\s-]/g, ""); const operationName: string = operation.operationId.toOperationName(); // make sure we have a fresh instance of API client and configuration @@ -46,7 +46,7 @@ for (const apiVersion of Versions) { appKeyAuth: process.env.DD_TEST_CLIENT_APP_KEY, }, httpConfig: { compress: false }, - zstdCompressorCallback: (body: string) => compressSync({input: Buffer.from(body, "utf8")}), + zstdCompressorCallback: (body: string) => compressSync({ input: Buffer.from(body, "utf8") }), enableRetry: true, }; @@ -99,9 +99,9 @@ for (const apiVersion of Versions) { p.source ); } - if (p.origin === "request"){ - for (const key in opts[p.name]){ - if (opts[p.name].hasOwnProperty(key)){ + if (p.origin === "request") { + for (const key in opts[p.name]) { + if (opts[p.name].hasOwnProperty(key)) { this.fixtures[key] = opts[p.name][key]; } } @@ -153,7 +153,7 @@ for (const apiVersion of Versions) { if (operation["key"] !== undefined) { this.fixtures[operation["key"]] = result; } - + await this.sleepAfterRequest(); }); } diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 423f33c6e784..be98deb09179 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -4993,6 +4993,50 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SingleAggregatedConnectionResponseArray", }, + "v2.CreateOnCallSchedule": { + "include": { + "type": "string", + "format": "", + }, + "body": { + "type": "ScheduleCreateRequest", + "format": "", + }, + "operationResponseType": "Schedule", + }, + "v2.DeleteOnCallSchedule": { + "scheduleId": { + "type": "string", + "format": "", + }, + "operationResponseType": "void", + }, + "v2.GetOnCallSchedule": { + "include": { + "type": "string", + "format": "", + }, + "scheduleId": { + "type": "string", + "format": "", + }, + "operationResponseType": "Schedule", + }, + "v2.UpdateOnCallSchedule": { + "include": { + "type": "string", + "format": "", + }, + "scheduleId": { + "type": "string", + "format": "", + }, + "body": { + "type": "ScheduleUpdateRequest", + "format": "", + }, + "operationResponseType": "Schedule", + }, "v2.ListOrgConfigs": { "operationResponseType": "OrgConfigListResponse", }, diff --git a/features/support/undo.ts b/features/support/undo.ts index 299de22941d2..6223359ef2eb 100644 --- a/features/support/undo.ts +++ b/features/support/undo.ts @@ -47,9 +47,9 @@ function buildUndoFor( request: any ): { (): void } { return async function () { - let apiName = operationUndo.tag.replace(/\s/g, ""); + let apiName = operationUndo.tag.replace(/[\s-]/g, ""); if (operationUndo.undo.tag != null) { - apiName = operationUndo.undo.tag.replace(/\s/g, ""); + apiName = operationUndo.undo.tag.replace(/[\s-]/g, ""); } const operationName = operationUndo.undo.operationId.toOperationName(); @@ -89,9 +89,9 @@ function buildUndoFor( for (const p of operationUndo.undo.parameters) { let dataSource: { [key: string]: any; }; if (p.origin === undefined) { - dataSource = response; + dataSource = response; } else if (p.origin === "request") { - dataSource = request.body; + dataSource = request.body; } else { dataSource = response; } diff --git a/features/v2/given.json b/features/v2/given.json index 3a41fda169b0..96c49b616686 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -448,6 +448,18 @@ "tag": "Monitors", "operationId": "CreateMonitorConfigPolicy" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"layers\": [\n {\n \"effective_date\": \"{{ timeISO('now - 10d') }}\",\n \"end_date\": \"{{ timeISO('now + 10d') }}\",\n \"interval\": {\n \"days\": 1\n },\n \"members\": [\n {\n \"user\": {\n \"id\": \"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"\n }\n }\n ],\n \"name\": \"Layer 1\",\n \"restrictions\": [\n {\n \"end_day\": \"friday\",\n \"end_time\": \"17:00:00\",\n \"start_day\": \"monday\",\n \"start_time\": \"09:00:00\"\n }\n ],\n \"rotation_start\": \"{{ timeISO('now - 5d') }}\"\n }\n ],\n \"name\": \"{{ unique }}\",\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"time_zone\": \"America/New_York\"\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"schedules\"\n }\n}" + } + ], + "step": "there is a valid \"schedule\" in the system", + "key": "schedule", + "tag": "On-Call", + "operationId": "CreateOnCallSchedule" + }, { "source": "data[4]", "step": "there is a valid \"permission\" in the system", diff --git a/features/v2/on-call.feature b/features/v2/on-call.feature new file mode 100644 index 000000000000..f0b6df1decc2 --- /dev/null +++ b/features/v2/on-call.feature @@ -0,0 +1,83 @@ +@endpoint(on-call) @endpoint(on-call-v2) +Feature: On-Call + Configure your [Datadog On- + Call](https://docs.datadoghq.com/service_management/on-call/) directly + through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "On-Call" API + + @generated @skip @team:DataDog/bugle + Scenario: Create on-call schedule returns "Bad Request" response + Given new "CreateOnCallSchedule" request + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"days": 1}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule", "tags": ["tag1", "tag2"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-python @team:DataDog/bugle + Scenario: Create on-call schedule returns "Created" response + Given new "CreateOnCallSchedule" request + And there is a valid "user" in the system + And there is a valid "team" in the system + And body with value {"data": {"attributes": {"layers": [{"effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"days": 1}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "tags": ["tag1", "tag2"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 201 Created + + @team:DataDog/bugle + Scenario: Delete on-call schedule returns "No Content" response + Given new "DeleteOnCallSchedule" request + And there is a valid "schedule" in the system + And request contains "schedule_id" parameter from "schedule.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/bugle + Scenario: Delete on-call schedule returns "Not Found" response + Given new "DeleteOnCallSchedule" request + And request contains "schedule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/bugle + Scenario: Get on-call schedule returns "Not Found" response + Given new "GetOnCallSchedule" request + And request contains "schedule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/bugle + Scenario: Get on-call schedule returns "OK" response + Given new "GetOnCallSchedule" request + And there is a valid "schedule" in the system + And request contains "schedule_id" parameter from "schedule.data.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bugle + Scenario: Update on-call schedule returns "Bad Request" response + Given new "UpdateOnCallSchedule" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bugle + Scenario: Update on-call schedule returns "Not Found" response + Given new "UpdateOnCallSchedule" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 404 Not Found + + @skip-python @team:DataDog/bugle + Scenario: Update on-call schedule returns "OK" response + Given new "UpdateOnCallSchedule" request + And there is a valid "schedule" in the system + And there is a valid "team" in the system + And there is a valid "user" in the system + And request contains "schedule_id" parameter from "schedule.data.id" + And body with value {"data": { "id": "{{ schedule.data.id }}", "attributes": {"layers": [{"id": "{{ schedule.data.relationships.layers.data[0].id }}" , "effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"seconds": 300}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 72669c55babe..333884a2f322 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1750,6 +1750,37 @@ "type": "safe" } }, + "CreateOnCallSchedule": { + "tag": "On-Call", + "undo": { + "operationId": "DeleteOnCallSchedule", + "parameters": [ + { + "name": "schedule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOnCallSchedule": { + "tag": "On-Call", + "undo": { + "type": "idempotent" + } + }, + "GetOnCallSchedule": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, + "UpdateOnCallSchedule": { + "tag": "On-Call", + "undo": { + "type": "idempotent" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { diff --git a/packages/datadog-api-client-v2/apis/OnCallApi.ts b/packages/datadog-api-client-v2/apis/OnCallApi.ts new file mode 100644 index 000000000000..1d0de21dd8de --- /dev/null +++ b/packages/datadog-api-client-v2/apis/OnCallApi.ts @@ -0,0 +1,618 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { Schedule } from "../models/Schedule"; +import { ScheduleCreateRequest } from "../models/ScheduleCreateRequest"; +import { ScheduleUpdateRequest } from "../models/ScheduleUpdateRequest"; + +export class OnCallApiRequestFactory extends BaseAPIRequestFactory { + public async createOnCallSchedule( + body: ScheduleCreateRequest, + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createOnCallSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/on-call/schedules"; + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.createOnCallSchedule") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ScheduleCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteOnCallSchedule( + scheduleId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "deleteOnCallSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/on-call/schedules/{schedule_id}".replace( + "{schedule_id}", + encodeURIComponent(String(scheduleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.deleteOnCallSchedule") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getOnCallSchedule( + scheduleId: string, + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "getOnCallSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/on-call/schedules/{schedule_id}".replace( + "{schedule_id}", + encodeURIComponent(String(scheduleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.getOnCallSchedule") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateOnCallSchedule( + scheduleId: string, + body: ScheduleUpdateRequest, + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "updateOnCallSchedule"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateOnCallSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/on-call/schedules/{schedule_id}".replace( + "{schedule_id}", + encodeURIComponent(String(scheduleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.updateOnCallSchedule") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ScheduleUpdateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class OnCallApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createOnCallSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async createOnCallSchedule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule" + ) as Schedule; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule", + "" + ) as Schedule; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteOnCallSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOnCallSchedule(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getOnCallSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOnCallSchedule(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule" + ) as Schedule; + return body; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule", + "" + ) as Schedule; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateOnCallSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateOnCallSchedule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule" + ) as Schedule; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule", + "" + ) as Schedule; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface OnCallApiCreateOnCallScheduleRequest { + /** + * @type ScheduleCreateRequest + */ + body: ScheduleCreateRequest; + /** + * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. + * @type string + */ + include?: string; +} + +export interface OnCallApiDeleteOnCallScheduleRequest { + /** + * The ID of the schedule + * @type string + */ + scheduleId: string; +} + +export interface OnCallApiGetOnCallScheduleRequest { + /** + * The ID of the schedule + * @type string + */ + scheduleId: string; + /** + * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. + * @type string + */ + include?: string; +} + +export interface OnCallApiUpdateOnCallScheduleRequest { + /** + * The ID of the schedule + * @type string + */ + scheduleId: string; + /** + * @type ScheduleUpdateRequest + */ + body: ScheduleUpdateRequest; + /** + * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. + * @type string + */ + include?: string; +} + +export class OnCallApi { + private requestFactory: OnCallApiRequestFactory; + private responseProcessor: OnCallApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: OnCallApiRequestFactory, + responseProcessor?: OnCallApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new OnCallApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new OnCallApiResponseProcessor(); + } + + /** + * Create a new on-call schedule + * @param param The request object + */ + public createOnCallSchedule( + param: OnCallApiCreateOnCallScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createOnCallSchedule( + param.body, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createOnCallSchedule(responseContext); + }); + }); + } + + /** + * Delete an on-call schedule + * @param param The request object + */ + public deleteOnCallSchedule( + param: OnCallApiDeleteOnCallScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteOnCallSchedule( + param.scheduleId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteOnCallSchedule(responseContext); + }); + }); + } + + /** + * Get an on-call schedule + * @param param The request object + */ + public getOnCallSchedule( + param: OnCallApiGetOnCallScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getOnCallSchedule( + param.scheduleId, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getOnCallSchedule(responseContext); + }); + }); + } + + /** + * Update a new on-call schedule + * @param param The request object + */ + public updateOnCallSchedule( + param: OnCallApiUpdateOnCallScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateOnCallSchedule( + param.scheduleId, + param.body, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateOnCallSchedule(responseContext); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 35c4b10dd476..5f021ea7f577 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -418,6 +418,14 @@ export { OktaIntegrationApi, } from "./apis/OktaIntegrationApi"; +export { + OnCallApiCreateOnCallScheduleRequest, + OnCallApiDeleteOnCallScheduleRequest, + OnCallApiGetOnCallScheduleRequest, + OnCallApiUpdateOnCallScheduleRequest, + OnCallApi, +} from "./apis/OnCallApi"; + export { OpsgenieIntegrationApiCreateOpsgenieServiceRequest, OpsgenieIntegrationApiDeleteOpsgenieServiceRequest, @@ -1719,6 +1727,17 @@ export { JobDefinitionFromRule } from "./models/JobDefinitionFromRule"; export { JSONAPIErrorItem } from "./models/JSONAPIErrorItem"; export { JSONAPIErrorItemSource } from "./models/JSONAPIErrorItemSource"; export { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; +export { Layer } from "./models/Layer"; +export { LayerAttributes } from "./models/LayerAttributes"; +export { LayerAttributesInterval } from "./models/LayerAttributesInterval"; +export { LayerAttributesRestrictionsItems } from "./models/LayerAttributesRestrictionsItems"; +export { LayerAttributesRestrictionsItemsEndDay } from "./models/LayerAttributesRestrictionsItemsEndDay"; +export { LayerAttributesRestrictionsItemsStartDay } from "./models/LayerAttributesRestrictionsItemsStartDay"; +export { LayerRelationships } from "./models/LayerRelationships"; +export { LayerRelationshipsMembers } from "./models/LayerRelationshipsMembers"; +export { LayerRelationshipsMembersDataItems } from "./models/LayerRelationshipsMembersDataItems"; +export { LayerRelationshipsMembersDataItemsType } from "./models/LayerRelationshipsMembersDataItemsType"; +export { LayerType } from "./models/LayerType"; export { LeakedKey } from "./models/LeakedKey"; export { LeakedKeyAttributes } from "./models/LeakedKeyAttributes"; export { LeakedKeyType } from "./models/LeakedKeyType"; @@ -2353,8 +2372,59 @@ export { ScalarFormulaResponseType } from "./models/ScalarFormulaResponseType"; export { ScalarMeta } from "./models/ScalarMeta"; export { ScalarQuery } from "./models/ScalarQuery"; export { ScalarResponse } from "./models/ScalarResponse"; +export { Schedule } from "./models/Schedule"; +export { ScheduleCreateRequest } from "./models/ScheduleCreateRequest"; +export { ScheduleCreateRequestData } from "./models/ScheduleCreateRequestData"; +export { ScheduleCreateRequestDataAttributes } from "./models/ScheduleCreateRequestDataAttributes"; +export { ScheduleCreateRequestDataAttributesLayersItems } from "./models/ScheduleCreateRequestDataAttributesLayersItems"; +export { ScheduleCreateRequestDataAttributesLayersItemsInterval } from "./models/ScheduleCreateRequestDataAttributesLayersItemsInterval"; +export { ScheduleCreateRequestDataAttributesLayersItemsMembersItems } from "./models/ScheduleCreateRequestDataAttributesLayersItemsMembersItems"; +export { ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser } from "./models/ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser"; +export { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems } from "./models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems"; +export { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay } from "./models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay"; +export { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay } from "./models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay"; +export { ScheduleCreateRequestDataRelationships } from "./models/ScheduleCreateRequestDataRelationships"; +export { ScheduleCreateRequestDataRelationshipsTeams } from "./models/ScheduleCreateRequestDataRelationshipsTeams"; +export { ScheduleCreateRequestDataRelationshipsTeamsDataItems } from "./models/ScheduleCreateRequestDataRelationshipsTeamsDataItems"; +export { ScheduleCreateRequestDataRelationshipsTeamsDataItemsType } from "./models/ScheduleCreateRequestDataRelationshipsTeamsDataItemsType"; +export { ScheduleCreateRequestDataType } from "./models/ScheduleCreateRequestDataType"; +export { ScheduleData } from "./models/ScheduleData"; +export { ScheduleDataAttributes } from "./models/ScheduleDataAttributes"; +export { ScheduleDataIncludedItem } from "./models/ScheduleDataIncludedItem"; +export { ScheduleDataRelationships } from "./models/ScheduleDataRelationships"; +export { ScheduleDataRelationshipsLayers } from "./models/ScheduleDataRelationshipsLayers"; +export { ScheduleDataRelationshipsLayersDataItems } from "./models/ScheduleDataRelationshipsLayersDataItems"; +export { ScheduleDataRelationshipsLayersDataItemsType } from "./models/ScheduleDataRelationshipsLayersDataItemsType"; +export { ScheduleDataRelationshipsTeams } from "./models/ScheduleDataRelationshipsTeams"; +export { ScheduleDataRelationshipsTeamsDataItems } from "./models/ScheduleDataRelationshipsTeamsDataItems"; +export { ScheduleDataRelationshipsTeamsDataItemsType } from "./models/ScheduleDataRelationshipsTeamsDataItemsType"; +export { ScheduleDataType } from "./models/ScheduleDataType"; +export { ScheduleMember } from "./models/ScheduleMember"; +export { ScheduleMemberRelationships } from "./models/ScheduleMemberRelationships"; +export { ScheduleMemberRelationshipsUser } from "./models/ScheduleMemberRelationshipsUser"; +export { ScheduleMemberRelationshipsUserData } from "./models/ScheduleMemberRelationshipsUserData"; +export { ScheduleMemberRelationshipsUserDataType } from "./models/ScheduleMemberRelationshipsUserDataType"; +export { ScheduleMemberType } from "./models/ScheduleMemberType"; export { ScheduleTrigger } from "./models/ScheduleTrigger"; export { ScheduleTriggerWrapper } from "./models/ScheduleTriggerWrapper"; +export { ScheduleUpdateRequest } from "./models/ScheduleUpdateRequest"; +export { ScheduleUpdateRequestData } from "./models/ScheduleUpdateRequestData"; +export { ScheduleUpdateRequestDataAttributes } from "./models/ScheduleUpdateRequestDataAttributes"; +export { ScheduleUpdateRequestDataAttributesLayersItems } from "./models/ScheduleUpdateRequestDataAttributesLayersItems"; +export { ScheduleUpdateRequestDataAttributesLayersItemsInterval } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsInterval"; +export { ScheduleUpdateRequestDataAttributesLayersItemsMembersItems } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItems"; +export { ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser"; +export { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems"; +export { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay"; +export { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay } from "./models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay"; +export { ScheduleUpdateRequestDataRelationships } from "./models/ScheduleUpdateRequestDataRelationships"; +export { ScheduleUpdateRequestDataRelationshipsTeams } from "./models/ScheduleUpdateRequestDataRelationshipsTeams"; +export { ScheduleUpdateRequestDataRelationshipsTeamsDataItems } from "./models/ScheduleUpdateRequestDataRelationshipsTeamsDataItems"; +export { ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType } from "./models/ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType"; +export { ScheduleUpdateRequestDataType } from "./models/ScheduleUpdateRequestDataType"; +export { ScheduleUser } from "./models/ScheduleUser"; +export { ScheduleUserAttributes } from "./models/ScheduleUserAttributes"; +export { ScheduleUserType } from "./models/ScheduleUserType"; export { ScorecardType } from "./models/ScorecardType"; export { SecurityFilter } from "./models/SecurityFilter"; export { SecurityFilterAttributes } from "./models/SecurityFilterAttributes"; @@ -2697,6 +2767,13 @@ export { TeamPermissionSettingUpdate } from "./models/TeamPermissionSettingUpdat export { TeamPermissionSettingUpdateAttributes } from "./models/TeamPermissionSettingUpdateAttributes"; export { TeamPermissionSettingUpdateRequest } from "./models/TeamPermissionSettingUpdateRequest"; export { TeamPermissionSettingValue } from "./models/TeamPermissionSettingValue"; +export { TeamReference } from "./models/TeamReference"; +export { TeamReferenceAttributes } from "./models/TeamReferenceAttributes"; +export { TeamReferenceRelationships } from "./models/TeamReferenceRelationships"; +export { TeamReferenceRelationshipsOncallUsers } from "./models/TeamReferenceRelationshipsOncallUsers"; +export { TeamReferenceRelationshipsOncallUsersDataItems } from "./models/TeamReferenceRelationshipsOncallUsersDataItems"; +export { TeamReferenceRelationshipsOncallUsersDataItemsType } from "./models/TeamReferenceRelationshipsOncallUsersDataItemsType"; +export { TeamReferenceType } from "./models/TeamReferenceType"; export { TeamRelationships } from "./models/TeamRelationships"; export { TeamRelationshipsLinks } from "./models/TeamRelationshipsLinks"; export { TeamResponse } from "./models/TeamResponse"; diff --git a/packages/datadog-api-client-v2/models/Layer.ts b/packages/datadog-api-client-v2/models/Layer.ts new file mode 100644 index 000000000000..bf0322f117a3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Layer.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerAttributes } from "./LayerAttributes"; +import { LayerRelationships } from "./LayerRelationships"; +import { LayerType } from "./LayerType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Encapsulates a layer resource, holding attributes like rotation details, plus relationships to the members covering that layer. + */ +export class Layer { + /** + * Describes key properties of a Layer, including rotation details, name, start/end times, and any restrictions. + */ + "attributes"?: LayerAttributes; + /** + * A unique identifier for this layer. + */ + "id"?: string; + /** + * Holds references to objects related to the Layer entity, such as its members. + */ + "relationships"?: LayerRelationships; + /** + * Layers resource type. + */ + "type"?: LayerType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LayerAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "LayerRelationships", + }, + type: { + baseName: "type", + type: "LayerType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Layer.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerAttributes.ts b/packages/datadog-api-client-v2/models/LayerAttributes.ts new file mode 100644 index 000000000000..d63fc0aa65a0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerAttributes.ts @@ -0,0 +1,97 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerAttributesInterval } from "./LayerAttributesInterval"; +import { LayerAttributesRestrictionsItems } from "./LayerAttributesRestrictionsItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Describes key properties of a Layer, including rotation details, name, start/end times, and any restrictions. + */ +export class LayerAttributes { + /** + * When the layer becomes active (ISO 8601). + */ + "effectiveDate"?: Date; + /** + * When the layer ceases to be active (ISO 8601). + */ + "endDate"?: Date; + /** + * Defines how often the rotation repeats, using a combination of days and optional seconds. + */ + "interval"?: LayerAttributesInterval; + /** + * The name of this layer. + */ + "name"?: string; + /** + * An optional list of time restrictions for when this layer is in effect. + */ + "restrictions"?: Array; + /** + * The date/time when the rotation starts (ISO 8601). + */ + "rotationStart"?: Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + effectiveDate: { + baseName: "effective_date", + type: "Date", + format: "date-time", + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + interval: { + baseName: "interval", + type: "LayerAttributesInterval", + }, + name: { + baseName: "name", + type: "string", + }, + restrictions: { + baseName: "restrictions", + type: "Array", + }, + rotationStart: { + baseName: "rotation_start", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerAttributesInterval.ts b/packages/datadog-api-client-v2/models/LayerAttributesInterval.ts new file mode 100644 index 000000000000..2a9c04f26793 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerAttributesInterval.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines how often the rotation repeats, using a combination of days and optional seconds. + */ +export class LayerAttributesInterval { + /** + * The number of days in each rotation cycle. + */ + "days"?: number; + /** + * Any additional seconds for the rotation cycle (up to 30 days). + */ + "seconds"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + days: { + baseName: "days", + type: "number", + format: "int32", + }, + seconds: { + baseName: "seconds", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerAttributesInterval.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItems.ts b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItems.ts new file mode 100644 index 000000000000..cab4c0c2da08 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItems.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerAttributesRestrictionsItemsEndDay } from "./LayerAttributesRestrictionsItemsEndDay"; +import { LayerAttributesRestrictionsItemsStartDay } from "./LayerAttributesRestrictionsItemsStartDay"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents a time restriction within a layer, specifying the days and times + * when this layer is active or inactive. + */ +export class LayerAttributesRestrictionsItems { + /** + * Defines the end day of the restriction within a Layer. + */ + "endDay"?: LayerAttributesRestrictionsItemsEndDay; + /** + * The time of day the restriction ends (hh:mm:ss). + */ + "endTime"?: string; + /** + * Defines the start day of the restriction within a Layer. + */ + "startDay"?: LayerAttributesRestrictionsItemsStartDay; + /** + * The time of day the restriction begins (hh:mm:ss). + */ + "startTime"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + endDay: { + baseName: "end_day", + type: "LayerAttributesRestrictionsItemsEndDay", + }, + endTime: { + baseName: "end_time", + type: "string", + }, + startDay: { + baseName: "start_day", + type: "LayerAttributesRestrictionsItemsStartDay", + }, + startTime: { + baseName: "start_time", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerAttributesRestrictionsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsEndDay.ts b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsEndDay.ts new file mode 100644 index 000000000000..cfc065e4361a --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsEndDay.ts @@ -0,0 +1,28 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Defines the end day of the restriction within a Layer. + */ + +export type LayerAttributesRestrictionsItemsEndDay = + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsStartDay.ts b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsStartDay.ts new file mode 100644 index 000000000000..4dbf6af6fdd5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerAttributesRestrictionsItemsStartDay.ts @@ -0,0 +1,28 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Defines the start day of the restriction within a Layer. + */ + +export type LayerAttributesRestrictionsItemsStartDay = + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/LayerRelationships.ts b/packages/datadog-api-client-v2/models/LayerRelationships.ts new file mode 100644 index 000000000000..f7262a9a9825 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerRelationshipsMembers } from "./LayerRelationshipsMembers"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Holds references to objects related to the Layer entity, such as its members. + */ +export class LayerRelationships { + /** + * Holds an array of references to the members of a Layer, each containing member IDs. + */ + "members"?: LayerRelationshipsMembers; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + members: { + baseName: "members", + type: "LayerRelationshipsMembers", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerRelationshipsMembers.ts b/packages/datadog-api-client-v2/models/LayerRelationshipsMembers.ts new file mode 100644 index 000000000000..810e6de6ec6b --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerRelationshipsMembers.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerRelationshipsMembersDataItems } from "./LayerRelationshipsMembersDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Holds an array of references to the members of a Layer, each containing member IDs. + */ +export class LayerRelationshipsMembers { + /** + * The list of members who belong to this layer. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerRelationshipsMembers.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItems.ts b/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItems.ts new file mode 100644 index 000000000000..7b9f58280088 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItems.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LayerRelationshipsMembersDataItemsType } from "./LayerRelationshipsMembersDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents a single member object in a layer's `members` array, referencing + * a unique Datadog user ID. + */ +export class LayerRelationshipsMembersDataItems { + /** + * The unique user ID of the layer member. + */ + "id"?: string; + /** + * Members resource type. + */ + "type"?: LayerRelationshipsMembersDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "LayerRelationshipsMembersDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LayerRelationshipsMembersDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItemsType.ts b/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItemsType.ts new file mode 100644 index 000000000000..0c5bfa6902f7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerRelationshipsMembersDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Members resource type. + */ + +export type LayerRelationshipsMembersDataItemsType = + | typeof MEMBERS + | UnparsedObject; +export const MEMBERS = "members"; diff --git a/packages/datadog-api-client-v2/models/LayerType.ts b/packages/datadog-api-client-v2/models/LayerType.ts new file mode 100644 index 000000000000..5b11f66bef99 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LayerType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Layers resource type. + */ + +export type LayerType = typeof LAYERS | UnparsedObject; +export const LAYERS = "layers"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 67ad144f20fd..ab620277c2b1 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -797,6 +797,13 @@ import { JobCreateResponse } from "./JobCreateResponse"; import { JobCreateResponseData } from "./JobCreateResponseData"; import { JobDefinition } from "./JobDefinition"; import { JobDefinitionFromRule } from "./JobDefinitionFromRule"; +import { Layer } from "./Layer"; +import { LayerAttributes } from "./LayerAttributes"; +import { LayerAttributesInterval } from "./LayerAttributesInterval"; +import { LayerAttributesRestrictionsItems } from "./LayerAttributesRestrictionsItems"; +import { LayerRelationships } from "./LayerRelationships"; +import { LayerRelationshipsMembers } from "./LayerRelationshipsMembers"; +import { LayerRelationshipsMembersDataItems } from "./LayerRelationshipsMembersDataItems"; import { LeakedKey } from "./LeakedKey"; import { LeakedKeyAttributes } from "./LeakedKeyAttributes"; import { Library } from "./Library"; @@ -1303,8 +1310,44 @@ import { ScalarFormulaRequestAttributes } from "./ScalarFormulaRequestAttributes import { ScalarFormulaResponseAtrributes } from "./ScalarFormulaResponseAtrributes"; import { ScalarMeta } from "./ScalarMeta"; import { ScalarResponse } from "./ScalarResponse"; +import { Schedule } from "./Schedule"; +import { ScheduleCreateRequest } from "./ScheduleCreateRequest"; +import { ScheduleCreateRequestData } from "./ScheduleCreateRequestData"; +import { ScheduleCreateRequestDataAttributes } from "./ScheduleCreateRequestDataAttributes"; +import { ScheduleCreateRequestDataAttributesLayersItems } from "./ScheduleCreateRequestDataAttributesLayersItems"; +import { ScheduleCreateRequestDataAttributesLayersItemsInterval } from "./ScheduleCreateRequestDataAttributesLayersItemsInterval"; +import { ScheduleCreateRequestDataAttributesLayersItemsMembersItems } from "./ScheduleCreateRequestDataAttributesLayersItemsMembersItems"; +import { ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser } from "./ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser"; +import { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems } from "./ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems"; +import { ScheduleCreateRequestDataRelationships } from "./ScheduleCreateRequestDataRelationships"; +import { ScheduleCreateRequestDataRelationshipsTeams } from "./ScheduleCreateRequestDataRelationshipsTeams"; +import { ScheduleCreateRequestDataRelationshipsTeamsDataItems } from "./ScheduleCreateRequestDataRelationshipsTeamsDataItems"; +import { ScheduleData } from "./ScheduleData"; +import { ScheduleDataAttributes } from "./ScheduleDataAttributes"; +import { ScheduleDataRelationships } from "./ScheduleDataRelationships"; +import { ScheduleDataRelationshipsLayers } from "./ScheduleDataRelationshipsLayers"; +import { ScheduleDataRelationshipsLayersDataItems } from "./ScheduleDataRelationshipsLayersDataItems"; +import { ScheduleDataRelationshipsTeams } from "./ScheduleDataRelationshipsTeams"; +import { ScheduleDataRelationshipsTeamsDataItems } from "./ScheduleDataRelationshipsTeamsDataItems"; +import { ScheduleMember } from "./ScheduleMember"; +import { ScheduleMemberRelationships } from "./ScheduleMemberRelationships"; +import { ScheduleMemberRelationshipsUser } from "./ScheduleMemberRelationshipsUser"; +import { ScheduleMemberRelationshipsUserData } from "./ScheduleMemberRelationshipsUserData"; import { ScheduleTrigger } from "./ScheduleTrigger"; import { ScheduleTriggerWrapper } from "./ScheduleTriggerWrapper"; +import { ScheduleUpdateRequest } from "./ScheduleUpdateRequest"; +import { ScheduleUpdateRequestData } from "./ScheduleUpdateRequestData"; +import { ScheduleUpdateRequestDataAttributes } from "./ScheduleUpdateRequestDataAttributes"; +import { ScheduleUpdateRequestDataAttributesLayersItems } from "./ScheduleUpdateRequestDataAttributesLayersItems"; +import { ScheduleUpdateRequestDataAttributesLayersItemsInterval } from "./ScheduleUpdateRequestDataAttributesLayersItemsInterval"; +import { ScheduleUpdateRequestDataAttributesLayersItemsMembersItems } from "./ScheduleUpdateRequestDataAttributesLayersItemsMembersItems"; +import { ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser } from "./ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser"; +import { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems } from "./ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems"; +import { ScheduleUpdateRequestDataRelationships } from "./ScheduleUpdateRequestDataRelationships"; +import { ScheduleUpdateRequestDataRelationshipsTeams } from "./ScheduleUpdateRequestDataRelationshipsTeams"; +import { ScheduleUpdateRequestDataRelationshipsTeamsDataItems } from "./ScheduleUpdateRequestDataRelationshipsTeamsDataItems"; +import { ScheduleUser } from "./ScheduleUser"; +import { ScheduleUserAttributes } from "./ScheduleUserAttributes"; import { SecurityFilter } from "./SecurityFilter"; import { SecurityFilterAttributes } from "./SecurityFilterAttributes"; import { SecurityFilterCreateAttributes } from "./SecurityFilterCreateAttributes"; @@ -1554,6 +1597,11 @@ import { TeamPermissionSettingUpdate } from "./TeamPermissionSettingUpdate"; import { TeamPermissionSettingUpdateAttributes } from "./TeamPermissionSettingUpdateAttributes"; import { TeamPermissionSettingUpdateRequest } from "./TeamPermissionSettingUpdateRequest"; import { TeamPermissionSettingsResponse } from "./TeamPermissionSettingsResponse"; +import { TeamReference } from "./TeamReference"; +import { TeamReferenceAttributes } from "./TeamReferenceAttributes"; +import { TeamReferenceRelationships } from "./TeamReferenceRelationships"; +import { TeamReferenceRelationshipsOncallUsers } from "./TeamReferenceRelationshipsOncallUsers"; +import { TeamReferenceRelationshipsOncallUsersDataItems } from "./TeamReferenceRelationshipsOncallUsersDataItems"; import { TeamRelationships } from "./TeamRelationships"; import { TeamRelationshipsLinks } from "./TeamRelationshipsLinks"; import { TeamResponse } from "./TeamResponse"; @@ -2112,6 +2160,26 @@ const enumsMap: { [key: string]: any[] } = { "ARRAY_OBJECT", ], InterfaceAttributesStatus: ["up", "down", "warning", "off"], + LayerAttributesRestrictionsItemsEndDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + LayerAttributesRestrictionsItemsStartDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + LayerRelationshipsMembersDataItemsType: ["members"], + LayerType: ["layers"], LeakedKeyType: ["leaked_keys"], ListTeamsInclude: ["team_links", "user_team_permissions"], ListTeamsSort: ["name", "-name", "user_count", "-user_count"], @@ -2357,6 +2425,52 @@ const enumsMap: { [key: string]: any[] } = { ScalarColumnTypeNumber: ["number"], ScalarFormulaRequestType: ["scalar_request"], ScalarFormulaResponseType: ["scalar_response"], + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + ScheduleCreateRequestDataRelationshipsTeamsDataItemsType: ["teams"], + ScheduleCreateRequestDataType: ["schedules"], + ScheduleDataRelationshipsLayersDataItemsType: ["layers"], + ScheduleDataRelationshipsTeamsDataItemsType: ["teams"], + ScheduleDataType: ["schedules"], + ScheduleMemberRelationshipsUserDataType: ["users"], + ScheduleMemberType: ["members"], + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType: ["teams"], + ScheduleUpdateRequestDataType: ["schedules"], + ScheduleUserType: ["users"], ScorecardType: ["scorecard"], SecurityFilterFilteredDataType: ["logs"], SecurityFilterType: ["security_filters"], @@ -2536,6 +2650,8 @@ const enumsMap: { [key: string]: any[] } = { "user_access_manage", "teams_manage", ], + TeamReferenceRelationshipsOncallUsersDataItemsType: ["users"], + TeamReferenceType: ["teams"], TeamType: ["team"], TeamsField: [ "id", @@ -3569,6 +3685,13 @@ const typeMap: { [index: string]: any } = { JobCreateResponseData: JobCreateResponseData, JobDefinition: JobDefinition, JobDefinitionFromRule: JobDefinitionFromRule, + Layer: Layer, + LayerAttributes: LayerAttributes, + LayerAttributesInterval: LayerAttributesInterval, + LayerAttributesRestrictionsItems: LayerAttributesRestrictionsItems, + LayerRelationships: LayerRelationships, + LayerRelationshipsMembers: LayerRelationshipsMembers, + LayerRelationshipsMembersDataItems: LayerRelationshipsMembersDataItems, LeakedKey: LeakedKey, LeakedKeyAttributes: LeakedKeyAttributes, Library: Library, @@ -4127,8 +4250,62 @@ const typeMap: { [index: string]: any } = { ScalarFormulaResponseAtrributes: ScalarFormulaResponseAtrributes, ScalarMeta: ScalarMeta, ScalarResponse: ScalarResponse, + Schedule: Schedule, + ScheduleCreateRequest: ScheduleCreateRequest, + ScheduleCreateRequestData: ScheduleCreateRequestData, + ScheduleCreateRequestDataAttributes: ScheduleCreateRequestDataAttributes, + ScheduleCreateRequestDataAttributesLayersItems: + ScheduleCreateRequestDataAttributesLayersItems, + ScheduleCreateRequestDataAttributesLayersItemsInterval: + ScheduleCreateRequestDataAttributesLayersItemsInterval, + ScheduleCreateRequestDataAttributesLayersItemsMembersItems: + ScheduleCreateRequestDataAttributesLayersItemsMembersItems, + ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser: + ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser, + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems: + ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems, + ScheduleCreateRequestDataRelationships: + ScheduleCreateRequestDataRelationships, + ScheduleCreateRequestDataRelationshipsTeams: + ScheduleCreateRequestDataRelationshipsTeams, + ScheduleCreateRequestDataRelationshipsTeamsDataItems: + ScheduleCreateRequestDataRelationshipsTeamsDataItems, + ScheduleData: ScheduleData, + ScheduleDataAttributes: ScheduleDataAttributes, + ScheduleDataRelationships: ScheduleDataRelationships, + ScheduleDataRelationshipsLayers: ScheduleDataRelationshipsLayers, + ScheduleDataRelationshipsLayersDataItems: + ScheduleDataRelationshipsLayersDataItems, + ScheduleDataRelationshipsTeams: ScheduleDataRelationshipsTeams, + ScheduleDataRelationshipsTeamsDataItems: + ScheduleDataRelationshipsTeamsDataItems, + ScheduleMember: ScheduleMember, + ScheduleMemberRelationships: ScheduleMemberRelationships, + ScheduleMemberRelationshipsUser: ScheduleMemberRelationshipsUser, + ScheduleMemberRelationshipsUserData: ScheduleMemberRelationshipsUserData, ScheduleTrigger: ScheduleTrigger, ScheduleTriggerWrapper: ScheduleTriggerWrapper, + ScheduleUpdateRequest: ScheduleUpdateRequest, + ScheduleUpdateRequestData: ScheduleUpdateRequestData, + ScheduleUpdateRequestDataAttributes: ScheduleUpdateRequestDataAttributes, + ScheduleUpdateRequestDataAttributesLayersItems: + ScheduleUpdateRequestDataAttributesLayersItems, + ScheduleUpdateRequestDataAttributesLayersItemsInterval: + ScheduleUpdateRequestDataAttributesLayersItemsInterval, + ScheduleUpdateRequestDataAttributesLayersItemsMembersItems: + ScheduleUpdateRequestDataAttributesLayersItemsMembersItems, + ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser: + ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser, + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems: + ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems, + ScheduleUpdateRequestDataRelationships: + ScheduleUpdateRequestDataRelationships, + ScheduleUpdateRequestDataRelationshipsTeams: + ScheduleUpdateRequestDataRelationshipsTeams, + ScheduleUpdateRequestDataRelationshipsTeamsDataItems: + ScheduleUpdateRequestDataRelationshipsTeamsDataItems, + ScheduleUser: ScheduleUser, + ScheduleUserAttributes: ScheduleUserAttributes, SecurityFilter: SecurityFilter, SecurityFilterAttributes: SecurityFilterAttributes, SecurityFilterCreateAttributes: SecurityFilterCreateAttributes, @@ -4435,6 +4612,12 @@ const typeMap: { [index: string]: any } = { TeamPermissionSettingUpdateAttributes: TeamPermissionSettingUpdateAttributes, TeamPermissionSettingUpdateRequest: TeamPermissionSettingUpdateRequest, TeamPermissionSettingsResponse: TeamPermissionSettingsResponse, + TeamReference: TeamReference, + TeamReferenceAttributes: TeamReferenceAttributes, + TeamReferenceRelationships: TeamReferenceRelationships, + TeamReferenceRelationshipsOncallUsers: TeamReferenceRelationshipsOncallUsers, + TeamReferenceRelationshipsOncallUsersDataItems: + TeamReferenceRelationshipsOncallUsersDataItems, TeamRelationships: TeamRelationships, TeamRelationshipsLinks: TeamRelationshipsLinks, TeamResponse: TeamResponse, @@ -4742,6 +4925,12 @@ const oneOfMap: { [index: string]: string[] } = { RUMGroupByTotal: ["boolean", "string", "number"], ScalarColumn: ["GroupScalarColumn", "DataScalarColumn"], ScalarQuery: ["MetricsScalarQuery", "EventsScalarQuery"], + ScheduleDataIncludedItem: [ + "TeamReference", + "Layer", + "ScheduleMember", + "ScheduleUser", + ], SecurityMonitoringRuleConvertPayload: [ "SecurityMonitoringStandardRulePayload", "SecurityMonitoringSignalRulePayload", diff --git a/packages/datadog-api-client-v2/models/Schedule.ts b/packages/datadog-api-client-v2/models/Schedule.ts new file mode 100644 index 000000000000..9e7f7b2a61c9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Schedule.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleData } from "./ScheduleData"; +import { ScheduleDataIncludedItem } from "./ScheduleDataIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Top-level container for a schedule object, including both the `data` payload and any related `included` resources (such as teams, layers, or members). + */ +export class Schedule { + /** + * Represents the primary data object for a schedule, linking attributes and relationships. + */ + "data"?: ScheduleData; + /** + * Any additional resources related to this schedule, such as teams and layers. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ScheduleData", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Schedule.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequest.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequest.ts new file mode 100644 index 000000000000..2f9ddc46bbd9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestData } from "./ScheduleCreateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The top-level request body for schedule creation, wrapping a `data` object. + */ +export class ScheduleCreateRequest { + /** + * The core data wrapper for creating a schedule, encompassing attributes, relationships, and the resource type. + */ + "data": ScheduleCreateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ScheduleCreateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestData.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestData.ts new file mode 100644 index 000000000000..8d0d62b05e21 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataAttributes } from "./ScheduleCreateRequestDataAttributes"; +import { ScheduleCreateRequestDataRelationships } from "./ScheduleCreateRequestDataRelationships"; +import { ScheduleCreateRequestDataType } from "./ScheduleCreateRequestDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The core data wrapper for creating a schedule, encompassing attributes, relationships, and the resource type. + */ +export class ScheduleCreateRequestData { + /** + * Describes the main attributes for creating a new schedule, including name, layers, time zone, and tags. + */ + "attributes": ScheduleCreateRequestDataAttributes; + /** + * Gathers relationship objects for the schedule creation request, including the teams to associate. + */ + "relationships"?: ScheduleCreateRequestDataRelationships; + /** + * Schedules resource type. + */ + "type": ScheduleCreateRequestDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ScheduleCreateRequestDataAttributes", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ScheduleCreateRequestDataRelationships", + }, + type: { + baseName: "type", + type: "ScheduleCreateRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributes.ts new file mode 100644 index 000000000000..97de4cc69835 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributes.ts @@ -0,0 +1,80 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataAttributesLayersItems } from "./ScheduleCreateRequestDataAttributesLayersItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Describes the main attributes for creating a new schedule, including name, layers, time zone, and tags. + */ +export class ScheduleCreateRequestDataAttributes { + /** + * The layers of on-call coverage that define rotation intervals and restrictions. + */ + "layers": Array; + /** + * A human-readable name for the new schedule. + */ + "name": string; + /** + * A list of tags for categorizing or filtering the schedule. + */ + "tags"?: Array; + /** + * The time zone in which the schedule is defined. + */ + "timeZone": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + layers: { + baseName: "layers", + type: "Array", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + timeZone: { + baseName: "time_zone", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItems.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItems.ts new file mode 100644 index 000000000000..50fce53b9ebb --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItems.ts @@ -0,0 +1,111 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataAttributesLayersItemsInterval } from "./ScheduleCreateRequestDataAttributesLayersItemsInterval"; +import { ScheduleCreateRequestDataAttributesLayersItemsMembersItems } from "./ScheduleCreateRequestDataAttributesLayersItemsMembersItems"; +import { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems } from "./ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Describes a schedule layer, including rotation intervals, members, restrictions, and timeline settings. + */ +export class ScheduleCreateRequestDataAttributesLayersItems { + /** + * The date/time when this layer becomes active (in ISO 8601). + */ + "effectiveDate": Date; + /** + * The date/time after which this layer no longer applies (in ISO 8601). + */ + "endDate"?: Date; + /** + * Defines how frequently the rotation repeats, using days and/or seconds (up to certain limits). + */ + "interval": ScheduleCreateRequestDataAttributesLayersItemsInterval; + /** + * A list of members who participate in this layer's rotation. + */ + "members": Array; + /** + * The name of this layer. + */ + "name": string; + /** + * Zero or more time-based restrictions (for example, only weekdays, during business hours). + */ + "restrictions"?: Array; + /** + * The date/time when the rotation for this layer starts (in ISO 8601). + */ + "rotationStart": Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + effectiveDate: { + baseName: "effective_date", + type: "Date", + required: true, + format: "date-time", + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + interval: { + baseName: "interval", + type: "ScheduleCreateRequestDataAttributesLayersItemsInterval", + required: true, + }, + members: { + baseName: "members", + type: "Array", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + restrictions: { + baseName: "restrictions", + type: "Array", + }, + rotationStart: { + baseName: "rotation_start", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributesLayersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsInterval.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsInterval.ts new file mode 100644 index 000000000000..39426c43667e --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsInterval.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines how frequently the rotation repeats, using days and/or seconds (up to certain limits). + */ +export class ScheduleCreateRequestDataAttributesLayersItemsInterval { + /** + * The number of full days in each rotation period. + */ + "days"?: number; + /** + * Extra seconds that may be added to extend the rotation beyond whole days. + */ + "seconds"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + days: { + baseName: "days", + type: "number", + format: "int32", + }, + seconds: { + baseName: "seconds", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributesLayersItemsInterval.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItems.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItems.ts new file mode 100644 index 000000000000..ed3cf68e806c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItems.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser } from "./ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines a single member within a schedule layer, including the reference to the underlying user. + */ +export class ScheduleCreateRequestDataAttributesLayersItemsMembersItems { + /** + * Identifies the user participating in this layer as a single object with an `id`. + */ + "user"?: ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + user: { + baseName: "user", + type: "ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributesLayersItemsMembersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser.ts new file mode 100644 index 000000000000..2fbf5d9adf4c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser.ts @@ -0,0 +1,52 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Identifies the user participating in this layer as a single object with an `id`. + */ +export class ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser { + /** + * The user's ID. + */ + "id"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.ts new file mode 100644 index 000000000000..acf8d7b750db --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay } from "./ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay"; +import { ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay } from "./ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines a time restriction for a schedule layer, including which day of the week + * it starts and ends, along with start/end times. + */ +export class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems { + /** + * The weekday when the restriction period ends (Monday through Sunday). + */ + "endDay"?: ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay; + /** + * The time of day when the restriction ends (hh:mm:ss). + */ + "endTime"?: string; + /** + * The weekday when the restriction period starts (Monday through Sunday). + */ + "startDay"?: ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay; + /** + * The time of day when the restriction begins (hh:mm:ss). + */ + "startTime"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + endDay: { + baseName: "end_day", + type: "ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay", + }, + endTime: { + baseName: "end_time", + type: "string", + }, + startDay: { + baseName: "start_day", + type: "ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay", + }, + startTime: { + baseName: "start_time", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts new file mode 100644 index 000000000000..8dd9742a215f --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts @@ -0,0 +1,29 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The weekday when the restriction period ends (Monday through Sunday). + */ + +export type ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay = + + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts new file mode 100644 index 000000000000..eda43208484e --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts @@ -0,0 +1,29 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The weekday when the restriction period starts (Monday through Sunday). + */ + +export type ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay = + + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationships.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationships.ts new file mode 100644 index 000000000000..063c303b8122 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataRelationshipsTeams } from "./ScheduleCreateRequestDataRelationshipsTeams"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Gathers relationship objects for the schedule creation request, including the teams to associate. + */ +export class ScheduleCreateRequestDataRelationships { + /** + * Associates the new schedule with one or more teams. + */ + "teams"?: ScheduleCreateRequestDataRelationshipsTeams; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + teams: { + baseName: "teams", + type: "ScheduleCreateRequestDataRelationshipsTeams", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeams.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeams.ts new file mode 100644 index 000000000000..41fc38f30b84 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeams.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataRelationshipsTeamsDataItems } from "./ScheduleCreateRequestDataRelationshipsTeamsDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Associates the new schedule with one or more teams. + */ +export class ScheduleCreateRequestDataRelationshipsTeams { + /** + * An array of team references for this schedule. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataRelationshipsTeams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItems.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItems.ts new file mode 100644 index 000000000000..a4f5a90f4427 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItems.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleCreateRequestDataRelationshipsTeamsDataItemsType } from "./ScheduleCreateRequestDataRelationshipsTeamsDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Holds the relationship data linking this schedule to a particular team, + * identified by `id` and `type`. + */ +export class ScheduleCreateRequestDataRelationshipsTeamsDataItems { + /** + * A unique identifier for the team. + */ + "id"?: string; + /** + * Teams resource type. + */ + "type"?: ScheduleCreateRequestDataRelationshipsTeamsDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleCreateRequestDataRelationshipsTeamsDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleCreateRequestDataRelationshipsTeamsDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItemsType.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItemsType.ts new file mode 100644 index 000000000000..90108f9c59bc --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataRelationshipsTeamsDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Teams resource type. + */ + +export type ScheduleCreateRequestDataRelationshipsTeamsDataItemsType = + | typeof TEAMS + | UnparsedObject; +export const TEAMS = "teams"; diff --git a/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataType.ts b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataType.ts new file mode 100644 index 000000000000..3ed6eda3d277 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleCreateRequestDataType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Schedules resource type. + */ + +export type ScheduleCreateRequestDataType = typeof SCHEDULES | UnparsedObject; +export const SCHEDULES = "schedules"; diff --git a/packages/datadog-api-client-v2/models/ScheduleData.ts b/packages/datadog-api-client-v2/models/ScheduleData.ts new file mode 100644 index 000000000000..83ee429137f8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleData.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataAttributes } from "./ScheduleDataAttributes"; +import { ScheduleDataRelationships } from "./ScheduleDataRelationships"; +import { ScheduleDataType } from "./ScheduleDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents the primary data object for a schedule, linking attributes and relationships. + */ +export class ScheduleData { + /** + * Provides core properties of a schedule object, such as its name, time zone, and tags. + */ + "attributes"?: ScheduleDataAttributes; + /** + * The schedule's unique identifier. + */ + "id"?: string; + /** + * Groups the relationships for a schedule object, referencing layers and teams. + */ + "relationships"?: ScheduleDataRelationships; + /** + * Schedules resource type. + */ + "type"?: ScheduleDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ScheduleDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "ScheduleDataRelationships", + }, + type: { + baseName: "type", + type: "ScheduleDataType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataAttributes.ts b/packages/datadog-api-client-v2/models/ScheduleDataAttributes.ts new file mode 100644 index 000000000000..538fcf9d31c8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataAttributes.ts @@ -0,0 +1,68 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Provides core properties of a schedule object, such as its name, time zone, and tags. + */ +export class ScheduleDataAttributes { + /** + * A short name for the schedule. + */ + "name"?: string; + /** + * A list of tags associated with this schedule. + */ + "tags"?: Array; + /** + * The time zone in which this schedule operates. + */ + "timeZone"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + timeZone: { + baseName: "time_zone", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataIncludedItem.ts b/packages/datadog-api-client-v2/models/ScheduleDataIncludedItem.ts new file mode 100644 index 000000000000..1781703208dd --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataIncludedItem.ts @@ -0,0 +1,22 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Layer } from "./Layer"; +import { ScheduleMember } from "./ScheduleMember"; +import { ScheduleUser } from "./ScheduleUser"; +import { TeamReference } from "./TeamReference"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Any additional resources related to this schedule, such as teams and layers. + */ + +export type ScheduleDataIncludedItem = + | TeamReference + | Layer + | ScheduleMember + | ScheduleUser + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationships.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationships.ts new file mode 100644 index 000000000000..84297c4fd715 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationships.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataRelationshipsLayers } from "./ScheduleDataRelationshipsLayers"; +import { ScheduleDataRelationshipsTeams } from "./ScheduleDataRelationshipsTeams"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Groups the relationships for a schedule object, referencing layers and teams. + */ +export class ScheduleDataRelationships { + /** + * Associates layers with this schedule in a data structure. + */ + "layers"?: ScheduleDataRelationshipsLayers; + /** + * Associates teams with this schedule in a data structure. + */ + "teams"?: ScheduleDataRelationshipsTeams; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + layers: { + baseName: "layers", + type: "ScheduleDataRelationshipsLayers", + }, + teams: { + baseName: "teams", + type: "ScheduleDataRelationshipsTeams", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayers.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayers.ts new file mode 100644 index 000000000000..a42ce5c135ee --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayers.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataRelationshipsLayersDataItems } from "./ScheduleDataRelationshipsLayersDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Associates layers with this schedule in a data structure. + */ +export class ScheduleDataRelationshipsLayers { + /** + * An array of layer references for this schedule. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataRelationshipsLayers.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItems.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItems.ts new file mode 100644 index 000000000000..e9f0082c0d23 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItems.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataRelationshipsLayersDataItemsType } from "./ScheduleDataRelationshipsLayersDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relates a layer to this schedule, identified by `id` and `type` (must be `layers`). + */ +export class ScheduleDataRelationshipsLayersDataItems { + /** + * The unique identifier of the layer in this relationship. + */ + "id"?: string; + /** + * Layers resource type. + */ + "type"?: ScheduleDataRelationshipsLayersDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleDataRelationshipsLayersDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataRelationshipsLayersDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItemsType.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItemsType.ts new file mode 100644 index 000000000000..e689c0a8db44 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsLayersDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Layers resource type. + */ + +export type ScheduleDataRelationshipsLayersDataItemsType = + | typeof LAYERS + | UnparsedObject; +export const LAYERS = "layers"; diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeams.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeams.ts new file mode 100644 index 000000000000..1d3c244f5c9b --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeams.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataRelationshipsTeamsDataItems } from "./ScheduleDataRelationshipsTeamsDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Associates teams with this schedule in a data structure. + */ +export class ScheduleDataRelationshipsTeams { + /** + * An array of team references for this schedule. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataRelationshipsTeams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItems.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItems.ts new file mode 100644 index 000000000000..41981bc0b0f4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItems.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleDataRelationshipsTeamsDataItemsType } from "./ScheduleDataRelationshipsTeamsDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relates a team to this schedule, identified by `id` and `type` (must be `teams`). + */ +export class ScheduleDataRelationshipsTeamsDataItems { + /** + * The unique identifier of the team in this relationship. + */ + "id"?: string; + /** + * Teams resource type. + */ + "type"?: ScheduleDataRelationshipsTeamsDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleDataRelationshipsTeamsDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleDataRelationshipsTeamsDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItemsType.ts b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItemsType.ts new file mode 100644 index 000000000000..7025c43e71a5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataRelationshipsTeamsDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Teams resource type. + */ + +export type ScheduleDataRelationshipsTeamsDataItemsType = + | typeof TEAMS + | UnparsedObject; +export const TEAMS = "teams"; diff --git a/packages/datadog-api-client-v2/models/ScheduleDataType.ts b/packages/datadog-api-client-v2/models/ScheduleDataType.ts new file mode 100644 index 000000000000..6d971ab32c78 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleDataType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Schedules resource type. + */ + +export type ScheduleDataType = typeof SCHEDULES | UnparsedObject; +export const SCHEDULES = "schedules"; diff --git a/packages/datadog-api-client-v2/models/ScheduleMember.ts b/packages/datadog-api-client-v2/models/ScheduleMember.ts new file mode 100644 index 000000000000..e91f09c6caaf --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMember.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleMemberRelationships } from "./ScheduleMemberRelationships"; +import { ScheduleMemberType } from "./ScheduleMemberType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents a single member entry in a schedule, referencing a specific user. + */ +export class ScheduleMember { + /** + * The unique identifier for this schedule member. + */ + "id"?: string; + /** + * Defines relationships for a schedule member, primarily referencing a single user. + */ + "relationships"?: ScheduleMemberRelationships; + /** + * Schedule Members resource type. + */ + "type"?: ScheduleMemberType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "ScheduleMemberRelationships", + }, + type: { + baseName: "type", + type: "ScheduleMemberType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleMember.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleMemberRelationships.ts b/packages/datadog-api-client-v2/models/ScheduleMemberRelationships.ts new file mode 100644 index 000000000000..48eddfae24f0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMemberRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleMemberRelationshipsUser } from "./ScheduleMemberRelationshipsUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines relationships for a schedule member, primarily referencing a single user. + */ +export class ScheduleMemberRelationships { + /** + * Wraps the user data reference for a schedule member. + */ + "user"?: ScheduleMemberRelationshipsUser; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + user: { + baseName: "user", + type: "ScheduleMemberRelationshipsUser", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleMemberRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUser.ts b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUser.ts new file mode 100644 index 000000000000..ecf8b8d0979f --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUser.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleMemberRelationshipsUserData } from "./ScheduleMemberRelationshipsUserData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Wraps the user data reference for a schedule member. + */ +export class ScheduleMemberRelationshipsUser { + /** + * Points to the user data associated with this schedule member, including an ID and type. + */ + "data"?: ScheduleMemberRelationshipsUserData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ScheduleMemberRelationshipsUserData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleMemberRelationshipsUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserData.ts b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserData.ts new file mode 100644 index 000000000000..e51dbe15a7e7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserData.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleMemberRelationshipsUserDataType } from "./ScheduleMemberRelationshipsUserDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Points to the user data associated with this schedule member, including an ID and type. + */ +export class ScheduleMemberRelationshipsUserData { + /** + * The user's unique identifier. + */ + "id"?: string; + /** + * Users resource type. + */ + "type"?: ScheduleMemberRelationshipsUserDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleMemberRelationshipsUserDataType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleMemberRelationshipsUserData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserDataType.ts b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserDataType.ts new file mode 100644 index 000000000000..3a6ea44023dc --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMemberRelationshipsUserDataType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Users resource type. + */ + +export type ScheduleMemberRelationshipsUserDataType = + | typeof USERS + | UnparsedObject; +export const USERS = "users"; diff --git a/packages/datadog-api-client-v2/models/ScheduleMemberType.ts b/packages/datadog-api-client-v2/models/ScheduleMemberType.ts new file mode 100644 index 000000000000..511620573eb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleMemberType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Schedule Members resource type. + */ + +export type ScheduleMemberType = typeof MEMBERS | UnparsedObject; +export const MEMBERS = "members"; diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequest.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequest.ts new file mode 100644 index 000000000000..1b699a1c639f --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestData } from "./ScheduleUpdateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A top-level wrapper for a schedule update request, referring to the `data` object with the new details. + */ +export class ScheduleUpdateRequest { + /** + * Contains all data needed to update an existing schedule, including its attributes (such as name, layers, or tags) and any relationships to teams. + */ + "data": ScheduleUpdateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ScheduleUpdateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestData.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestData.ts new file mode 100644 index 000000000000..55f69ee60dae --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestData.ts @@ -0,0 +1,82 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataAttributes } from "./ScheduleUpdateRequestDataAttributes"; +import { ScheduleUpdateRequestDataRelationships } from "./ScheduleUpdateRequestDataRelationships"; +import { ScheduleUpdateRequestDataType } from "./ScheduleUpdateRequestDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Contains all data needed to update an existing schedule, including its attributes (such as name, layers, or tags) and any relationships to teams. + */ +export class ScheduleUpdateRequestData { + /** + * Defines the updatable attributes for a schedule, such as name, time zone, tags, and layers. + */ + "attributes": ScheduleUpdateRequestDataAttributes; + /** + * The ID of the schedule to be updated. + */ + "id": string; + /** + * Houses relationships for the schedule update, typically referencing teams. + */ + "relationships"?: ScheduleUpdateRequestDataRelationships; + /** + * Schedules resource type. + */ + "type": ScheduleUpdateRequestDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ScheduleUpdateRequestDataAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ScheduleUpdateRequestDataRelationships", + }, + type: { + baseName: "type", + type: "ScheduleUpdateRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributes.ts new file mode 100644 index 000000000000..c3a390d93e56 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributes.ts @@ -0,0 +1,80 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataAttributesLayersItems } from "./ScheduleUpdateRequestDataAttributesLayersItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines the updatable attributes for a schedule, such as name, time zone, tags, and layers. + */ +export class ScheduleUpdateRequestDataAttributes { + /** + * The updated list of layers (rotations) for this schedule. + */ + "layers": Array; + /** + * A short name for the schedule. + */ + "name": string; + /** + * A list of tags that you can associate with this schedule. + */ + "tags"?: Array; + /** + * The time zone used when interpreting rotation times. + */ + "timeZone": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + layers: { + baseName: "layers", + type: "Array", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + timeZone: { + baseName: "time_zone", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItems.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItems.ts new file mode 100644 index 000000000000..acc444b674d9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItems.ts @@ -0,0 +1,115 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataAttributesLayersItemsInterval } from "./ScheduleUpdateRequestDataAttributesLayersItemsInterval"; +import { ScheduleUpdateRequestDataAttributesLayersItemsMembersItems } from "./ScheduleUpdateRequestDataAttributesLayersItemsMembersItems"; +import { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems } from "./ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents a layer within a schedule update, including rotation details, members, + * and optional restrictions. + */ +export class ScheduleUpdateRequestDataAttributesLayersItems { + /** + * When this updated layer takes effect (ISO 8601 format). + */ + "effectiveDate"?: Date; + /** + * When this updated layer should stop being active (ISO 8601 format). + */ + "endDate"?: Date; + /** + * A unique identifier for the layer being updated. + */ + "id"?: string; + /** + * Specifies how the rotation repeats: number of days, plus optional seconds, up to the given maximums. + */ + "interval"?: ScheduleUpdateRequestDataAttributesLayersItemsInterval; + /** + * The members assigned to this layer. + */ + "members"?: Array; + /** + * The name for this layer (for example, “Secondary Coverage”). + */ + "name"?: string; + /** + * Any time restrictions that define when this layer is active. + */ + "restrictions"?: Array; + /** + * The date/time at which the rotation begins (ISO 8601 format). + */ + "rotationStart"?: Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + effectiveDate: { + baseName: "effective_date", + type: "Date", + format: "date-time", + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + id: { + baseName: "id", + type: "string", + }, + interval: { + baseName: "interval", + type: "ScheduleUpdateRequestDataAttributesLayersItemsInterval", + }, + members: { + baseName: "members", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + restrictions: { + baseName: "restrictions", + type: "Array", + }, + rotationStart: { + baseName: "rotation_start", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributesLayersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsInterval.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsInterval.ts new file mode 100644 index 000000000000..7379e7fd4007 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsInterval.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Specifies how the rotation repeats: number of days, plus optional seconds, up to the given maximums. + */ +export class ScheduleUpdateRequestDataAttributesLayersItemsInterval { + /** + * How many days each rotation cycle should span. + */ + "days"?: number; + /** + * Additional seconds to add to the rotation cycle (for example, partial days). + */ + "seconds"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + days: { + baseName: "days", + type: "number", + format: "int32", + }, + seconds: { + baseName: "seconds", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributesLayersItemsInterval.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItems.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItems.ts new file mode 100644 index 000000000000..709000b3a321 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItems.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser } from "./ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines a single member within a layer during an update request, referring + * to a specific user. + */ +export class ScheduleUpdateRequestDataAttributesLayersItemsMembersItems { + /** + * Identifies the user who is assigned to this member object. Only `id` is required. + */ + "user"?: ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + user: { + baseName: "user", + type: "ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributesLayersItemsMembersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser.ts new file mode 100644 index 000000000000..3bbccc7db118 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser.ts @@ -0,0 +1,52 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Identifies the user who is assigned to this member object. Only `id` is required. + */ +export class ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser { + /** + * The user's ID. + */ + "id"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.ts new file mode 100644 index 000000000000..4bd6e5935989 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay } from "./ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay"; +import { ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay } from "./ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines a time restriction object for a layer within a schedule update, including + * start and end days, as well as times. + */ +export class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems { + /** + * Defines the day of the week on which the time restriction ends. + */ + "endDay"?: ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay; + /** + * The time at which this restriction ends (hh:mm:ss). + */ + "endTime"?: string; + /** + * Defines the day of the week on which the time restriction starts. + */ + "startDay"?: ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay; + /** + * The time at which this restriction starts (hh:mm:ss). + */ + "startTime"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + endDay: { + baseName: "end_day", + type: "ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay", + }, + endTime: { + baseName: "end_time", + type: "string", + }, + startDay: { + baseName: "start_day", + type: "ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay", + }, + startTime: { + baseName: "start_time", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts new file mode 100644 index 000000000000..fd677be5f3d6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.ts @@ -0,0 +1,29 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Defines the day of the week on which the time restriction ends. + */ + +export type ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay = + + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts new file mode 100644 index 000000000000..d1199b8f263c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.ts @@ -0,0 +1,29 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Defines the day of the week on which the time restriction starts. + */ + +export type ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay = + + | typeof MONDAY + | typeof TUESDAY + | typeof WEDNESDAY + | typeof THURSDAY + | typeof FRIDAY + | typeof SATURDAY + | typeof SUNDAY + | UnparsedObject; +export const MONDAY = "monday"; +export const TUESDAY = "tuesday"; +export const WEDNESDAY = "wednesday"; +export const THURSDAY = "thursday"; +export const FRIDAY = "friday"; +export const SATURDAY = "saturday"; +export const SUNDAY = "sunday"; diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationships.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationships.ts new file mode 100644 index 000000000000..76e9ad6ec39b --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataRelationshipsTeams } from "./ScheduleUpdateRequestDataRelationshipsTeams"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Houses relationships for the schedule update, typically referencing teams. + */ +export class ScheduleUpdateRequestDataRelationships { + /** + * Defines the teams that this schedule update is associated with. + */ + "teams"?: ScheduleUpdateRequestDataRelationshipsTeams; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + teams: { + baseName: "teams", + type: "ScheduleUpdateRequestDataRelationshipsTeams", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeams.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeams.ts new file mode 100644 index 000000000000..a2371840f147 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeams.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataRelationshipsTeamsDataItems } from "./ScheduleUpdateRequestDataRelationshipsTeamsDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines the teams that this schedule update is associated with. + */ +export class ScheduleUpdateRequestDataRelationshipsTeams { + /** + * An array of team references. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataRelationshipsTeams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItems.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItems.ts new file mode 100644 index 000000000000..8ee962884780 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItems.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType } from "./ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Links the schedule to a team within an update request, identified by `id` and `type`. + */ +export class ScheduleUpdateRequestDataRelationshipsTeamsDataItems { + /** + * The unique team identifier. + */ + "id"?: string; + /** + * Teams resource type. + */ + "type"?: ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUpdateRequestDataRelationshipsTeamsDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType.ts new file mode 100644 index 000000000000..1172dcef32b6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Teams resource type. + */ + +export type ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType = + | typeof TEAMS + | UnparsedObject; +export const TEAMS = "teams"; diff --git a/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataType.ts b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataType.ts new file mode 100644 index 000000000000..bf017ba5c39a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUpdateRequestDataType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Schedules resource type. + */ + +export type ScheduleUpdateRequestDataType = typeof SCHEDULES | UnparsedObject; +export const SCHEDULES = "schedules"; diff --git a/packages/datadog-api-client-v2/models/ScheduleUser.ts b/packages/datadog-api-client-v2/models/ScheduleUser.ts new file mode 100644 index 000000000000..f45c1b8f2f84 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUser.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ScheduleUserAttributes } from "./ScheduleUserAttributes"; +import { ScheduleUserType } from "./ScheduleUserType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents a user object in the context of a schedule, including their `id`, type, and basic attributes. + */ +export class ScheduleUser { + /** + * Provides basic user information for a schedule, including a name and email address. + */ + "attributes"?: ScheduleUserAttributes; + /** + * The unique user identifier. + */ + "id"?: string; + /** + * Users resource type. + */ + "type"?: ScheduleUserType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ScheduleUserAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScheduleUserType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUserAttributes.ts b/packages/datadog-api-client-v2/models/ScheduleUserAttributes.ts new file mode 100644 index 000000000000..bd7f50ef0ea1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUserAttributes.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Provides basic user information for a schedule, including a name and email address. + */ +export class ScheduleUserAttributes { + /** + * The user's email address. + */ + "email"?: string; + /** + * The user's name. + */ + "name"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + email: { + baseName: "email", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScheduleUserAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ScheduleUserType.ts b/packages/datadog-api-client-v2/models/ScheduleUserType.ts new file mode 100644 index 000000000000..eb10d07de176 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ScheduleUserType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Users resource type. + */ + +export type ScheduleUserType = typeof USERS | UnparsedObject; +export const USERS = "users"; diff --git a/packages/datadog-api-client-v2/models/TeamReference.ts b/packages/datadog-api-client-v2/models/TeamReference.ts new file mode 100644 index 000000000000..38a015d39f4a --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReference.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamReferenceAttributes } from "./TeamReferenceAttributes"; +import { TeamReferenceRelationships } from "./TeamReferenceRelationships"; +import { TeamReferenceType } from "./TeamReferenceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Provides a reference to a team, including ID, type, and basic attributes/relationships. + */ +export class TeamReference { + /** + * Encapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description. + */ + "attributes"?: TeamReferenceAttributes; + /** + * The team's unique identifier. + */ + "id"?: string; + /** + * Collects the key relationship fields for a team reference, specifically on-call users. + */ + "relationships"?: TeamReferenceRelationships; + /** + * Teams resource type. + */ + "type"?: TeamReferenceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamReferenceAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "TeamReferenceRelationships", + }, + type: { + baseName: "type", + type: "TeamReferenceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamReference.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamReferenceAttributes.ts b/packages/datadog-api-client-v2/models/TeamReferenceAttributes.ts new file mode 100644 index 000000000000..33f15857042c --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceAttributes.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Encapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description. + */ +export class TeamReferenceAttributes { + /** + * URL or reference for the team's avatar (if available). + */ + "avatar"?: string; + /** + * A short text describing the team. + */ + "description"?: string; + /** + * A unique handle/slug for the team. + */ + "handle"?: string; + /** + * The full, human-readable name of the team. + */ + "name"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + avatar: { + baseName: "avatar", + type: "string", + }, + description: { + baseName: "description", + type: "string", + }, + handle: { + baseName: "handle", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamReferenceAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamReferenceRelationships.ts b/packages/datadog-api-client-v2/models/TeamReferenceRelationships.ts new file mode 100644 index 000000000000..7b79e13ecca4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamReferenceRelationshipsOncallUsers } from "./TeamReferenceRelationshipsOncallUsers"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Collects the key relationship fields for a team reference, specifically on-call users. + */ +export class TeamReferenceRelationships { + /** + * Defines which users are on-call within a team, stored as an array of references. + */ + "oncallUsers"?: TeamReferenceRelationshipsOncallUsers; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + oncallUsers: { + baseName: "oncall_users", + type: "TeamReferenceRelationshipsOncallUsers", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamReferenceRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsers.ts b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsers.ts new file mode 100644 index 000000000000..49edc66b15c4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsers.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamReferenceRelationshipsOncallUsersDataItems } from "./TeamReferenceRelationshipsOncallUsersDataItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Defines which users are on-call within a team, stored as an array of references. + */ +export class TeamReferenceRelationshipsOncallUsers { + /** + * The list of user references who are on-call for this team. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamReferenceRelationshipsOncallUsers.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItems.ts b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItems.ts new file mode 100644 index 000000000000..da4d8edd2cbe --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItems.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamReferenceRelationshipsOncallUsersDataItemsType } from "./TeamReferenceRelationshipsOncallUsersDataItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * References a user who is on-call within this team, identified by `id` and `type`. + */ +export class TeamReferenceRelationshipsOncallUsersDataItems { + /** + * The unique identifier of the user. + */ + "id"?: string; + /** + * Users resource type. + */ + "type"?: TeamReferenceRelationshipsOncallUsersDataItemsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "TeamReferenceRelationshipsOncallUsersDataItemsType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamReferenceRelationshipsOncallUsersDataItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItemsType.ts b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItemsType.ts new file mode 100644 index 000000000000..90eccf3fb187 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceRelationshipsOncallUsersDataItemsType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Users resource type. + */ + +export type TeamReferenceRelationshipsOncallUsersDataItemsType = + | typeof USERS + | UnparsedObject; +export const USERS = "users"; diff --git a/packages/datadog-api-client-v2/models/TeamReferenceType.ts b/packages/datadog-api-client-v2/models/TeamReferenceType.ts new file mode 100644 index 000000000000..1828cb617eac --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamReferenceType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Teams resource type. + */ + +export type TeamReferenceType = typeof TEAMS | UnparsedObject; +export const TEAMS = "teams";