diff --git a/.apigentools-info b/.apigentools-info index da80bab441b0..02fe15d9b6c0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-01 14:24:23.747365", - "spec_repo_commit": "d90ee2ef" + "regenerated": "2024-10-01 16:17:41.289280", + "spec_repo_commit": "65dbf403" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-01 14:24:23.761793", - "spec_repo_commit": "d90ee2ef" + "regenerated": "2024-10-01 16:17:41.304766", + "spec_repo_commit": "65dbf403" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce325fb62815..63eb2ce84430 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -451,6 +451,48 @@ components: required: true schema: type: string + MicrosoftTeamsChannelNamePathParameter: + description: Your channel name. + in: path + name: channel_name + required: true + schema: + type: string + MicrosoftTeamsHandleIDPathParameter: + description: Your handle id. + in: path + name: handle_id + required: true + schema: + type: string + MicrosoftTeamsHandleNamePathParameter: + description: Your handle name. + in: path + name: handle_name + required: true + schema: + type: string + MicrosoftTeamsTeamNamePathParameter: + description: Your team name. + in: path + name: team_name + required: true + schema: + type: string + MicrosoftTeamsTenantIDQueryParameter: + description: Your tenant id. + in: query + name: tenant_id + required: false + schema: + type: string + MicrosoftTeamsTenantNamePathParameter: + description: Your tenant name. + in: path + name: tenant_name + required: true + schema: + type: string OpsgenieServiceIDPathParameter: description: The UUID of the service. in: path @@ -691,6 +733,12 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not Found + PreconditionFailedResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Failed Precondition SpansBadRequestResponse: content: application/json: @@ -14761,6 +14809,276 @@ components: - data_source - query type: object + MicrosoftTeamsApiHandleAttributes: + description: Handle attributes. + properties: + channel_id: + description: Channel id. + example: fake-channel-id + maxLength: 255 + type: string + name: + description: Handle name. + example: fake-handle-name + maxLength: 255 + type: string + team_id: + description: Team id. + example: 00000000-0000-0000-0000-000000000000 + maxLength: 255 + type: string + tenant_id: + description: Tenant id. + example: 00000000-0000-0000-0000-000000000001 + maxLength: 255 + type: string + type: object + MicrosoftTeamsApiHandleInfoResponse: + description: Response of a handle. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseData' + type: object + MicrosoftTeamsApiHandleInfoResponseAttributes: + description: Handle attributes. + properties: + channel_id: + description: Channel id. + example: fake-channel-id + maxLength: 255 + type: string + channel_name: + description: Channel name. + example: fake-channel-name + maxLength: 255 + type: string + name: + description: Handle name. + example: fake-handle-name + maxLength: 255 + type: string + team_id: + description: Team id. + example: 00000000-0000-0000-0000-000000000000 + maxLength: 255 + type: string + team_name: + description: Team name. + example: fake-team-name + maxLength: 255 + type: string + tenant_id: + description: Tenant id. + example: 00000000-0000-0000-0000-000000000001 + maxLength: 255 + type: string + tenant_name: + description: Tenant name. + example: fake-tenant-name + maxLength: 255 + type: string + type: object + MicrosoftTeamsApiHandleInfoResponseData: + description: Handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseAttributes' + id: + description: The ID of the handle. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + maxLength: 100 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoType' + type: object + MicrosoftTeamsApiHandleInfoType: + default: ms-teams-handle-info + description: Handle resource type. + enum: + - ms-teams-handle-info + example: ms-teams-handle-info + type: string + x-enum-varnames: + - MS_TEAMS_HANDLE_INFO + MicrosoftTeamsApiHandleRequestAttributes: + description: Handle attributes. + properties: + channel_id: + description: Channel id. + example: fake-channel-id + maxLength: 255 + type: string + name: + description: Handle name. + example: fake-handle-name + maxLength: 255 + type: string + team_id: + description: Team id. + example: 00000000-0000-0000-0000-000000000000 + maxLength: 255 + type: string + tenant_id: + description: Tenant id. + example: 00000000-0000-0000-0000-000000000001 + maxLength: 255 + type: string + required: + - name + - channel_id + - team_id + - tenant_id + type: object + MicrosoftTeamsApiHandleRequestData: + description: Handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleRequestAttributes' + type: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + required: + - type + - attributes + type: object + MicrosoftTeamsApiHandleResponseData: + description: Handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleAttributes' + id: + description: The ID of the handle. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + maxLength: 100 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + type: object + MicrosoftTeamsApiHandleType: + default: handle + description: Specifies the handle resource type. + enum: + - handle + example: handle + type: string + x-enum-varnames: + - HANDLE + MicrosoftTeamsApiHandlesResponse: + description: Response with a list of handles. + properties: + data: + description: An array of handles. + example: + - attributes: + channelId: 19:b41k24b14bn1nwffkernfkwrnfneubgkr@thread.tacv2 + channelName: General + name: general-handle + teamId: 00000000-0000-0000-0000-000000000000 + teamName: Example Team + tenantId: 00000000-0000-0000-0000-000000000001 + tenantName: Company, Inc. + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: ms-teams-handle-info + - attributes: + channelId: 19:b41k24b14bn1nwffkernfkwrnfneubgk1@thread.tacv2 + channelName: General2 + name: general-handle-2 + teamId: 00000000-0000-0000-0000-000000000002 + teamName: Example Team 2 + tenantId: 00000000-0000-0000-0000-000000000003 + tenantName: Company, Inc. + id: 596da4af-0563-4097-90ff-07230c3f9db4 + type: ms-teams-handle-info + items: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseData' + type: array + required: + - data + type: object + MicrosoftTeamsChannelInfoResponseAttributes: + description: Channel attributes. + properties: + is_primary: + description: Indicates if this is the primary channel. + example: true + maxLength: 255 + type: boolean + team_id: + description: Team id. + example: 00000000-0000-0000-0000-000000000000 + maxLength: 255 + type: string + tenant_id: + description: Tenant id. + example: 00000000-0000-0000-0000-000000000001 + maxLength: 255 + type: string + type: object + MicrosoftTeamsChannelInfoResponseData: + description: Channel data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsChannelInfoResponseAttributes' + id: + description: The ID of the channel. + example: 19:b41k24b14bn1nwffkernfkwrnfneubgkr@thread.tacv2 + maxLength: 255 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/MicrosoftTeamsChannelInfoType' + type: object + MicrosoftTeamsChannelInfoType: + default: ms-teams-channel-info + description: Channel info resource type. + enum: + - ms-teams-channel-info + example: ms-teams-channel-info + type: string + x-enum-varnames: + - MS_TEAMS_CHANNEL_INFO + MicrosoftTeamsCreateApiHandleRequest: + description: Create handle request. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleRequestData' + required: + - data + type: object + MicrosoftTeamsCreateApiHandleResponse: + description: Response of a handle. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleResponseData' + required: + - data + type: object + MicrosoftTeamsGetChannelByNameResponse: + description: Response with channel, team, and tenant ID information. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsChannelInfoResponseData' + type: object + MicrosoftTeamsUpdateApiHandleRequest: + description: Update handle request. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsUpdateApiHandleRequestData' + required: + - data + type: object + MicrosoftTeamsUpdateApiHandleRequestData: + description: Handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleAttributes' + type: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + required: + - type + - attributes + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -30196,6 +30514,200 @@ paths: operator: OR permissions: - gcp_configuration_edit + /api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}: + get: + description: Get the tenant, team, and channel ID of a channel in the Datadog + Microsoft Teams integration. + operationId: GetChannelByName + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsTenantNamePathParameter' + - $ref: '#/components/parameters/MicrosoftTeamsTeamNamePathParameter' + - $ref: '#/components/parameters/MicrosoftTeamsChannelNamePathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsGetChannelByNameResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get channel information by name + tags: + - Microsoft Teams Integration + /api/v2/integration/ms-teams/configuration/tenant-based-handles: + get: + description: Get a list of all handles from the Datadog Microsoft Teams integration. + operationId: ListApiHandles + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsTenantIDQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsApiHandlesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all handles + tags: + - Microsoft Teams Integration + post: + description: Create a handle in the Datadog Microsoft Teams integration. + operationId: CreateApiHandle + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsCreateApiHandleRequest' + description: Handle payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsCreateApiHandleResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create handle + tags: + - Microsoft Teams Integration + x-codegen-request-body-name: body + /api/v2/integration/ms-teams/configuration/tenant-based-handles/name/{handle_name}: + get: + description: Get the tenant, team, and channel information of a handle by name + from the Datadog Microsoft Teams integration. + operationId: GetApiHandleByName + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsHandleNamePathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get handle information by name + tags: + - Microsoft Teams Integration + /api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}: + delete: + description: Delete a handle from the Datadog Microsoft Teams integration. + operationId: DeleteApiHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete handle + tags: + - Microsoft Teams Integration + get: + description: Get the tenant, team, and channel information of a handle from + the Datadog Microsoft Teams integration. + operationId: GetApiHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get handle information + tags: + - Microsoft Teams Integration + patch: + description: Update a handle from the Datadog Microsoft Teams integration. + operationId: UpdateApiHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsUpdateApiHandleRequest' + description: Opsgenie service payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update handle + tags: + - Microsoft Teams Integration + x-codegen-request-body-name: body /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. @@ -40890,6 +41402,15 @@ tags: Tags for Metrics` permission.\n\nSee the [Metrics page](https://docs.datadoghq.com/metrics/) for more information." name: Metrics +- description: 'Configure your [Datadog Microsoft Teams integration](https://docs.datadoghq.com/integrations/microsoft_teams/) + + directly through the Datadog API. Note: These endpoints do not support legacy + connector handles.' + externalDocs: + description: For more information about the Datadog Microsoft Teams integration, + see the integration page. + url: https://docs.datadoghq.com/integrations/microsoft_teams/ + name: Microsoft Teams Integration - description: '[Monitors](https://docs.datadoghq.com/monitors) allow you to watch a metric or check that you care about and diff --git a/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.frozen new file mode 100644 index 000000000000..032d18d1ad24 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:03.835Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.yml b/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.yml new file mode 100644 index 000000000000..8fae80101d9f --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Create-api-handle-returns-CREATED-response.yml @@ -0,0 +1,40 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Create_api_handle_returns_CREATED_response-1727794143","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4d853924-8004-11ef-a396-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Create_api_handle_returns_CREATED_response-1727794143","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4d853924-8004-11ef-a396-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.frozen new file mode 100644 index 000000000000..c424a36934ca --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:04.126Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.yml b/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.yml new file mode 100644 index 000000000000..f000813ce402 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Delete-api-handle-returns-OK-response.yml @@ -0,0 +1,56 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Delete_api_handle_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4da666b2-8004-11ef-a397-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Delete_api_handle_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4da666b2-8004-11ef-a397-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4da666b2-8004-11ef-a397-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.frozen new file mode 100644 index 000000000000..e2451a0ca569 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:04.412Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.yml b/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.yml new file mode 100644 index 000000000000..5f5f1ece6f1e --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-all-api-handles-returns-OK-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_all_api_handles_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4dd2b640-8004-11ef-a398-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_all_api_handles_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f002dba-7cd2-11ef-8717-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:m2LnqTUOkhuzGCyeG_0xql4rbKc2ZSJ25JS6UZINc-01@thread.tacv2","channel_name":"General","name":"test","team_id":"008b01f1-4b68-4e81-b8a9-cfa27ba6c112","team_name":"incident-6252-is_this_a_new_title","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}},{"id":"9fc79cf6-7ffd-11ef-b391-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"TwA43H2NIrilngRZ6dOvNBVNFx4fZvPgdYaroSwcvoObDbJ8RRJtSyKCjkiV2AaVziZSfxNKrL7oV4XHAC0gDv4cuZwGzkv3hJyPGqCuUEHP89CyJMOrtkCRgCM5XeNqoK28J2todRY8ibd3S3xwIwmCK83F2bnBjVB6WEDbmO92F7B9XcIglNwPpy7KMeNRjzxy8Y3c0Ji6jYQIIMRDnawdBGWqCQmGtJ7mFPCHpYlZHKBT7uyV1gIAuGtwIr","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}},{"id":"73ffbd06-8002-11ef-af80-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"TwA43H2NIrilngRZ6dOvNBVNFx4fZvPgdYaroSwcvoObDbJ8RRJtSyKCjkiV2AaVziZSfxNKrL7oV4XHAC0gDv4cuZwGzkv3hJyPGqCuUEHP89CyJMOrtkCRgCM5XeNqoK28J2todRY8ibd3S3xwIwmCK83F2bnBjVB6WEDbmO92F7B9XcIglNwPpy7KMeNRjzxy8Y3c0Ji6jYQIIMRDnawdBGWqCQmGtJ7mFPCHpYlZHKBT7uyV1gIAuGtwI","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}},{"id":"4dd2b640-8004-11ef-a398-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"Test-Get_all_api_handles_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4dd2b640-8004-11ef-a398-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.frozen new file mode 100644 index 000000000000..f659c7f4956e --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:04.773Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.yml b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.yml new file mode 100644 index 000000000000..aad5948224a4 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-by-name-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_api_handle_information_by_name_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e084346-8004-11ef-b4b6-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_api_handle_information_by_name_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/name/Test-Get_api_handle_information_by_name_returns_OK_response-1727794144 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e084346-8004-11ef-b4b6-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"Test-Get_api_handle_information_by_name_returns_OK_response-1727794144","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 01 Oct 2024 14:49:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e084346-8004-11ef-b4b6-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.frozen new file mode 100644 index 000000000000..712c03f87986 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:05.113Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.yml b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.yml new file mode 100644 index 000000000000..8e4de717111c --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Get-api-handle-information-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_api_handle_information_returns_OK_response-1727794145","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e3c0816-8004-11ef-b813-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Get_api_handle_information_returns_OK_response-1727794145","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e3c0816-8004-11ef-b813-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e3c0816-8004-11ef-b813-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"Test-Get_api_handle_information_returns_OK_response-1727794145","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e3c0816-8004-11ef-b813-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.frozen b/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.frozen new file mode 100644 index 000000000000..af5a435fda09 --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-10-01T14:49:05.470Z \ No newline at end of file diff --git a/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.yml b/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.yml new file mode 100644 index 000000000000..4e3a63efb8dd --- /dev/null +++ b/cassettes/features/v2/microsoft_teams_integration/Update-api-handle-returns-OK-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Update_api_handle_returns_OK_response-1727794145","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e741fa8-8004-11ef-8fa4-da7ad0900002","type":"handle","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","name":"Test-Update_api_handle_returns_OK_response-1727794145","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Update_api_handle_returns_OK_response-1727794145--updated"},"type":"handle"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e741fa8-8004-11ef-8fa4-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4e741fa8-8004-11ef-8fa4-da7ad0900002","type":"ms-teams-handle-info","attributes":{"channel_id":"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2","channel_name":"General-1","name":"Test-Update_api_handle_returns_OK_response-1727794145--updated","team_id":"e5f50a58-c929-4fb3-8866-e2cd836de3c2","team_name":"Chat + Integrations","tenant_id":"4d3bac44-0230-4732-9e70-cc00736f0a97","tenant_name":"Datadog, + Inc."}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 01 Oct 2024 14:49:05 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e741fa8-8004-11ef-8fa4-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/microsoft-teams-integration/CreateApiHandle.rb b/examples/v2/microsoft-teams-integration/CreateApiHandle.rb new file mode 100644 index 000000000000..9251fa9e93d2 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/CreateApiHandle.rb @@ -0,0 +1,17 @@ +# Create handle returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +body = DatadogAPIClient::V2::MicrosoftTeamsCreateApiHandleRequest.new({ + data: DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestData.new({ + attributes: DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestAttributes.new({ + channel_id: "fake-channel-id", + name: "fake-handle-name", + team_id: "00000000-0000-0000-0000-000000000000", + tenant_id: "00000000-0000-0000-0000-000000000001", + }), + type: DatadogAPIClient::V2::MicrosoftTeamsApiHandleType::HANDLE, + }), +}) +p api_instance.create_api_handle(body) diff --git a/examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.rb b/examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.rb new file mode 100644 index 000000000000..60fac955598c --- /dev/null +++ b/examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.rb @@ -0,0 +1,17 @@ +# Create api handle returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +body = DatadogAPIClient::V2::MicrosoftTeamsCreateApiHandleRequest.new({ + data: DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestData.new({ + attributes: DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestAttributes.new({ + channel_id: "19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2", + name: "Example-Microsoft-Teams-Integration", + team_id: "e5f50a58-c929-4fb3-8866-e2cd836de3c2", + tenant_id: "4d3bac44-0230-4732-9e70-cc00736f0a97", + }), + type: DatadogAPIClient::V2::MicrosoftTeamsApiHandleType::HANDLE, + }), +}) +p api_instance.create_api_handle(body) diff --git a/examples/v2/microsoft-teams-integration/DeleteApiHandle.rb b/examples/v2/microsoft-teams-integration/DeleteApiHandle.rb new file mode 100644 index 000000000000..defd5e06a17c --- /dev/null +++ b/examples/v2/microsoft-teams-integration/DeleteApiHandle.rb @@ -0,0 +1,5 @@ +# Delete handle returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +api_instance.delete_api_handle("handle_id") diff --git a/examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.rb b/examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.rb new file mode 100644 index 000000000000..753ce60094f4 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.rb @@ -0,0 +1,8 @@ +# Delete api handle returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +# there is a valid "api_handle" in the system +API_HANDLE_DATA_ID = ENV["API_HANDLE_DATA_ID"] +api_instance.delete_api_handle(API_HANDLE_DATA_ID) diff --git a/examples/v2/microsoft-teams-integration/GetApiHandle.rb b/examples/v2/microsoft-teams-integration/GetApiHandle.rb new file mode 100644 index 000000000000..4000d92147e3 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetApiHandle.rb @@ -0,0 +1,5 @@ +# Get handle information returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +p api_instance.get_api_handle("handle_id") diff --git a/examples/v2/microsoft-teams-integration/GetApiHandleByName.rb b/examples/v2/microsoft-teams-integration/GetApiHandleByName.rb new file mode 100644 index 000000000000..994ef901e3d4 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetApiHandleByName.rb @@ -0,0 +1,5 @@ +# Get handle information by name returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +p api_instance.get_api_handle_by_name("handle_name") diff --git a/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.rb b/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.rb new file mode 100644 index 000000000000..c1dbd3934628 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.rb @@ -0,0 +1,8 @@ +# Get api handle information by name returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +# there is a valid "api_handle" in the system +API_HANDLE_DATA_ATTRIBUTES_NAME = ENV["API_HANDLE_DATA_ATTRIBUTES_NAME"] +p api_instance.get_api_handle_by_name(API_HANDLE_DATA_ATTRIBUTES_NAME) diff --git a/examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.rb b/examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.rb new file mode 100644 index 000000000000..cb3d776a554a --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.rb @@ -0,0 +1,8 @@ +# Get api handle information returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +# there is a valid "api_handle" in the system +API_HANDLE_DATA_ID = ENV["API_HANDLE_DATA_ID"] +p api_instance.get_api_handle(API_HANDLE_DATA_ID) diff --git a/examples/v2/microsoft-teams-integration/GetChannelByName.rb b/examples/v2/microsoft-teams-integration/GetChannelByName.rb new file mode 100644 index 000000000000..6c71317f512d --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetChannelByName.rb @@ -0,0 +1,5 @@ +# Get channel information by name returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +p api_instance.get_channel_by_name("tenant_name", "team_name", "channel_name") diff --git a/examples/v2/microsoft-teams-integration/ListApiHandles.rb b/examples/v2/microsoft-teams-integration/ListApiHandles.rb new file mode 100644 index 000000000000..bbe7cf9c3f6e --- /dev/null +++ b/examples/v2/microsoft-teams-integration/ListApiHandles.rb @@ -0,0 +1,5 @@ +# Get all handles returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +p api_instance.list_api_handles() diff --git a/examples/v2/microsoft-teams-integration/ListApiHandles_769592979.rb b/examples/v2/microsoft-teams-integration/ListApiHandles_769592979.rb new file mode 100644 index 000000000000..324a28d5b217 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/ListApiHandles_769592979.rb @@ -0,0 +1,5 @@ +# Get all api handles returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new +p api_instance.list_api_handles() diff --git a/examples/v2/microsoft-teams-integration/UpdateApiHandle.rb b/examples/v2/microsoft-teams-integration/UpdateApiHandle.rb new file mode 100644 index 000000000000..abd3ff4d09b5 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/UpdateApiHandle.rb @@ -0,0 +1,17 @@ +# Update handle returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +body = DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequest.new({ + data: DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequestData.new({ + attributes: DatadogAPIClient::V2::MicrosoftTeamsApiHandleAttributes.new({ + channel_id: "fake-channel-id", + name: "fake-handle-name", + team_id: "00000000-0000-0000-0000-000000000000", + tenant_id: "00000000-0000-0000-0000-000000000001", + }), + type: DatadogAPIClient::V2::MicrosoftTeamsApiHandleType::HANDLE, + }), +}) +p api_instance.update_api_handle("handle_id", body) diff --git a/examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.rb b/examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.rb new file mode 100644 index 000000000000..da99dd075469 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.rb @@ -0,0 +1,18 @@ +# Update api handle returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new + +# there is a valid "api_handle" in the system +API_HANDLE_DATA_ATTRIBUTES_NAME = ENV["API_HANDLE_DATA_ATTRIBUTES_NAME"] +API_HANDLE_DATA_ID = ENV["API_HANDLE_DATA_ID"] + +body = DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequest.new({ + data: DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequestData.new({ + attributes: DatadogAPIClient::V2::MicrosoftTeamsApiHandleAttributes.new({ + name: "fake-handle-name--updated", + }), + type: DatadogAPIClient::V2::MicrosoftTeamsApiHandleType::HANDLE, + }), +}) +p api_instance.update_api_handle(API_HANDLE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2ed472f212d6..d9f0e83a1555 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1304,6 +1304,30 @@ "v2.MakeGCPSTSDelegate" => { "body" => "Object", }, + "v2.GetChannelByName" => { + "tenant_name" => "String", + "team_name" => "String", + "channel_name" => "String", + }, + "v2.ListApiHandles" => { + "tenant_id" => "String", + }, + "v2.CreateApiHandle" => { + "body" => "MicrosoftTeamsCreateApiHandleRequest", + }, + "v2.GetApiHandleByName" => { + "handle_name" => "String", + }, + "v2.DeleteApiHandle" => { + "handle_id" => "String", + }, + "v2.GetApiHandle" => { + "handle_id" => "String", + }, + "v2.UpdateApiHandle" => { + "handle_id" => "String", + "body" => "MicrosoftTeamsUpdateApiHandleRequest", + }, "v2.CreateOpsgenieService" => { "body" => "OpsgenieServiceCreateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index 65187625d3fa..d3652a2a7578 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -212,6 +212,18 @@ "tag": "GCP Integration", "operationId": "CreateGCPSTSAccount" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"tenant_id\": \"4d3bac44-0230-4732-9e70-cc00736f0a97\",\n \"team_id\": \"e5f50a58-c929-4fb3-8866-e2cd836de3c2\",\n \"channel_id\": \"19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2\"\n },\n \"type\": \"handle\"\n }\n}" + } + ], + "step": "there is a valid \"api_handle\" in the system", + "key": "api_handle", + "tag": "Microsoft Teams Integration", + "operationId": "CreateApiHandle" + }, { "parameters": [ { diff --git a/features/v2/microsoft_teams_integration.feature b/features/v2/microsoft_teams_integration.feature new file mode 100644 index 000000000000..f1a34862f859 --- /dev/null +++ b/features/v2/microsoft_teams_integration.feature @@ -0,0 +1,271 @@ +@endpoint(microsoft-teams-integration) @endpoint(microsoft-teams-integration-v2) +Feature: Microsoft Teams Integration + Configure your [Datadog Microsoft Teams + integration](https://docs.datadoghq.com/integrations/microsoft_teams/) + directly through the Datadog API. Note: These endpoints do not support + legacy connector handles. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "MicrosoftTeamsIntegration" API + + @team:DataDog/chat-integrations + Scenario: Create api handle returns "CREATED" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2", "name": "{{unique}}", "team_id": "e5f50a58-c929-4fb3-8866-e2cd836de3c2", "tenant_id": "4d3bac44-0230-4732-9e70-cc00736f0a97"}, "type": "handle"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data.attributes.name" is equal to "{{unique}}" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create handle returns "Bad Request" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create handle returns "CREATED" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create handle returns "Conflict" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create handle returns "Failed Precondition" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create handle returns "Not Found" response + Given new "CreateApiHandle" request + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/chat-integrations + Scenario: Delete api handle returns "OK" response + Given there is a valid "api_handle" in the system + And new "DeleteApiHandle" request + And request contains "handle_id" parameter from "api_handle.data.id" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete handle returns "Bad Request" response + Given new "DeleteApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete handle returns "Failed Precondition" response + Given new "DeleteApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete handle returns "OK" response + Given new "DeleteApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @team:DataDog/chat-integrations + Scenario: Get all api handles returns "OK" response + Given there is a valid "api_handle" in the system + And new "ListApiHandles" request + When the request is sent + Then the response status is 200 OK + And the response "data[0].type" is equal to "ms-teams-handle-info" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all handles returns "Bad Request" response + Given new "ListApiHandles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all handles returns "Failed Precondition" response + Given new "ListApiHandles" request + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all handles returns "Not Found" response + Given new "ListApiHandles" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all handles returns "OK" response + Given new "ListApiHandles" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/chat-integrations + Scenario: Get api handle information by name returns "OK" response + Given there is a valid "api_handle" in the system + And new "GetApiHandleByName" request + And request contains "handle_name" parameter from "api_handle.data.attributes.name" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.channel_id" has the same value as "api_handle.data.attributes.channel_id" + And the response "data.attributes.team_id" has the same value as "api_handle.data.attributes.team_id" + And the response "data.attributes.tenant_id" has the same value as "api_handle.data.attributes.tenant_id" + + @team:DataDog/chat-integrations + Scenario: Get api handle information returns "OK" response + Given there is a valid "api_handle" in the system + And new "GetApiHandle" request + And request contains "handle_id" parameter from "api_handle.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" has the same value as "api_handle.data.attributes.name" + And the response "data.attributes.channel_id" has the same value as "api_handle.data.attributes.channel_id" + And the response "data.attributes.team_id" has the same value as "api_handle.data.attributes.team_id" + And the response "data.attributes.tenant_id" has the same value as "api_handle.data.attributes.tenant_id" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get channel information by name returns "Bad Request" response + Given new "GetChannelByName" request + And request contains "tenant_name" parameter from "REPLACE.ME" + And request contains "team_name" parameter from "REPLACE.ME" + And request contains "channel_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get channel information by name returns "Not Found" response + Given new "GetChannelByName" request + And request contains "tenant_name" parameter from "REPLACE.ME" + And request contains "team_name" parameter from "REPLACE.ME" + And request contains "channel_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get channel information by name returns "OK" response + Given new "GetChannelByName" request + And request contains "tenant_name" parameter from "REPLACE.ME" + And request contains "team_name" parameter from "REPLACE.ME" + And request contains "channel_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information by name returns "Bad Request" response + Given new "GetApiHandleByName" request + And request contains "handle_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information by name returns "Failed Precondition" response + Given new "GetApiHandleByName" request + And request contains "handle_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information by name returns "Not Found" response + Given new "GetApiHandleByName" request + And request contains "handle_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information by name returns "OK" response + Given new "GetApiHandleByName" request + And request contains "handle_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information returns "Bad Request" response + Given new "GetApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information returns "Failed Precondition" response + Given new "GetApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information returns "Not Found" response + Given new "GetApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get handle information returns "OK" response + Given new "GetApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/chat-integrations + Scenario: Update api handle returns "OK" response + Given there is a valid "api_handle" in the system + And new "UpdateApiHandle" request + And request contains "handle_id" parameter from "api_handle.data.id" + And body with value {"data": {"attributes": {"name": "{{api_handle.data.attributes.name}}--updated"}, "type": "handle"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "{{api_handle.data.attributes.name}}--updated" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update handle returns "Bad Request" response + Given new "UpdateApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update handle returns "Conflict" response + Given new "UpdateApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update handle returns "Failed Precondition" response + Given new "UpdateApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update handle returns "Not Found" response + Given new "UpdateApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update handle returns "OK" response + Given new "UpdateApiHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "handle"}} + 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 c8228c1a92e3..66c71e9fbb33 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -788,6 +788,55 @@ "type": "idempotent" } }, + "GetChannelByName": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "ListApiHandles": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "CreateApiHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "operationId": "DeleteApiHandle", + "parameters": [ + { + "name": "handle_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetApiHandleByName": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "DeleteApiHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "idempotent" + } + }, + "GetApiHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "UpdateApiHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d61e823b2477..fcd37a73368b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1777,6 +1777,24 @@ def overrides "v2.metric_type" => "MetricType", "v2.metric_volumes" => "MetricVolumes", "v2.metric_volumes_response" => "MetricVolumesResponse", + "v2.microsoft_teams_api_handle_attributes" => "MicrosoftTeamsApiHandleAttributes", + "v2.microsoft_teams_api_handle_info_response" => "MicrosoftTeamsApiHandleInfoResponse", + "v2.microsoft_teams_api_handle_info_response_attributes" => "MicrosoftTeamsApiHandleInfoResponseAttributes", + "v2.microsoft_teams_api_handle_info_response_data" => "MicrosoftTeamsApiHandleInfoResponseData", + "v2.microsoft_teams_api_handle_info_type" => "MicrosoftTeamsApiHandleInfoType", + "v2.microsoft_teams_api_handle_request_attributes" => "MicrosoftTeamsApiHandleRequestAttributes", + "v2.microsoft_teams_api_handle_request_data" => "MicrosoftTeamsApiHandleRequestData", + "v2.microsoft_teams_api_handle_response_data" => "MicrosoftTeamsApiHandleResponseData", + "v2.microsoft_teams_api_handles_response" => "MicrosoftTeamsApiHandlesResponse", + "v2.microsoft_teams_api_handle_type" => "MicrosoftTeamsApiHandleType", + "v2.microsoft_teams_channel_info_response_attributes" => "MicrosoftTeamsChannelInfoResponseAttributes", + "v2.microsoft_teams_channel_info_response_data" => "MicrosoftTeamsChannelInfoResponseData", + "v2.microsoft_teams_channel_info_type" => "MicrosoftTeamsChannelInfoType", + "v2.microsoft_teams_create_api_handle_request" => "MicrosoftTeamsCreateApiHandleRequest", + "v2.microsoft_teams_create_api_handle_response" => "MicrosoftTeamsCreateApiHandleResponse", + "v2.microsoft_teams_get_channel_by_name_response" => "MicrosoftTeamsGetChannelByNameResponse", + "v2.microsoft_teams_update_api_handle_request" => "MicrosoftTeamsUpdateApiHandleRequest", + "v2.microsoft_teams_update_api_handle_request_data" => "MicrosoftTeamsUpdateApiHandleRequestData", "v2.monitor_config_policy_attribute_create_request" => "MonitorConfigPolicyAttributeCreateRequest", "v2.monitor_config_policy_attribute_edit_request" => "MonitorConfigPolicyAttributeEditRequest", "v2.monitor_config_policy_attribute_response" => "MonitorConfigPolicyAttributeResponse", @@ -2539,6 +2557,7 @@ def overrides "v2.logs_custom_destinations_api" => "LogsCustomDestinationsAPI", "v2.logs_metrics_api" => "LogsMetricsAPI", "v2.metrics_api" => "MetricsAPI", + "v2.microsoft_teams_integration_api" => "MicrosoftTeamsIntegrationAPI", "v2.monitors_api" => "MonitorsAPI", "v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/microsoft_teams_integration_api.rb b/lib/datadog_api_client/v2/api/microsoft_teams_integration_api.rb new file mode 100644 index 000000000000..71e00be5f0f9 --- /dev/null +++ b/lib/datadog_api_client/v2/api/microsoft_teams_integration_api.rb @@ -0,0 +1,497 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class MicrosoftTeamsIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create handle. + # + # @see #create_api_handle_with_http_info + def create_api_handle(body, opts = {}) + data, _status_code, _headers = create_api_handle_with_http_info(body, opts) + data + end + + # Create handle. + # + # Create a handle in the Datadog Microsoft Teams integration. + # + # @param body [MicrosoftTeamsCreateApiHandleRequest] Handle payload. + # @param opts [Hash] the optional parameters + # @return [Array<(MicrosoftTeamsCreateApiHandleResponse, Integer, Hash)>] MicrosoftTeamsCreateApiHandleResponse data, response status code and response headers + def create_api_handle_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.create_api_handle ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MicrosoftTeamsIntegrationAPI.create_api_handle" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsCreateApiHandleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_api_handle, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#create_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete handle. + # + # @see #delete_api_handle_with_http_info + def delete_api_handle(handle_id, opts = {}) + delete_api_handle_with_http_info(handle_id, opts) + nil + end + + # Delete handle. + # + # Delete a handle from the Datadog Microsoft Teams integration. + # + # @param handle_id [String] Your handle id. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_api_handle_with_http_info(handle_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.delete_api_handle ...' + end + # verify the required parameter 'handle_id' is set + if @api_client.config.client_side_validation && handle_id.nil? + fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.delete_api_handle" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_api_handle, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#delete_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get handle information. + # + # @see #get_api_handle_with_http_info + def get_api_handle(handle_id, opts = {}) + data, _status_code, _headers = get_api_handle_with_http_info(handle_id, opts) + data + end + + # Get handle information. + # + # Get the tenant, team, and channel information of a handle from the Datadog Microsoft Teams integration. + # + # @param handle_id [String] Your handle id. + # @param opts [Hash] the optional parameters + # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers + def get_api_handle_with_http_info(handle_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_api_handle ...' + end + # verify the required parameter 'handle_id' is set + if @api_client.config.client_side_validation && handle_id.nil? + fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.get_api_handle" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsApiHandleInfoResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_api_handle, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#get_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get handle information by name. + # + # @see #get_api_handle_by_name_with_http_info + def get_api_handle_by_name(handle_name, opts = {}) + data, _status_code, _headers = get_api_handle_by_name_with_http_info(handle_name, opts) + data + end + + # Get handle information by name. + # + # Get the tenant, team, and channel information of a handle by name from the Datadog Microsoft Teams integration. + # + # @param handle_name [String] Your handle name. + # @param opts [Hash] the optional parameters + # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers + def get_api_handle_by_name_with_http_info(handle_name, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_api_handle_by_name ...' + end + # verify the required parameter 'handle_name' is set + if @api_client.config.client_side_validation && handle_name.nil? + fail ArgumentError, "Missing the required parameter 'handle_name' when calling MicrosoftTeamsIntegrationAPI.get_api_handle_by_name" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/name/{handle_name}'.sub('{handle_name}', CGI.escape(handle_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsApiHandleInfoResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_api_handle_by_name, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#get_api_handle_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get channel information by name. + # + # @see #get_channel_by_name_with_http_info + def get_channel_by_name(tenant_name, team_name, channel_name, opts = {}) + data, _status_code, _headers = get_channel_by_name_with_http_info(tenant_name, team_name, channel_name, opts) + data + end + + # Get channel information by name. + # + # Get the tenant, team, and channel ID of a channel in the Datadog Microsoft Teams integration. + # + # @param tenant_name [String] Your tenant name. + # @param team_name [String] Your team name. + # @param channel_name [String] Your channel name. + # @param opts [Hash] the optional parameters + # @return [Array<(MicrosoftTeamsGetChannelByNameResponse, Integer, Hash)>] MicrosoftTeamsGetChannelByNameResponse data, response status code and response headers + def get_channel_by_name_with_http_info(tenant_name, team_name, channel_name, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_channel_by_name ...' + end + # verify the required parameter 'tenant_name' is set + if @api_client.config.client_side_validation && tenant_name.nil? + fail ArgumentError, "Missing the required parameter 'tenant_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" + end + # verify the required parameter 'team_name' is set + if @api_client.config.client_side_validation && team_name.nil? + fail ArgumentError, "Missing the required parameter 'team_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" + end + # verify the required parameter 'channel_name' is set + if @api_client.config.client_side_validation && channel_name.nil? + fail ArgumentError, "Missing the required parameter 'channel_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}'.sub('{tenant_name}', CGI.escape(tenant_name.to_s).gsub('%2F', '/')).sub('{team_name}', CGI.escape(team_name.to_s).gsub('%2F', '/')).sub('{channel_name}', CGI.escape(channel_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsGetChannelByNameResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_channel_by_name, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#get_channel_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all handles. + # + # @see #list_api_handles_with_http_info + def list_api_handles(opts = {}) + data, _status_code, _headers = list_api_handles_with_http_info(opts) + data + end + + # Get all handles. + # + # Get a list of all handles from the Datadog Microsoft Teams integration. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :tenant_id Your tenant id. + # @return [Array<(MicrosoftTeamsApiHandlesResponse, Integer, Hash)>] MicrosoftTeamsApiHandlesResponse data, response status code and response headers + def list_api_handles_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.list_api_handles ...' + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'tenant_id'] = opts[:'tenant_id'] if !opts[:'tenant_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsApiHandlesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_api_handles, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#list_api_handles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update handle. + # + # @see #update_api_handle_with_http_info + def update_api_handle(handle_id, body, opts = {}) + data, _status_code, _headers = update_api_handle_with_http_info(handle_id, body, opts) + data + end + + # Update handle. + # + # Update a handle from the Datadog Microsoft Teams integration. + # + # @param handle_id [String] Your handle id. + # @param body [MicrosoftTeamsUpdateApiHandleRequest] Opsgenie service payload. + # @param opts [Hash] the optional parameters + # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers + def update_api_handle_with_http_info(handle_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.update_api_handle ...' + end + # verify the required parameter 'handle_id' is set + if @api_client.config.client_side_validation && handle_id.nil? + fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.update_api_handle" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MicrosoftTeamsIntegrationAPI.update_api_handle" + end + # resource path + local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MicrosoftTeamsApiHandleInfoResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_api_handle, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#update_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_attributes.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_attributes.rb new file mode 100644 index 000000000000..9a1320bc9a36 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_attributes.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle attributes. + class MicrosoftTeamsApiHandleAttributes + include BaseGenericModel + + # Channel id. + attr_reader :channel_id + + # Handle name. + attr_reader :name + + # Team id. + attr_reader :team_id + + # Tenant id. + attr_reader :tenant_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'channel_id' => :'channel_id', + :'name' => :'name', + :'team_id' => :'team_id', + :'tenant_id' => :'tenant_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'channel_id' => :'String', + :'name' => :'String', + :'team_id' => :'String', + :'tenant_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'channel_id') + self.channel_id = attributes[:'channel_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + + if attributes.key?(:'tenant_id') + self.tenant_id = attributes[:'tenant_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@channel_id.nil? && @channel_id.to_s.length > 255 + return false if !@name.nil? && @name.to_s.length > 255 + return false if !@team_id.nil? && @team_id.to_s.length > 255 + return false if !@tenant_id.nil? && @tenant_id.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param channel_id [Object] Object to be assigned + # @!visibility private + def channel_id=(channel_id) + if !channel_id.nil? && channel_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "channel_id", the character length must be smaller than or equal to 255.' + end + @channel_id = channel_id + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param team_id [Object] Object to be assigned + # @!visibility private + def team_id=(team_id) + if !team_id.nil? && team_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "team_id", the character length must be smaller than or equal to 255.' + end + @team_id = team_id + end + + # Custom attribute writer method with validation + # @param tenant_id [Object] Object to be assigned + # @!visibility private + def tenant_id=(tenant_id) + if !tenant_id.nil? && tenant_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "tenant_id", the character length must be smaller than or equal to 255.' + end + @tenant_id = tenant_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + channel_id == o.channel_id && + name == o.name && + team_id == o.team_id && + tenant_id == o.tenant_id + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [channel_id, name, team_id, tenant_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response.rb new file mode 100644 index 000000000000..7c79e5c529c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response of a handle. + class MicrosoftTeamsApiHandleInfoResponse + include BaseGenericModel + + # Handle data from a response. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsApiHandleInfoResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleInfoResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_attributes.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_attributes.rb new file mode 100644 index 000000000000..6b44138a9366 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_attributes.rb @@ -0,0 +1,249 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle attributes. + class MicrosoftTeamsApiHandleInfoResponseAttributes + include BaseGenericModel + + # Channel id. + attr_reader :channel_id + + # Channel name. + attr_reader :channel_name + + # Handle name. + attr_reader :name + + # Team id. + attr_reader :team_id + + # Team name. + attr_reader :team_name + + # Tenant id. + attr_reader :tenant_id + + # Tenant name. + attr_reader :tenant_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'channel_id' => :'channel_id', + :'channel_name' => :'channel_name', + :'name' => :'name', + :'team_id' => :'team_id', + :'team_name' => :'team_name', + :'tenant_id' => :'tenant_id', + :'tenant_name' => :'tenant_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'channel_id' => :'String', + :'channel_name' => :'String', + :'name' => :'String', + :'team_id' => :'String', + :'team_name' => :'String', + :'tenant_id' => :'String', + :'tenant_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleInfoResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'channel_id') + self.channel_id = attributes[:'channel_id'] + end + + if attributes.key?(:'channel_name') + self.channel_name = attributes[:'channel_name'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + + if attributes.key?(:'team_name') + self.team_name = attributes[:'team_name'] + end + + if attributes.key?(:'tenant_id') + self.tenant_id = attributes[:'tenant_id'] + end + + if attributes.key?(:'tenant_name') + self.tenant_name = attributes[:'tenant_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@channel_id.nil? && @channel_id.to_s.length > 255 + return false if !@channel_name.nil? && @channel_name.to_s.length > 255 + return false if !@name.nil? && @name.to_s.length > 255 + return false if !@team_id.nil? && @team_id.to_s.length > 255 + return false if !@team_name.nil? && @team_name.to_s.length > 255 + return false if !@tenant_id.nil? && @tenant_id.to_s.length > 255 + return false if !@tenant_name.nil? && @tenant_name.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param channel_id [Object] Object to be assigned + # @!visibility private + def channel_id=(channel_id) + if !channel_id.nil? && channel_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "channel_id", the character length must be smaller than or equal to 255.' + end + @channel_id = channel_id + end + + # Custom attribute writer method with validation + # @param channel_name [Object] Object to be assigned + # @!visibility private + def channel_name=(channel_name) + if !channel_name.nil? && channel_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "channel_name", the character length must be smaller than or equal to 255.' + end + @channel_name = channel_name + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param team_id [Object] Object to be assigned + # @!visibility private + def team_id=(team_id) + if !team_id.nil? && team_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "team_id", the character length must be smaller than or equal to 255.' + end + @team_id = team_id + end + + # Custom attribute writer method with validation + # @param team_name [Object] Object to be assigned + # @!visibility private + def team_name=(team_name) + if !team_name.nil? && team_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "team_name", the character length must be smaller than or equal to 255.' + end + @team_name = team_name + end + + # Custom attribute writer method with validation + # @param tenant_id [Object] Object to be assigned + # @!visibility private + def tenant_id=(tenant_id) + if !tenant_id.nil? && tenant_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "tenant_id", the character length must be smaller than or equal to 255.' + end + @tenant_id = tenant_id + end + + # Custom attribute writer method with validation + # @param tenant_name [Object] Object to be assigned + # @!visibility private + def tenant_name=(tenant_name) + if !tenant_name.nil? && tenant_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "tenant_name", the character length must be smaller than or equal to 255.' + end + @tenant_name = tenant_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + channel_id == o.channel_id && + channel_name == o.channel_name && + name == o.name && + team_id == o.team_id && + team_name == o.team_name && + tenant_id == o.tenant_id && + tenant_name == o.tenant_name + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [channel_id, channel_name, name, team_id, team_name, tenant_id, tenant_name].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_data.rb new file mode 100644 index 000000000000..cbefc5cfb2fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_response_data.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle data from a response. + class MicrosoftTeamsApiHandleInfoResponseData + include BaseGenericModel + + # Handle attributes. + attr_accessor :attributes + + # The ID of the handle. + attr_reader :id + + # Handle resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MicrosoftTeamsApiHandleInfoResponseAttributes', + :'id' => :'String', + :'type' => :'MicrosoftTeamsApiHandleInfoType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleInfoResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@id.nil? && @id.to_s.length > 100 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_type.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_type.rb new file mode 100644 index 000000000000..849b8d71f1e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_info_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle resource type. + class MicrosoftTeamsApiHandleInfoType + include BaseEnumModel + + MS_TEAMS_HANDLE_INFO = "ms-teams-handle-info".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_attributes.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_attributes.rb new file mode 100644 index 000000000000..b2efb0f30a44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_attributes.rb @@ -0,0 +1,202 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle attributes. + class MicrosoftTeamsApiHandleRequestAttributes + include BaseGenericModel + + # Channel id. + attr_reader :channel_id + + # Handle name. + attr_reader :name + + # Team id. + attr_reader :team_id + + # Tenant id. + attr_reader :tenant_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'channel_id' => :'channel_id', + :'name' => :'name', + :'team_id' => :'team_id', + :'tenant_id' => :'tenant_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'channel_id' => :'String', + :'name' => :'String', + :'team_id' => :'String', + :'tenant_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'channel_id') + self.channel_id = attributes[:'channel_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + + if attributes.key?(:'tenant_id') + self.tenant_id = attributes[:'tenant_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @channel_id.nil? + return false if @channel_id.to_s.length > 255 + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @team_id.nil? + return false if @team_id.to_s.length > 255 + return false if @tenant_id.nil? + return false if @tenant_id.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param channel_id [Object] Object to be assigned + # @!visibility private + def channel_id=(channel_id) + if channel_id.nil? + fail ArgumentError, 'invalid value for "channel_id", channel_id cannot be nil.' + end + if channel_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "channel_id", the character length must be smaller than or equal to 255.' + end + @channel_id = channel_id + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param team_id [Object] Object to be assigned + # @!visibility private + def team_id=(team_id) + if team_id.nil? + fail ArgumentError, 'invalid value for "team_id", team_id cannot be nil.' + end + if team_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "team_id", the character length must be smaller than or equal to 255.' + end + @team_id = team_id + end + + # Custom attribute writer method with validation + # @param tenant_id [Object] Object to be assigned + # @!visibility private + def tenant_id=(tenant_id) + if tenant_id.nil? + fail ArgumentError, 'invalid value for "tenant_id", tenant_id cannot be nil.' + end + if tenant_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "tenant_id", the character length must be smaller than or equal to 255.' + end + @tenant_id = tenant_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + channel_id == o.channel_id && + name == o.name && + team_id == o.team_id && + tenant_id == o.tenant_id + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [channel_id, name, team_id, tenant_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_data.rb new file mode 100644 index 000000000000..dbb3303d7851 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle data from a response. + class MicrosoftTeamsApiHandleRequestData + include BaseGenericModel + + # Handle attributes. + attr_reader :attributes + + # Specifies the handle resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MicrosoftTeamsApiHandleRequestAttributes', + :'type' => :'MicrosoftTeamsApiHandleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_response_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_response_data.rb new file mode 100644 index 000000000000..410f05d90911 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_response_data.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle data from a response. + class MicrosoftTeamsApiHandleResponseData + include BaseGenericModel + + # Handle attributes. + attr_accessor :attributes + + # The ID of the handle. + attr_reader :id + + # Specifies the handle resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MicrosoftTeamsApiHandleAttributes', + :'id' => :'String', + :'type' => :'MicrosoftTeamsApiHandleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandleResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@id.nil? && @id.to_s.length > 100 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_type.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_type.rb new file mode 100644 index 000000000000..36ca4eec7ea7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handle_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Specifies the handle resource type. + class MicrosoftTeamsApiHandleType + include BaseEnumModel + + HANDLE = "handle".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_api_handles_response.rb b/lib/datadog_api_client/v2/models/microsoft_teams_api_handles_response.rb new file mode 100644 index 000000000000..69fec72e8995 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_api_handles_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of handles. + class MicrosoftTeamsApiHandlesResponse + include BaseGenericModel + + # An array of handles. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsApiHandlesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_attributes.rb b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_attributes.rb new file mode 100644 index 000000000000..ed32b27d81f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Channel attributes. + class MicrosoftTeamsChannelInfoResponseAttributes + include BaseGenericModel + + # Indicates if this is the primary channel. + attr_reader :is_primary + + # Team id. + attr_reader :team_id + + # Tenant id. + attr_reader :tenant_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'is_primary' => :'is_primary', + :'team_id' => :'team_id', + :'tenant_id' => :'tenant_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'is_primary' => :'Boolean', + :'team_id' => :'String', + :'tenant_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsChannelInfoResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'is_primary') + self.is_primary = attributes[:'is_primary'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + + if attributes.key?(:'tenant_id') + self.tenant_id = attributes[:'tenant_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@is_primary.nil? && @is_primary.to_s.length > 255 + return false if !@team_id.nil? && @team_id.to_s.length > 255 + return false if !@tenant_id.nil? && @tenant_id.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param is_primary [Object] Object to be assigned + # @!visibility private + def is_primary=(is_primary) + if !is_primary.nil? && is_primary.to_s.length > 255 + fail ArgumentError, 'invalid value for "is_primary", the character length must be smaller than or equal to 255.' + end + @is_primary = is_primary + end + + # Custom attribute writer method with validation + # @param team_id [Object] Object to be assigned + # @!visibility private + def team_id=(team_id) + if !team_id.nil? && team_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "team_id", the character length must be smaller than or equal to 255.' + end + @team_id = team_id + end + + # Custom attribute writer method with validation + # @param tenant_id [Object] Object to be assigned + # @!visibility private + def tenant_id=(tenant_id) + if !tenant_id.nil? && tenant_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "tenant_id", the character length must be smaller than or equal to 255.' + end + @tenant_id = tenant_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + is_primary == o.is_primary && + team_id == o.team_id && + tenant_id == o.tenant_id + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [is_primary, team_id, tenant_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_data.rb new file mode 100644 index 000000000000..27b4bf1ee67c --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_response_data.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Channel data from a response. + class MicrosoftTeamsChannelInfoResponseData + include BaseGenericModel + + # Channel attributes. + attr_accessor :attributes + + # The ID of the channel. + attr_reader :id + + # Channel info resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MicrosoftTeamsChannelInfoResponseAttributes', + :'id' => :'String', + :'type' => :'MicrosoftTeamsChannelInfoType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsChannelInfoResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@id.nil? && @id.to_s.length > 255 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 255 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 255.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_type.rb b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_type.rb new file mode 100644 index 000000000000..7d8c2e6a0d5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_channel_info_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Channel info resource type. + class MicrosoftTeamsChannelInfoType + include BaseEnumModel + + MS_TEAMS_CHANNEL_INFO = "ms-teams-channel-info".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_request.rb b/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_request.rb new file mode 100644 index 000000000000..be02f5debded --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Create handle request. + class MicrosoftTeamsCreateApiHandleRequest + include BaseGenericModel + + # Handle data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsApiHandleRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsCreateApiHandleRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_response.rb b/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_response.rb new file mode 100644 index 000000000000..2a7f6a7fd5b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_create_api_handle_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response of a handle. + class MicrosoftTeamsCreateApiHandleResponse + include BaseGenericModel + + # Handle data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsApiHandleResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsCreateApiHandleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_get_channel_by_name_response.rb b/lib/datadog_api_client/v2/models/microsoft_teams_get_channel_by_name_response.rb new file mode 100644 index 000000000000..71b4faa32b30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_get_channel_by_name_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with channel, team, and tenant ID information. + class MicrosoftTeamsGetChannelByNameResponse + include BaseGenericModel + + # Channel data from a response. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsChannelInfoResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsGetChannelByNameResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request.rb b/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request.rb new file mode 100644 index 000000000000..d3ad9646c621 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update handle request. + class MicrosoftTeamsUpdateApiHandleRequest + include BaseGenericModel + + # Handle data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsUpdateApiHandleRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request_data.rb new file mode 100644 index 000000000000..e42ecb77e29a --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_update_api_handle_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Handle data from a response. + class MicrosoftTeamsUpdateApiHandleRequestData + include BaseGenericModel + + # Handle attributes. + attr_reader :attributes + + # Specifies the handle resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MicrosoftTeamsApiHandleAttributes', + :'type' => :'MicrosoftTeamsApiHandleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsUpdateApiHandleRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end