From e41fca584ae458f827922f20b65f26164fd1b40c Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:35:13 +0000 Subject: [PATCH] Edit Naming for v2 Microsoft Teams Integration Endpoints (#2722) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 335 ++++++++---------- .../api_microsoft_teams_integration.go | 169 +++------ api/datadogV2/doc.go | 11 +- ...icrosoft_teams_api_handle_info_response.go | 111 ------ ...el_microsoft_teams_api_handle_info_type.go | 64 ---- .../model_microsoft_teams_api_handle_type.go | 64 ---- ...ams_create_tenant_based_handle_request.go} | 34 +- ...t_teams_tenant_based_handle_attributes.go} | 54 +-- ..._based_handle_info_response_attributes.go} | 78 ++-- ...tenant_based_handle_info_response_data.go} | 72 ++-- ...oft_teams_tenant_based_handle_info_type.go | 64 ++++ ...tenant_based_handle_request_attributes.go} | 46 +-- ...teams_tenant_based_handle_request_data.go} | 50 +-- ...oft_teams_tenant_based_handle_response.go} | 34 +- ...eams_tenant_based_handle_response_data.go} | 72 ++-- ...icrosoft_teams_tenant_based_handle_type.go | 64 ++++ ...ft_teams_tenant_based_handles_response.go} | 34 +- ...ams_update_tenant_based_handle_request.go} | 34 +- ...pdate_tenant_based_handle_request_data.go} | 50 +-- ...piHandle.go => CreateTenantBasedHandle.go} | 16 +- ... => CreateTenantBasedHandle_1540689753.go} | 14 +- ...piHandle.go => DeleteTenantBasedHandle.go} | 6 +- ...o => DeleteTenantBasedHandle_377884154.go} | 8 +- .../GetApiHandleByName_1103107145.go | 32 -- ...andleByName.go => GetTenantBasedHandle.go} | 8 +- ....go => GetTenantBasedHandle_2883785101.go} | 10 +- .../ListApiHandles.go | 29 -- ...ApiHandle.go => ListTenantBasedHandles.go} | 8 +- ...go => ListTenantBasedHandles_769592979.go} | 6 +- ...piHandle.go => UpdateTenantBasedHandle.go} | 16 +- ...o => UpdateTenantBasedHandle_419892746.go} | 18 +- ...api_handle_returns_CREATED_response.freeze | 1 - ...e_api_handle_returns_CREATED_response.yaml | 37 -- ...lete_api_handle_returns_OK_response.freeze | 1 - ...Delete_api_handle_returns_OK_response.yaml | 52 --- ...all_api_handles_returns_OK_response.freeze | 1 - ...t_all_api_handles_returns_OK_response.yaml | 61 ---- ...rmation_by_name_returns_OK_response.freeze | 1 - ...formation_by_name_returns_OK_response.yaml | 56 --- ...dle_information_returns_OK_response.freeze | 1 - ...andle_information_returns_OK_response.yaml | 56 --- ...date_api_handle_returns_OK_response.freeze | 1 - ...Update_api_handle_returns_OK_response.yaml | 59 --- tests/scenarios/features/v2/given.json | 8 +- .../v2/microsoft_teams_integration.feature | 193 ++++------ tests/scenarios/features/v2/undo.json | 18 +- 47 files changed, 764 insertions(+), 1401 deletions(-) delete mode 100644 api/datadogV2/model_microsoft_teams_api_handle_info_response.go delete mode 100644 api/datadogV2/model_microsoft_teams_api_handle_info_type.go delete mode 100644 api/datadogV2/model_microsoft_teams_api_handle_type.go rename api/datadogV2/{model_microsoft_teams_update_api_handle_request.go => model_microsoft_teams_create_tenant_based_handle_request.go} (61%) rename api/datadogV2/{model_microsoft_teams_api_handle_attributes.go => model_microsoft_teams_tenant_based_handle_attributes.go} (69%) rename api/datadogV2/{model_microsoft_teams_api_handle_info_response_attributes.go => model_microsoft_teams_tenant_based_handle_info_response_attributes.go} (67%) rename api/datadogV2/{model_microsoft_teams_api_handle_info_response_data.go => model_microsoft_teams_tenant_based_handle_info_response_data.go} (53%) create mode 100644 api/datadogV2/model_microsoft_teams_tenant_based_handle_info_type.go rename api/datadogV2/{model_microsoft_teams_api_handle_request_attributes.go => model_microsoft_teams_tenant_based_handle_request_attributes.go} (66%) rename api/datadogV2/{model_microsoft_teams_api_handle_request_data.go => model_microsoft_teams_tenant_based_handle_request_data.go} (57%) rename api/datadogV2/{model_microsoft_teams_create_api_handle_response.go => model_microsoft_teams_tenant_based_handle_response.go} (62%) rename api/datadogV2/{model_microsoft_teams_api_handle_response_data.go => model_microsoft_teams_tenant_based_handle_response_data.go} (55%) create mode 100644 api/datadogV2/model_microsoft_teams_tenant_based_handle_type.go rename api/datadogV2/{model_microsoft_teams_api_handles_response.go => model_microsoft_teams_tenant_based_handles_response.go} (59%) rename api/datadogV2/{model_microsoft_teams_create_api_handle_request.go => model_microsoft_teams_update_tenant_based_handle_request.go} (60%) rename api/datadogV2/{model_microsoft_teams_update_api_handle_request_data.go => model_microsoft_teams_update_tenant_based_handle_request_data.go} (57%) rename examples/v2/microsoft-teams-integration/{CreateApiHandle.go => CreateTenantBasedHandle.go} (63%) rename examples/v2/microsoft-teams-integration/{CreateApiHandle_1540689753.go => CreateTenantBasedHandle_1540689753.go} (69%) rename examples/v2/microsoft-teams-integration/{DeleteApiHandle.go => DeleteTenantBasedHandle.go} (77%) rename examples/v2/microsoft-teams-integration/{DeleteApiHandle_377884154.go => DeleteTenantBasedHandle_377884154.go} (70%) delete mode 100644 examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.go rename examples/v2/microsoft-teams-integration/{GetApiHandleByName.go => GetTenantBasedHandle.go} (75%) rename examples/v2/microsoft-teams-integration/{GetApiHandle_2883785101.go => GetTenantBasedHandle_2883785101.go} (71%) delete mode 100644 examples/v2/microsoft-teams-integration/ListApiHandles.go rename examples/v2/microsoft-teams-integration/{GetApiHandle.go => ListTenantBasedHandles.go} (72%) rename examples/v2/microsoft-teams-integration/{ListApiHandles_769592979.go => ListTenantBasedHandles_769592979.go} (77%) rename examples/v2/microsoft-teams-integration/{UpdateApiHandle.go => UpdateTenantBasedHandle.go} (65%) rename examples/v2/microsoft-teams-integration/{UpdateApiHandle_419892746.go => UpdateTenantBasedHandle_419892746.go} (57%) delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.yaml diff --git a/.apigentools-info b/.apigentools-info index 3aaf1f302db..0191cc68ae3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-03 13:53:52.224483", - "spec_repo_commit": "2c46d95c" + "regenerated": "2024-10-03 16:37:43.183470", + "spec_repo_commit": "ef194005" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-03 13:53:52.241054", - "spec_repo_commit": "2c46d95c" + "regenerated": "2024-10-03 16:37:43.198257", + "spec_repo_commit": "ef194005" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 0b749be5074..5233ad64ba8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -458,24 +458,24 @@ components: required: true schema: type: string - MicrosoftTeamsHandleIDPathParameter: - description: Your handle id. - in: path - name: handle_id - required: true + MicrosoftTeamsHandleNameQueryParameter: + description: Your tenant-based handle name. + in: query + name: name + required: false schema: type: string - MicrosoftTeamsHandleNamePathParameter: - description: Your handle name. + MicrosoftTeamsTeamNamePathParameter: + description: Your team name. in: path - name: handle_name + name: team_name required: true schema: type: string - MicrosoftTeamsTeamNamePathParameter: - description: Your team name. + MicrosoftTeamsTenantBasedHandleIDPathParameter: + description: Your tenant-based handle id. in: path - name: team_name + name: handle_id required: true schema: type: string @@ -14840,8 +14840,64 @@ components: - data_source - query type: object - MicrosoftTeamsApiHandleAttributes: - description: Handle attributes. + 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 + MicrosoftTeamsCreateTenantBasedHandleRequest: + description: Create tenant-based handle request. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleRequestData' + required: + - data + type: object + MicrosoftTeamsGetChannelByNameResponse: + description: Response with channel, team, and tenant ID information. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsChannelInfoResponseData' + type: object + MicrosoftTeamsTenantBasedHandleAttributes: + description: Tenant-based handle attributes. properties: channel_id: description: Channel id. @@ -14849,7 +14905,7 @@ components: maxLength: 255 type: string name: - description: Handle name. + description: Tenant-based handle name. example: fake-handle-name maxLength: 255 type: string @@ -14864,14 +14920,8 @@ components: maxLength: 255 type: string type: object - MicrosoftTeamsApiHandleInfoResponse: - description: Response of a handle. - properties: - data: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseData' - type: object - MicrosoftTeamsApiHandleInfoResponseAttributes: - description: Handle attributes. + MicrosoftTeamsTenantBasedHandleInfoResponseAttributes: + description: Tenant-based handle attributes. properties: channel_id: description: Channel id. @@ -14884,7 +14934,7 @@ components: maxLength: 255 type: string name: - description: Handle name. + description: Tenant-based handle name. example: fake-handle-name maxLength: 255 type: string @@ -14909,31 +14959,31 @@ components: maxLength: 255 type: string type: object - MicrosoftTeamsApiHandleInfoResponseData: - description: Handle data from a response. + MicrosoftTeamsTenantBasedHandleInfoResponseData: + description: Tenant-based handle data from a response. properties: attributes: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseAttributes' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleInfoResponseAttributes' id: - description: The ID of the handle. + description: The ID of the tenant-based handle. example: 596da4af-0563-4097-90ff-07230c3f9db3 maxLength: 100 minLength: 1 type: string type: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoType' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleInfoType' type: object - MicrosoftTeamsApiHandleInfoType: - default: ms-teams-handle-info - description: Handle resource type. + MicrosoftTeamsTenantBasedHandleInfoType: + default: ms-teams-tenant-based-handle-info + description: Tenant-based handle resource type. enum: - - ms-teams-handle-info - example: ms-teams-handle-info + - ms-teams-tenant-based-handle-info + example: ms-teams-tenant-based-handle-info type: string x-enum-varnames: - - MS_TEAMS_HANDLE_INFO - MicrosoftTeamsApiHandleRequestAttributes: - description: Handle attributes. + - MS_TEAMS_TENANT_BASED_HANDLE_INFO + MicrosoftTeamsTenantBasedHandleRequestAttributes: + description: Tenant-based handle attributes. properties: channel_id: description: Channel id. @@ -14941,7 +14991,7 @@ components: maxLength: 255 type: string name: - description: Handle name. + description: Tenant-based handle name. example: fake-handle-name maxLength: 255 type: string @@ -14961,45 +15011,53 @@ components: - team_id - tenant_id type: object - MicrosoftTeamsApiHandleRequestData: - description: Handle data from a response. + MicrosoftTeamsTenantBasedHandleRequestData: + description: Tenant-based handle data from a response. properties: attributes: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleRequestAttributes' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleRequestAttributes' type: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleType' required: - type - attributes type: object - MicrosoftTeamsApiHandleResponseData: - description: Handle data from a response. + MicrosoftTeamsTenantBasedHandleResponse: + description: Response of a tenant-based handle. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleResponseData' + required: + - data + type: object + MicrosoftTeamsTenantBasedHandleResponseData: + description: Tenant-based handle data from a response. properties: attributes: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleAttributes' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleAttributes' id: - description: The ID of the handle. + description: The ID of the tenant-based handle. example: 596da4af-0563-4097-90ff-07230c3f9db3 maxLength: 100 minLength: 1 type: string type: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleType' type: object - MicrosoftTeamsApiHandleType: - default: handle - description: Specifies the handle resource type. + MicrosoftTeamsTenantBasedHandleType: + default: tenant-based-handle + description: Specifies the tenant-based handle resource type. enum: - - handle - example: handle + - tenant-based-handle + example: tenant-based-handle type: string x-enum-varnames: - - HANDLE - MicrosoftTeamsApiHandlesResponse: - description: Response with a list of handles. + - TENANT_BASED_HANDLE + MicrosoftTeamsTenantBasedHandlesResponse: + description: Response with a list of tenant-based handles. properties: data: - description: An array of handles. + description: An array of tenant-based handles. example: - attributes: channelId: 19:b41k24b14bn1nwffkernfkwrnfneubgkr@thread.tacv2 @@ -15010,7 +15068,7 @@ components: tenantId: 00000000-0000-0000-0000-000000000001 tenantName: Company, Inc. id: 596da4af-0563-4097-90ff-07230c3f9db3 - type: ms-teams-handle-info + type: ms-teams-tenant-based-handle-info - attributes: channelId: 19:b41k24b14bn1nwffkernfkwrnfneubgk1@thread.tacv2 channelName: General2 @@ -15020,92 +15078,28 @@ components: tenantId: 00000000-0000-0000-0000-000000000003 tenantName: Company, Inc. id: 596da4af-0563-4097-90ff-07230c3f9db4 - type: ms-teams-handle-info + type: ms-teams-tenant-based-handle-info items: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponseData' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleInfoResponseData' 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. + MicrosoftTeamsUpdateTenantBasedHandleRequest: + description: Update tenant-based handle request. properties: data: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleResponseData' + $ref: '#/components/schemas/MicrosoftTeamsUpdateTenantBasedHandleRequestData' 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. + MicrosoftTeamsUpdateTenantBasedHandleRequestData: + description: Tenant-based handle data from a response. properties: attributes: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleAttributes' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleAttributes' type: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleType' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleType' required: - type - attributes @@ -30574,16 +30568,18 @@ paths: - 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 + description: Get a list of all tenant-based handles from the Datadog Microsoft + Teams integration. + operationId: ListTenantBasedHandles parameters: - $ref: '#/components/parameters/MicrosoftTeamsTenantIDQueryParameter' + - $ref: '#/components/parameters/MicrosoftTeamsHandleNameQueryParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsApiHandlesResponse' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandlesResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' @@ -30595,25 +30591,25 @@ paths: $ref: '#/components/responses/PreconditionFailedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get all handles + summary: Get all tenant-based handles tags: - Microsoft Teams Integration post: - description: Create a handle in the Datadog Microsoft Teams integration. - operationId: CreateApiHandle + description: Create a tenant-based handle in the Datadog Microsoft Teams integration. + operationId: CreateTenantBasedHandle requestBody: content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsCreateApiHandleRequest' - description: Handle payload. + $ref: '#/components/schemas/MicrosoftTeamsCreateTenantBasedHandleRequest' + description: Tenant-based handle payload. required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsCreateApiHandleResponse' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleResponse' description: CREATED '400': $ref: '#/components/responses/BadRequestResponse' @@ -30627,43 +30623,16 @@ paths: $ref: '#/components/responses/PreconditionFailedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create handle + summary: Create tenant-based 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 + description: Delete a tenant-based handle from the Datadog Microsoft Teams integration. + operationId: DeleteTenantBasedHandle parameters: - - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + - $ref: '#/components/parameters/MicrosoftTeamsTenantBasedHandleIDPathParameter' responses: '204': description: OK @@ -30675,21 +30644,21 @@ paths: $ref: '#/components/responses/PreconditionFailedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete handle + summary: Delete tenant-based 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 + description: Get the tenant, team, and channel information of a tenant-based + handle from the Datadog Microsoft Teams integration. + operationId: GetTenantBasedHandle parameters: - - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + - $ref: '#/components/parameters/MicrosoftTeamsTenantBasedHandleIDPathParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponse' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' @@ -30701,27 +30670,27 @@ paths: $ref: '#/components/responses/PreconditionFailedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get handle information + summary: Get tenant-based handle information tags: - Microsoft Teams Integration patch: - description: Update a handle from the Datadog Microsoft Teams integration. - operationId: UpdateApiHandle + description: Update a tenant-based handle from the Datadog Microsoft Teams integration. + operationId: UpdateTenantBasedHandle parameters: - - $ref: '#/components/parameters/MicrosoftTeamsHandleIDPathParameter' + - $ref: '#/components/parameters/MicrosoftTeamsTenantBasedHandleIDPathParameter' requestBody: content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsUpdateApiHandleRequest' - description: Opsgenie service payload. + $ref: '#/components/schemas/MicrosoftTeamsUpdateTenantBasedHandleRequest' + description: Tenant-based handle payload. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MicrosoftTeamsApiHandleInfoResponse' + $ref: '#/components/schemas/MicrosoftTeamsTenantBasedHandleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' @@ -30735,7 +30704,7 @@ paths: $ref: '#/components/responses/PreconditionFailedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Update handle + summary: Update tenant-based handle tags: - Microsoft Teams Integration x-codegen-request-body-name: body diff --git a/api/datadogV2/api_microsoft_teams_integration.go b/api/datadogV2/api_microsoft_teams_integration.go index ae26bc290a3..a074189eea8 100644 --- a/api/datadogV2/api_microsoft_teams_integration.go +++ b/api/datadogV2/api_microsoft_teams_integration.go @@ -16,16 +16,16 @@ import ( // MicrosoftTeamsIntegrationApi service type type MicrosoftTeamsIntegrationApi datadog.Service -// CreateApiHandle Create handle. -// Create a handle in the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) CreateApiHandle(ctx _context.Context, body MicrosoftTeamsCreateApiHandleRequest) (MicrosoftTeamsCreateApiHandleResponse, *_nethttp.Response, error) { +// CreateTenantBasedHandle Create tenant-based handle. +// Create a tenant-based handle in the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) CreateTenantBasedHandle(ctx _context.Context, body MicrosoftTeamsCreateTenantBasedHandleRequest) (MicrosoftTeamsTenantBasedHandleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsCreateApiHandleResponse + localVarReturnValue MicrosoftTeamsTenantBasedHandleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.CreateApiHandle") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -89,15 +89,15 @@ func (a *MicrosoftTeamsIntegrationApi) CreateApiHandle(ctx _context.Context, bod return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteApiHandle Delete handle. -// Delete a handle from the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) DeleteApiHandle(ctx _context.Context, handleId string) (*_nethttp.Response, error) { +// DeleteTenantBasedHandle Delete tenant-based handle. +// Delete a tenant-based handle from the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) DeleteTenantBasedHandle(ctx _context.Context, handleId string) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.DeleteApiHandle") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.DeleteTenantBasedHandle") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -150,22 +150,24 @@ func (a *MicrosoftTeamsIntegrationApi) DeleteApiHandle(ctx _context.Context, han return localVarHTTPResponse, nil } -// GetApiHandle Get handle information. -// Get the tenant, team, and channel information of a handle from the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) GetApiHandle(ctx _context.Context, handleId string) (MicrosoftTeamsApiHandleInfoResponse, *_nethttp.Response, error) { +// GetChannelByName Get channel information by name. +// Get the tenant, team, and channel ID of a channel in the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) GetChannelByName(ctx _context.Context, tenantName string, teamName string, channelName string) (MicrosoftTeamsGetChannelByNameResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsApiHandleInfoResponse + localVarReturnValue MicrosoftTeamsGetChannelByNameResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.GetApiHandle") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.GetChannelByName") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}" - localVarPath = strings.Replace(localVarPath, "{"+"handle_id"+"}", _neturl.PathEscape(datadog.ParameterToString(handleId, "")), -1) + localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_name"+"}", _neturl.PathEscape(datadog.ParameterToString(tenantName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"team_name"+"}", _neturl.PathEscape(datadog.ParameterToString(teamName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -198,7 +200,7 @@ func (a *MicrosoftTeamsIntegrationApi) GetApiHandle(ctx _context.Context, handle ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 412 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -221,22 +223,22 @@ func (a *MicrosoftTeamsIntegrationApi) GetApiHandle(ctx _context.Context, handle return localVarReturnValue, localVarHTTPResponse, nil } -// GetApiHandleByName Get handle information by name. -// Get the tenant, team, and channel information of a handle by name from the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) GetApiHandleByName(ctx _context.Context, handleName string) (MicrosoftTeamsApiHandleInfoResponse, *_nethttp.Response, error) { +// GetTenantBasedHandle Get tenant-based handle information. +// Get the tenant, team, and channel information of a tenant-based handle from the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) GetTenantBasedHandle(ctx _context.Context, handleId string) (MicrosoftTeamsTenantBasedHandleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsApiHandleInfoResponse + localVarReturnValue MicrosoftTeamsTenantBasedHandleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.GetApiHandleByName") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.GetTenantBasedHandle") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/name/{handle_name}" - localVarPath = strings.Replace(localVarPath, "{"+"handle_name"+"}", _neturl.PathEscape(datadog.ParameterToString(handleName, "")), -1) + localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}" + localVarPath = strings.Replace(localVarPath, "{"+"handle_id"+"}", _neturl.PathEscape(datadog.ParameterToString(handleId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -292,114 +294,48 @@ func (a *MicrosoftTeamsIntegrationApi) GetApiHandleByName(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } -// GetChannelByName Get channel information by name. -// Get the tenant, team, and channel ID of a channel in the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) GetChannelByName(ctx _context.Context, tenantName string, teamName string, channelName string) (MicrosoftTeamsGetChannelByNameResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsGetChannelByNameResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.GetChannelByName") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}" - localVarPath = strings.Replace(localVarPath, "{"+"tenant_name"+"}", _neturl.PathEscape(datadog.ParameterToString(tenantName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"team_name"+"}", _neturl.PathEscape(datadog.ParameterToString(teamName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// ListApiHandlesOptionalParameters holds optional parameters for ListApiHandles. -type ListApiHandlesOptionalParameters struct { +// ListTenantBasedHandlesOptionalParameters holds optional parameters for ListTenantBasedHandles. +type ListTenantBasedHandlesOptionalParameters struct { TenantId *string + Name *string } -// NewListApiHandlesOptionalParameters creates an empty struct for parameters. -func NewListApiHandlesOptionalParameters() *ListApiHandlesOptionalParameters { - this := ListApiHandlesOptionalParameters{} +// NewListTenantBasedHandlesOptionalParameters creates an empty struct for parameters. +func NewListTenantBasedHandlesOptionalParameters() *ListTenantBasedHandlesOptionalParameters { + this := ListTenantBasedHandlesOptionalParameters{} return &this } // WithTenantId sets the corresponding parameter name and returns the struct. -func (r *ListApiHandlesOptionalParameters) WithTenantId(tenantId string) *ListApiHandlesOptionalParameters { +func (r *ListTenantBasedHandlesOptionalParameters) WithTenantId(tenantId string) *ListTenantBasedHandlesOptionalParameters { r.TenantId = &tenantId return r } -// ListApiHandles Get all handles. -// Get a list of all handles from the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) ListApiHandles(ctx _context.Context, o ...ListApiHandlesOptionalParameters) (MicrosoftTeamsApiHandlesResponse, *_nethttp.Response, error) { +// WithName sets the corresponding parameter name and returns the struct. +func (r *ListTenantBasedHandlesOptionalParameters) WithName(name string) *ListTenantBasedHandlesOptionalParameters { + r.Name = &name + return r +} + +// ListTenantBasedHandles Get all tenant-based handles. +// Get a list of all tenant-based handles from the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) ListTenantBasedHandles(ctx _context.Context, o ...ListTenantBasedHandlesOptionalParameters) (MicrosoftTeamsTenantBasedHandlesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsApiHandlesResponse - optionalParams ListApiHandlesOptionalParameters + localVarReturnValue MicrosoftTeamsTenantBasedHandlesResponse + optionalParams ListTenantBasedHandlesOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListApiHandlesOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListTenantBasedHandlesOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.ListApiHandles") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.ListTenantBasedHandles") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -412,6 +348,9 @@ func (a *MicrosoftTeamsIntegrationApi) ListApiHandles(ctx _context.Context, o .. if optionalParams.TenantId != nil { localVarQueryParams.Add("tenant_id", datadog.ParameterToString(*optionalParams.TenantId, "")) } + if optionalParams.Name != nil { + localVarQueryParams.Add("name", datadog.ParameterToString(*optionalParams.Name, "")) + } localVarHeaderParams["Accept"] = "application/json" datadog.SetAuthKeys( @@ -463,16 +402,16 @@ func (a *MicrosoftTeamsIntegrationApi) ListApiHandles(ctx _context.Context, o .. return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateApiHandle Update handle. -// Update a handle from the Datadog Microsoft Teams integration. -func (a *MicrosoftTeamsIntegrationApi) UpdateApiHandle(ctx _context.Context, handleId string, body MicrosoftTeamsUpdateApiHandleRequest) (MicrosoftTeamsApiHandleInfoResponse, *_nethttp.Response, error) { +// UpdateTenantBasedHandle Update tenant-based handle. +// Update a tenant-based handle from the Datadog Microsoft Teams integration. +func (a *MicrosoftTeamsIntegrationApi) UpdateTenantBasedHandle(ctx _context.Context, handleId string, body MicrosoftTeamsUpdateTenantBasedHandleRequest) (MicrosoftTeamsTenantBasedHandleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarReturnValue MicrosoftTeamsApiHandleInfoResponse + localVarReturnValue MicrosoftTeamsTenantBasedHandleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.UpdateApiHandle") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index bac7fb034ce..8a27584b8b8 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -197,13 +197,12 @@ // - [MetricsApi.QueryTimeseriesData] // - [MetricsApi.SubmitMetrics] // - [MetricsApi.UpdateTagConfiguration] -// - [MicrosoftTeamsIntegrationApi.CreateApiHandle] -// - [MicrosoftTeamsIntegrationApi.DeleteApiHandle] -// - [MicrosoftTeamsIntegrationApi.GetApiHandle] -// - [MicrosoftTeamsIntegrationApi.GetApiHandleByName] +// - [MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle] +// - [MicrosoftTeamsIntegrationApi.DeleteTenantBasedHandle] // - [MicrosoftTeamsIntegrationApi.GetChannelByName] -// - [MicrosoftTeamsIntegrationApi.ListApiHandles] -// - [MicrosoftTeamsIntegrationApi.UpdateApiHandle] +// - [MicrosoftTeamsIntegrationApi.GetTenantBasedHandle] +// - [MicrosoftTeamsIntegrationApi.ListTenantBasedHandles] +// - [MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle] // - [MonitorsApi.CreateMonitorConfigPolicy] // - [MonitorsApi.DeleteMonitorConfigPolicy] // - [MonitorsApi.GetMonitorConfigPolicy] diff --git a/api/datadogV2/model_microsoft_teams_api_handle_info_response.go b/api/datadogV2/model_microsoft_teams_api_handle_info_response.go deleted file mode 100644 index 9a6075aef9a..00000000000 --- a/api/datadogV2/model_microsoft_teams_api_handle_info_response.go +++ /dev/null @@ -1,111 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// MicrosoftTeamsApiHandleInfoResponse Response of a handle. -type MicrosoftTeamsApiHandleInfoResponse struct { - // Handle data from a response. - Data *MicrosoftTeamsApiHandleInfoResponseData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewMicrosoftTeamsApiHandleInfoResponse instantiates a new MicrosoftTeamsApiHandleInfoResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleInfoResponse() *MicrosoftTeamsApiHandleInfoResponse { - this := MicrosoftTeamsApiHandleInfoResponse{} - return &this -} - -// NewMicrosoftTeamsApiHandleInfoResponseWithDefaults instantiates a new MicrosoftTeamsApiHandleInfoResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleInfoResponseWithDefaults() *MicrosoftTeamsApiHandleInfoResponse { - this := MicrosoftTeamsApiHandleInfoResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponse) GetData() MicrosoftTeamsApiHandleInfoResponseData { - if o == nil || o.Data == nil { - var ret MicrosoftTeamsApiHandleInfoResponseData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponse) GetDataOk() (*MicrosoftTeamsApiHandleInfoResponseData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given MicrosoftTeamsApiHandleInfoResponseData and assigns it to the Data field. -func (o *MicrosoftTeamsApiHandleInfoResponse) SetData(v MicrosoftTeamsApiHandleInfoResponseData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleInfoResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *MicrosoftTeamsApiHandleInfoResponseData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_microsoft_teams_api_handle_info_type.go b/api/datadogV2/model_microsoft_teams_api_handle_info_type.go deleted file mode 100644 index 3e112052f94..00000000000 --- a/api/datadogV2/model_microsoft_teams_api_handle_info_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// MicrosoftTeamsApiHandleInfoType Handle resource type. -type MicrosoftTeamsApiHandleInfoType string - -// List of MicrosoftTeamsApiHandleInfoType. -const ( - MICROSOFTTEAMSAPIHANDLEINFOTYPE_MS_TEAMS_HANDLE_INFO MicrosoftTeamsApiHandleInfoType = "ms-teams-handle-info" -) - -var allowedMicrosoftTeamsApiHandleInfoTypeEnumValues = []MicrosoftTeamsApiHandleInfoType{ - MICROSOFTTEAMSAPIHANDLEINFOTYPE_MS_TEAMS_HANDLE_INFO, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *MicrosoftTeamsApiHandleInfoType) GetAllowedValues() []MicrosoftTeamsApiHandleInfoType { - return allowedMicrosoftTeamsApiHandleInfoTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *MicrosoftTeamsApiHandleInfoType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = MicrosoftTeamsApiHandleInfoType(value) - return nil -} - -// NewMicrosoftTeamsApiHandleInfoTypeFromValue returns a pointer to a valid MicrosoftTeamsApiHandleInfoType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewMicrosoftTeamsApiHandleInfoTypeFromValue(v string) (*MicrosoftTeamsApiHandleInfoType, error) { - ev := MicrosoftTeamsApiHandleInfoType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for MicrosoftTeamsApiHandleInfoType: valid values are %v", v, allowedMicrosoftTeamsApiHandleInfoTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v MicrosoftTeamsApiHandleInfoType) IsValid() bool { - for _, existing := range allowedMicrosoftTeamsApiHandleInfoTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to MicrosoftTeamsApiHandleInfoType value. -func (v MicrosoftTeamsApiHandleInfoType) Ptr() *MicrosoftTeamsApiHandleInfoType { - return &v -} diff --git a/api/datadogV2/model_microsoft_teams_api_handle_type.go b/api/datadogV2/model_microsoft_teams_api_handle_type.go deleted file mode 100644 index 12fb4ea357c..00000000000 --- a/api/datadogV2/model_microsoft_teams_api_handle_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// MicrosoftTeamsApiHandleType Specifies the handle resource type. -type MicrosoftTeamsApiHandleType string - -// List of MicrosoftTeamsApiHandleType. -const ( - MICROSOFTTEAMSAPIHANDLETYPE_HANDLE MicrosoftTeamsApiHandleType = "handle" -) - -var allowedMicrosoftTeamsApiHandleTypeEnumValues = []MicrosoftTeamsApiHandleType{ - MICROSOFTTEAMSAPIHANDLETYPE_HANDLE, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *MicrosoftTeamsApiHandleType) GetAllowedValues() []MicrosoftTeamsApiHandleType { - return allowedMicrosoftTeamsApiHandleTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *MicrosoftTeamsApiHandleType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = MicrosoftTeamsApiHandleType(value) - return nil -} - -// NewMicrosoftTeamsApiHandleTypeFromValue returns a pointer to a valid MicrosoftTeamsApiHandleType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewMicrosoftTeamsApiHandleTypeFromValue(v string) (*MicrosoftTeamsApiHandleType, error) { - ev := MicrosoftTeamsApiHandleType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for MicrosoftTeamsApiHandleType: valid values are %v", v, allowedMicrosoftTeamsApiHandleTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v MicrosoftTeamsApiHandleType) IsValid() bool { - for _, existing := range allowedMicrosoftTeamsApiHandleTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to MicrosoftTeamsApiHandleType value. -func (v MicrosoftTeamsApiHandleType) Ptr() *MicrosoftTeamsApiHandleType { - return &v -} diff --git a/api/datadogV2/model_microsoft_teams_update_api_handle_request.go b/api/datadogV2/model_microsoft_teams_create_tenant_based_handle_request.go similarity index 61% rename from api/datadogV2/model_microsoft_teams_update_api_handle_request.go rename to api/datadogV2/model_microsoft_teams_create_tenant_based_handle_request.go index 8c7b4b79dcb..4d080f90ffe 100644 --- a/api/datadogV2/model_microsoft_teams_update_api_handle_request.go +++ b/api/datadogV2/model_microsoft_teams_create_tenant_based_handle_request.go @@ -10,37 +10,37 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsUpdateApiHandleRequest Update handle request. -type MicrosoftTeamsUpdateApiHandleRequest struct { - // Handle data from a response. - Data MicrosoftTeamsUpdateApiHandleRequestData `json:"data"` +// MicrosoftTeamsCreateTenantBasedHandleRequest Create tenant-based handle request. +type MicrosoftTeamsCreateTenantBasedHandleRequest struct { + // Tenant-based handle data from a response. + Data MicrosoftTeamsTenantBasedHandleRequestData `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsUpdateApiHandleRequest instantiates a new MicrosoftTeamsUpdateApiHandleRequest object. +// NewMicrosoftTeamsCreateTenantBasedHandleRequest instantiates a new MicrosoftTeamsCreateTenantBasedHandleRequest object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsUpdateApiHandleRequest(data MicrosoftTeamsUpdateApiHandleRequestData) *MicrosoftTeamsUpdateApiHandleRequest { - this := MicrosoftTeamsUpdateApiHandleRequest{} +func NewMicrosoftTeamsCreateTenantBasedHandleRequest(data MicrosoftTeamsTenantBasedHandleRequestData) *MicrosoftTeamsCreateTenantBasedHandleRequest { + this := MicrosoftTeamsCreateTenantBasedHandleRequest{} this.Data = data return &this } -// NewMicrosoftTeamsUpdateApiHandleRequestWithDefaults instantiates a new MicrosoftTeamsUpdateApiHandleRequest object. +// NewMicrosoftTeamsCreateTenantBasedHandleRequestWithDefaults instantiates a new MicrosoftTeamsCreateTenantBasedHandleRequest object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsUpdateApiHandleRequestWithDefaults() *MicrosoftTeamsUpdateApiHandleRequest { - this := MicrosoftTeamsUpdateApiHandleRequest{} +func NewMicrosoftTeamsCreateTenantBasedHandleRequestWithDefaults() *MicrosoftTeamsCreateTenantBasedHandleRequest { + this := MicrosoftTeamsCreateTenantBasedHandleRequest{} return &this } // GetData returns the Data field value. -func (o *MicrosoftTeamsUpdateApiHandleRequest) GetData() MicrosoftTeamsUpdateApiHandleRequestData { +func (o *MicrosoftTeamsCreateTenantBasedHandleRequest) GetData() MicrosoftTeamsTenantBasedHandleRequestData { if o == nil { - var ret MicrosoftTeamsUpdateApiHandleRequestData + var ret MicrosoftTeamsTenantBasedHandleRequestData return ret } return o.Data @@ -48,7 +48,7 @@ func (o *MicrosoftTeamsUpdateApiHandleRequest) GetData() MicrosoftTeamsUpdateApi // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsUpdateApiHandleRequest) GetDataOk() (*MicrosoftTeamsUpdateApiHandleRequestData, bool) { +func (o *MicrosoftTeamsCreateTenantBasedHandleRequest) GetDataOk() (*MicrosoftTeamsTenantBasedHandleRequestData, bool) { if o == nil { return nil, false } @@ -56,12 +56,12 @@ func (o *MicrosoftTeamsUpdateApiHandleRequest) GetDataOk() (*MicrosoftTeamsUpdat } // SetData sets field value. -func (o *MicrosoftTeamsUpdateApiHandleRequest) SetData(v MicrosoftTeamsUpdateApiHandleRequestData) { +func (o *MicrosoftTeamsCreateTenantBasedHandleRequest) SetData(v MicrosoftTeamsTenantBasedHandleRequestData) { o.Data = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsUpdateApiHandleRequest) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsCreateTenantBasedHandleRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -75,9 +75,9 @@ func (o MicrosoftTeamsUpdateApiHandleRequest) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsUpdateApiHandleRequest) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsCreateTenantBasedHandleRequest) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *MicrosoftTeamsUpdateApiHandleRequestData `json:"data"` + Data *MicrosoftTeamsTenantBasedHandleRequestData `json:"data"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_api_handle_attributes.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_attributes.go similarity index 69% rename from api/datadogV2/model_microsoft_teams_api_handle_attributes.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_attributes.go index daadeeac25e..65057999260 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_attributes.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_attributes.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleAttributes Handle attributes. -type MicrosoftTeamsApiHandleAttributes struct { +// MicrosoftTeamsTenantBasedHandleAttributes Tenant-based handle attributes. +type MicrosoftTeamsTenantBasedHandleAttributes struct { // Channel id. ChannelId *string `json:"channel_id,omitempty"` - // Handle name. + // Tenant-based handle name. Name *string `json:"name,omitempty"` // Team id. TeamId *string `json:"team_id,omitempty"` @@ -23,25 +23,25 @@ type MicrosoftTeamsApiHandleAttributes struct { AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleAttributes instantiates a new MicrosoftTeamsApiHandleAttributes object. +// NewMicrosoftTeamsTenantBasedHandleAttributes instantiates a new MicrosoftTeamsTenantBasedHandleAttributes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleAttributes() *MicrosoftTeamsApiHandleAttributes { - this := MicrosoftTeamsApiHandleAttributes{} +func NewMicrosoftTeamsTenantBasedHandleAttributes() *MicrosoftTeamsTenantBasedHandleAttributes { + this := MicrosoftTeamsTenantBasedHandleAttributes{} return &this } -// NewMicrosoftTeamsApiHandleAttributesWithDefaults instantiates a new MicrosoftTeamsApiHandleAttributes object. +// NewMicrosoftTeamsTenantBasedHandleAttributesWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleAttributes object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleAttributesWithDefaults() *MicrosoftTeamsApiHandleAttributes { - this := MicrosoftTeamsApiHandleAttributes{} +func NewMicrosoftTeamsTenantBasedHandleAttributesWithDefaults() *MicrosoftTeamsTenantBasedHandleAttributes { + this := MicrosoftTeamsTenantBasedHandleAttributes{} return &this } // GetChannelId returns the ChannelId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleAttributes) GetChannelId() string { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetChannelId() string { if o == nil || o.ChannelId == nil { var ret string return ret @@ -51,7 +51,7 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetChannelId() string { // GetChannelIdOk returns a tuple with the ChannelId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleAttributes) GetChannelIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetChannelIdOk() (*string, bool) { if o == nil || o.ChannelId == nil { return nil, false } @@ -59,17 +59,17 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetChannelIdOk() (*string, bool) { } // HasChannelId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleAttributes) HasChannelId() bool { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) HasChannelId() bool { return o != nil && o.ChannelId != nil } // SetChannelId gets a reference to the given string and assigns it to the ChannelId field. -func (o *MicrosoftTeamsApiHandleAttributes) SetChannelId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) SetChannelId(v string) { o.ChannelId = &v } // GetName returns the Name field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleAttributes) GetName() string { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetName() string { if o == nil || o.Name == nil { var ret string return ret @@ -79,7 +79,7 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleAttributes) GetNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetNameOk() (*string, bool) { if o == nil || o.Name == nil { return nil, false } @@ -87,17 +87,17 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetNameOk() (*string, bool) { } // HasName returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleAttributes) HasName() bool { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) HasName() bool { return o != nil && o.Name != nil } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *MicrosoftTeamsApiHandleAttributes) SetName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) SetName(v string) { o.Name = &v } // GetTeamId returns the TeamId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleAttributes) GetTeamId() string { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetTeamId() string { if o == nil || o.TeamId == nil { var ret string return ret @@ -107,7 +107,7 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetTeamId() string { // GetTeamIdOk returns a tuple with the TeamId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleAttributes) GetTeamIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetTeamIdOk() (*string, bool) { if o == nil || o.TeamId == nil { return nil, false } @@ -115,17 +115,17 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetTeamIdOk() (*string, bool) { } // HasTeamId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleAttributes) HasTeamId() bool { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) HasTeamId() bool { return o != nil && o.TeamId != nil } // SetTeamId gets a reference to the given string and assigns it to the TeamId field. -func (o *MicrosoftTeamsApiHandleAttributes) SetTeamId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) SetTeamId(v string) { o.TeamId = &v } // GetTenantId returns the TenantId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleAttributes) GetTenantId() string { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetTenantId() string { if o == nil || o.TenantId == nil { var ret string return ret @@ -135,7 +135,7 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetTenantId() string { // GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleAttributes) GetTenantIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) GetTenantIdOk() (*string, bool) { if o == nil || o.TenantId == nil { return nil, false } @@ -143,17 +143,17 @@ func (o *MicrosoftTeamsApiHandleAttributes) GetTenantIdOk() (*string, bool) { } // HasTenantId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleAttributes) HasTenantId() bool { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) HasTenantId() bool { return o != nil && o.TenantId != nil } // SetTenantId gets a reference to the given string and assigns it to the TenantId field. -func (o *MicrosoftTeamsApiHandleAttributes) SetTenantId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) SetTenantId(v string) { o.TenantId = &v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleAttributes) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -178,7 +178,7 @@ func (o MicrosoftTeamsApiHandleAttributes) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleAttributes) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { ChannelId *string `json:"channel_id,omitempty"` Name *string `json:"name,omitempty"` diff --git a/api/datadogV2/model_microsoft_teams_api_handle_info_response_attributes.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_attributes.go similarity index 67% rename from api/datadogV2/model_microsoft_teams_api_handle_info_response_attributes.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_attributes.go index 925771e07a7..8046a421794 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_info_response_attributes.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_attributes.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleInfoResponseAttributes Handle attributes. -type MicrosoftTeamsApiHandleInfoResponseAttributes struct { +// MicrosoftTeamsTenantBasedHandleInfoResponseAttributes Tenant-based handle attributes. +type MicrosoftTeamsTenantBasedHandleInfoResponseAttributes struct { // Channel id. ChannelId *string `json:"channel_id,omitempty"` // Channel name. ChannelName *string `json:"channel_name,omitempty"` - // Handle name. + // Tenant-based handle name. Name *string `json:"name,omitempty"` // Team id. TeamId *string `json:"team_id,omitempty"` @@ -29,25 +29,25 @@ type MicrosoftTeamsApiHandleInfoResponseAttributes struct { AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleInfoResponseAttributes instantiates a new MicrosoftTeamsApiHandleInfoResponseAttributes object. +// NewMicrosoftTeamsTenantBasedHandleInfoResponseAttributes instantiates a new MicrosoftTeamsTenantBasedHandleInfoResponseAttributes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleInfoResponseAttributes() *MicrosoftTeamsApiHandleInfoResponseAttributes { - this := MicrosoftTeamsApiHandleInfoResponseAttributes{} +func NewMicrosoftTeamsTenantBasedHandleInfoResponseAttributes() *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes { + this := MicrosoftTeamsTenantBasedHandleInfoResponseAttributes{} return &this } -// NewMicrosoftTeamsApiHandleInfoResponseAttributesWithDefaults instantiates a new MicrosoftTeamsApiHandleInfoResponseAttributes object. +// NewMicrosoftTeamsTenantBasedHandleInfoResponseAttributesWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleInfoResponseAttributes object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleInfoResponseAttributesWithDefaults() *MicrosoftTeamsApiHandleInfoResponseAttributes { - this := MicrosoftTeamsApiHandleInfoResponseAttributes{} +func NewMicrosoftTeamsTenantBasedHandleInfoResponseAttributesWithDefaults() *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes { + this := MicrosoftTeamsTenantBasedHandleInfoResponseAttributes{} return &this } // GetChannelId returns the ChannelId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelId() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetChannelId() string { if o == nil || o.ChannelId == nil { var ret string return ret @@ -57,7 +57,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelId() string { // GetChannelIdOk returns a tuple with the ChannelId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetChannelIdOk() (*string, bool) { if o == nil || o.ChannelId == nil { return nil, false } @@ -65,17 +65,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelIdOk() (*strin } // HasChannelId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasChannelId() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasChannelId() bool { return o != nil && o.ChannelId != nil } // SetChannelId gets a reference to the given string and assigns it to the ChannelId field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetChannelId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetChannelId(v string) { o.ChannelId = &v } // GetChannelName returns the ChannelName field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelName() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetChannelName() string { if o == nil || o.ChannelName == nil { var ret string return ret @@ -85,7 +85,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelName() string // GetChannelNameOk returns a tuple with the ChannelName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetChannelNameOk() (*string, bool) { if o == nil || o.ChannelName == nil { return nil, false } @@ -93,17 +93,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetChannelNameOk() (*str } // HasChannelName returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasChannelName() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasChannelName() bool { return o != nil && o.ChannelName != nil } // SetChannelName gets a reference to the given string and assigns it to the ChannelName field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetChannelName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetChannelName(v string) { o.ChannelName = &v } // GetName returns the Name field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetName() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetName() string { if o == nil || o.Name == nil { var ret string return ret @@ -113,7 +113,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetNameOk() (*string, bool) { if o == nil || o.Name == nil { return nil, false } @@ -121,17 +121,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetNameOk() (*string, bo } // HasName returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasName() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasName() bool { return o != nil && o.Name != nil } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetName(v string) { o.Name = &v } // GetTeamId returns the TeamId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamId() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTeamId() string { if o == nil || o.TeamId == nil { var ret string return ret @@ -141,7 +141,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamId() string { // GetTeamIdOk returns a tuple with the TeamId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTeamIdOk() (*string, bool) { if o == nil || o.TeamId == nil { return nil, false } @@ -149,17 +149,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamIdOk() (*string, } // HasTeamId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasTeamId() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasTeamId() bool { return o != nil && o.TeamId != nil } // SetTeamId gets a reference to the given string and assigns it to the TeamId field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetTeamId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetTeamId(v string) { o.TeamId = &v } // GetTeamName returns the TeamName field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamName() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTeamName() string { if o == nil || o.TeamName == nil { var ret string return ret @@ -169,7 +169,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamName() string { // GetTeamNameOk returns a tuple with the TeamName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTeamNameOk() (*string, bool) { if o == nil || o.TeamName == nil { return nil, false } @@ -177,17 +177,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTeamNameOk() (*string } // HasTeamName returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasTeamName() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasTeamName() bool { return o != nil && o.TeamName != nil } // SetTeamName gets a reference to the given string and assigns it to the TeamName field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetTeamName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetTeamName(v string) { o.TeamName = &v } // GetTenantId returns the TenantId field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantId() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTenantId() string { if o == nil || o.TenantId == nil { var ret string return ret @@ -197,7 +197,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantId() string { // GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTenantIdOk() (*string, bool) { if o == nil || o.TenantId == nil { return nil, false } @@ -205,17 +205,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantIdOk() (*string } // HasTenantId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasTenantId() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasTenantId() bool { return o != nil && o.TenantId != nil } // SetTenantId gets a reference to the given string and assigns it to the TenantId field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetTenantId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetTenantId(v string) { o.TenantId = &v } // GetTenantName returns the TenantName field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantName() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTenantName() string { if o == nil || o.TenantName == nil { var ret string return ret @@ -225,7 +225,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantName() string { // GetTenantNameOk returns a tuple with the TenantName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) GetTenantNameOk() (*string, bool) { if o == nil || o.TenantName == nil { return nil, false } @@ -233,17 +233,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) GetTenantNameOk() (*stri } // HasTenantName returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) HasTenantName() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) HasTenantName() bool { return o != nil && o.TenantName != nil } // SetTenantName gets a reference to the given string and assigns it to the TenantName field. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) SetTenantName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) SetTenantName(v string) { o.TenantName = &v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleInfoResponseAttributes) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -277,7 +277,7 @@ func (o MicrosoftTeamsApiHandleInfoResponseAttributes) MarshalJSON() ([]byte, er } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleInfoResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { ChannelId *string `json:"channel_id,omitempty"` ChannelName *string `json:"channel_name,omitempty"` diff --git a/api/datadogV2/model_microsoft_teams_api_handle_info_response_data.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_data.go similarity index 53% rename from api/datadogV2/model_microsoft_teams_api_handle_info_response_data.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_data.go index 40e033f3b9c..bcd1dc46402 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_info_response_data.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_response_data.go @@ -8,44 +8,44 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleInfoResponseData Handle data from a response. -type MicrosoftTeamsApiHandleInfoResponseData struct { - // Handle attributes. - Attributes *MicrosoftTeamsApiHandleInfoResponseAttributes `json:"attributes,omitempty"` - // The ID of the handle. +// MicrosoftTeamsTenantBasedHandleInfoResponseData Tenant-based handle data from a response. +type MicrosoftTeamsTenantBasedHandleInfoResponseData struct { + // Tenant-based handle attributes. + Attributes *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes `json:"attributes,omitempty"` + // The ID of the tenant-based handle. Id *string `json:"id,omitempty"` - // Handle resource type. - Type *MicrosoftTeamsApiHandleInfoType `json:"type,omitempty"` + // Tenant-based handle resource type. + Type *MicrosoftTeamsTenantBasedHandleInfoType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleInfoResponseData instantiates a new MicrosoftTeamsApiHandleInfoResponseData object. +// NewMicrosoftTeamsTenantBasedHandleInfoResponseData instantiates a new MicrosoftTeamsTenantBasedHandleInfoResponseData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleInfoResponseData() *MicrosoftTeamsApiHandleInfoResponseData { - this := MicrosoftTeamsApiHandleInfoResponseData{} - var typeVar MicrosoftTeamsApiHandleInfoType = MICROSOFTTEAMSAPIHANDLEINFOTYPE_MS_TEAMS_HANDLE_INFO +func NewMicrosoftTeamsTenantBasedHandleInfoResponseData() *MicrosoftTeamsTenantBasedHandleInfoResponseData { + this := MicrosoftTeamsTenantBasedHandleInfoResponseData{} + var typeVar MicrosoftTeamsTenantBasedHandleInfoType = MICROSOFTTEAMSTENANTBASEDHANDLEINFOTYPE_MS_TEAMS_TENANT_BASED_HANDLE_INFO this.Type = &typeVar return &this } -// NewMicrosoftTeamsApiHandleInfoResponseDataWithDefaults instantiates a new MicrosoftTeamsApiHandleInfoResponseData object. +// NewMicrosoftTeamsTenantBasedHandleInfoResponseDataWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleInfoResponseData object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleInfoResponseDataWithDefaults() *MicrosoftTeamsApiHandleInfoResponseData { - this := MicrosoftTeamsApiHandleInfoResponseData{} - var typeVar MicrosoftTeamsApiHandleInfoType = MICROSOFTTEAMSAPIHANDLEINFOTYPE_MS_TEAMS_HANDLE_INFO +func NewMicrosoftTeamsTenantBasedHandleInfoResponseDataWithDefaults() *MicrosoftTeamsTenantBasedHandleInfoResponseData { + this := MicrosoftTeamsTenantBasedHandleInfoResponseData{} + var typeVar MicrosoftTeamsTenantBasedHandleInfoType = MICROSOFTTEAMSTENANTBASEDHANDLEINFOTYPE_MS_TEAMS_TENANT_BASED_HANDLE_INFO this.Type = &typeVar return &this } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetAttributes() MicrosoftTeamsApiHandleInfoResponseAttributes { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetAttributes() MicrosoftTeamsTenantBasedHandleInfoResponseAttributes { if o == nil || o.Attributes == nil { - var ret MicrosoftTeamsApiHandleInfoResponseAttributes + var ret MicrosoftTeamsTenantBasedHandleInfoResponseAttributes return ret } return *o.Attributes @@ -53,7 +53,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetAttributes() MicrosoftTeams // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetAttributesOk() (*MicrosoftTeamsApiHandleInfoResponseAttributes, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetAttributesOk() (*MicrosoftTeamsTenantBasedHandleInfoResponseAttributes, bool) { if o == nil || o.Attributes == nil { return nil, false } @@ -61,17 +61,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetAttributesOk() (*MicrosoftT } // HasAttributes returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) HasAttributes() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) HasAttributes() bool { return o != nil && o.Attributes != nil } -// SetAttributes gets a reference to the given MicrosoftTeamsApiHandleInfoResponseAttributes and assigns it to the Attributes field. -func (o *MicrosoftTeamsApiHandleInfoResponseData) SetAttributes(v MicrosoftTeamsApiHandleInfoResponseAttributes) { +// SetAttributes gets a reference to the given MicrosoftTeamsTenantBasedHandleInfoResponseAttributes and assigns it to the Attributes field. +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) SetAttributes(v MicrosoftTeamsTenantBasedHandleInfoResponseAttributes) { o.Attributes = &v } // GetId returns the Id field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetId() string { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetId() string { if o == nil || o.Id == nil { var ret string return ret @@ -81,7 +81,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetIdOk() (*string, bool) { if o == nil || o.Id == nil { return nil, false } @@ -89,19 +89,19 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) HasId() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) HasId() bool { return o != nil && o.Id != nil } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *MicrosoftTeamsApiHandleInfoResponseData) SetId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) SetId(v string) { o.Id = &v } // GetType returns the Type field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetType() MicrosoftTeamsApiHandleInfoType { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetType() MicrosoftTeamsTenantBasedHandleInfoType { if o == nil || o.Type == nil { - var ret MicrosoftTeamsApiHandleInfoType + var ret MicrosoftTeamsTenantBasedHandleInfoType return ret } return *o.Type @@ -109,7 +109,7 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetType() MicrosoftTeamsApiHan // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) GetTypeOk() (*MicrosoftTeamsApiHandleInfoType, bool) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) GetTypeOk() (*MicrosoftTeamsTenantBasedHandleInfoType, bool) { if o == nil || o.Type == nil { return nil, false } @@ -117,17 +117,17 @@ func (o *MicrosoftTeamsApiHandleInfoResponseData) GetTypeOk() (*MicrosoftTeamsAp } // HasType returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleInfoResponseData) HasType() bool { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) HasType() bool { return o != nil && o.Type != nil } -// SetType gets a reference to the given MicrosoftTeamsApiHandleInfoType and assigns it to the Type field. -func (o *MicrosoftTeamsApiHandleInfoResponseData) SetType(v MicrosoftTeamsApiHandleInfoType) { +// SetType gets a reference to the given MicrosoftTeamsTenantBasedHandleInfoType and assigns it to the Type field. +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) SetType(v MicrosoftTeamsTenantBasedHandleInfoType) { o.Type = &v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleInfoResponseData) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleInfoResponseData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -149,11 +149,11 @@ func (o MicrosoftTeamsApiHandleInfoResponseData) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleInfoResponseData) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleInfoResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *MicrosoftTeamsApiHandleInfoResponseAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Type *MicrosoftTeamsApiHandleInfoType `json:"type,omitempty"` + Attributes *MicrosoftTeamsTenantBasedHandleInfoResponseAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *MicrosoftTeamsTenantBasedHandleInfoType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_type.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_type.go new file mode 100644 index 00000000000..74ff4055c6c --- /dev/null +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_info_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MicrosoftTeamsTenantBasedHandleInfoType Tenant-based handle resource type. +type MicrosoftTeamsTenantBasedHandleInfoType string + +// List of MicrosoftTeamsTenantBasedHandleInfoType. +const ( + MICROSOFTTEAMSTENANTBASEDHANDLEINFOTYPE_MS_TEAMS_TENANT_BASED_HANDLE_INFO MicrosoftTeamsTenantBasedHandleInfoType = "ms-teams-tenant-based-handle-info" +) + +var allowedMicrosoftTeamsTenantBasedHandleInfoTypeEnumValues = []MicrosoftTeamsTenantBasedHandleInfoType{ + MICROSOFTTEAMSTENANTBASEDHANDLEINFOTYPE_MS_TEAMS_TENANT_BASED_HANDLE_INFO, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *MicrosoftTeamsTenantBasedHandleInfoType) GetAllowedValues() []MicrosoftTeamsTenantBasedHandleInfoType { + return allowedMicrosoftTeamsTenantBasedHandleInfoTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *MicrosoftTeamsTenantBasedHandleInfoType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = MicrosoftTeamsTenantBasedHandleInfoType(value) + return nil +} + +// NewMicrosoftTeamsTenantBasedHandleInfoTypeFromValue returns a pointer to a valid MicrosoftTeamsTenantBasedHandleInfoType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewMicrosoftTeamsTenantBasedHandleInfoTypeFromValue(v string) (*MicrosoftTeamsTenantBasedHandleInfoType, error) { + ev := MicrosoftTeamsTenantBasedHandleInfoType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for MicrosoftTeamsTenantBasedHandleInfoType: valid values are %v", v, allowedMicrosoftTeamsTenantBasedHandleInfoTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v MicrosoftTeamsTenantBasedHandleInfoType) IsValid() bool { + for _, existing := range allowedMicrosoftTeamsTenantBasedHandleInfoTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MicrosoftTeamsTenantBasedHandleInfoType value. +func (v MicrosoftTeamsTenantBasedHandleInfoType) Ptr() *MicrosoftTeamsTenantBasedHandleInfoType { + return &v +} diff --git a/api/datadogV2/model_microsoft_teams_api_handle_request_attributes.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_request_attributes.go similarity index 66% rename from api/datadogV2/model_microsoft_teams_api_handle_request_attributes.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_request_attributes.go index 8b6d6fec79a..2400606dc6f 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_request_attributes.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_request_attributes.go @@ -10,11 +10,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleRequestAttributes Handle attributes. -type MicrosoftTeamsApiHandleRequestAttributes struct { +// MicrosoftTeamsTenantBasedHandleRequestAttributes Tenant-based handle attributes. +type MicrosoftTeamsTenantBasedHandleRequestAttributes struct { // Channel id. ChannelId string `json:"channel_id"` - // Handle name. + // Tenant-based handle name. Name string `json:"name"` // Team id. TeamId string `json:"team_id"` @@ -25,12 +25,12 @@ type MicrosoftTeamsApiHandleRequestAttributes struct { AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleRequestAttributes instantiates a new MicrosoftTeamsApiHandleRequestAttributes object. +// NewMicrosoftTeamsTenantBasedHandleRequestAttributes instantiates a new MicrosoftTeamsTenantBasedHandleRequestAttributes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleRequestAttributes(channelId string, name string, teamId string, tenantId string) *MicrosoftTeamsApiHandleRequestAttributes { - this := MicrosoftTeamsApiHandleRequestAttributes{} +func NewMicrosoftTeamsTenantBasedHandleRequestAttributes(channelId string, name string, teamId string, tenantId string) *MicrosoftTeamsTenantBasedHandleRequestAttributes { + this := MicrosoftTeamsTenantBasedHandleRequestAttributes{} this.ChannelId = channelId this.Name = name this.TeamId = teamId @@ -38,16 +38,16 @@ func NewMicrosoftTeamsApiHandleRequestAttributes(channelId string, name string, return &this } -// NewMicrosoftTeamsApiHandleRequestAttributesWithDefaults instantiates a new MicrosoftTeamsApiHandleRequestAttributes object. +// NewMicrosoftTeamsTenantBasedHandleRequestAttributesWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleRequestAttributes object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleRequestAttributesWithDefaults() *MicrosoftTeamsApiHandleRequestAttributes { - this := MicrosoftTeamsApiHandleRequestAttributes{} +func NewMicrosoftTeamsTenantBasedHandleRequestAttributesWithDefaults() *MicrosoftTeamsTenantBasedHandleRequestAttributes { + this := MicrosoftTeamsTenantBasedHandleRequestAttributes{} return &this } // GetChannelId returns the ChannelId field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetChannelId() string { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetChannelId() string { if o == nil { var ret string return ret @@ -57,7 +57,7 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetChannelId() string { // GetChannelIdOk returns a tuple with the ChannelId field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetChannelIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetChannelIdOk() (*string, bool) { if o == nil { return nil, false } @@ -65,12 +65,12 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetChannelIdOk() (*string, bo } // SetChannelId sets field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) SetChannelId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) SetChannelId(v string) { o.ChannelId = v } // GetName returns the Name field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetName() string { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetName() string { if o == nil { var ret string return ret @@ -80,7 +80,7 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetNameOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetNameOk() (*string, bool) { if o == nil { return nil, false } @@ -88,12 +88,12 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetNameOk() (*string, bool) { } // SetName sets field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) SetName(v string) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) SetName(v string) { o.Name = v } // GetTeamId returns the TeamId field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTeamId() string { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetTeamId() string { if o == nil { var ret string return ret @@ -103,7 +103,7 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTeamId() string { // GetTeamIdOk returns a tuple with the TeamId field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTeamIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetTeamIdOk() (*string, bool) { if o == nil { return nil, false } @@ -111,12 +111,12 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTeamIdOk() (*string, bool) } // SetTeamId sets field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) SetTeamId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) SetTeamId(v string) { o.TeamId = v } // GetTenantId returns the TenantId field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTenantId() string { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetTenantId() string { if o == nil { var ret string return ret @@ -126,7 +126,7 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTenantId() string { // GetTenantIdOk returns a tuple with the TenantId field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTenantIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) GetTenantIdOk() (*string, bool) { if o == nil { return nil, false } @@ -134,12 +134,12 @@ func (o *MicrosoftTeamsApiHandleRequestAttributes) GetTenantIdOk() (*string, boo } // SetTenantId sets field value. -func (o *MicrosoftTeamsApiHandleRequestAttributes) SetTenantId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) SetTenantId(v string) { o.TenantId = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleRequestAttributes) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleRequestAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -156,7 +156,7 @@ func (o MicrosoftTeamsApiHandleRequestAttributes) MarshalJSON() ([]byte, error) } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { ChannelId *string `json:"channel_id"` Name *string `json:"name"` diff --git a/api/datadogV2/model_microsoft_teams_api_handle_request_data.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_request_data.go similarity index 57% rename from api/datadogV2/model_microsoft_teams_api_handle_request_data.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_request_data.go index c9a592991db..a08882e0094 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_request_data.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_request_data.go @@ -10,42 +10,42 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleRequestData Handle data from a response. -type MicrosoftTeamsApiHandleRequestData struct { - // Handle attributes. - Attributes MicrosoftTeamsApiHandleRequestAttributes `json:"attributes"` - // Specifies the handle resource type. - Type MicrosoftTeamsApiHandleType `json:"type"` +// MicrosoftTeamsTenantBasedHandleRequestData Tenant-based handle data from a response. +type MicrosoftTeamsTenantBasedHandleRequestData struct { + // Tenant-based handle attributes. + Attributes MicrosoftTeamsTenantBasedHandleRequestAttributes `json:"attributes"` + // Specifies the tenant-based handle resource type. + Type MicrosoftTeamsTenantBasedHandleType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleRequestData instantiates a new MicrosoftTeamsApiHandleRequestData object. +// NewMicrosoftTeamsTenantBasedHandleRequestData instantiates a new MicrosoftTeamsTenantBasedHandleRequestData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleRequestData(attributes MicrosoftTeamsApiHandleRequestAttributes, typeVar MicrosoftTeamsApiHandleType) *MicrosoftTeamsApiHandleRequestData { - this := MicrosoftTeamsApiHandleRequestData{} +func NewMicrosoftTeamsTenantBasedHandleRequestData(attributes MicrosoftTeamsTenantBasedHandleRequestAttributes, typeVar MicrosoftTeamsTenantBasedHandleType) *MicrosoftTeamsTenantBasedHandleRequestData { + this := MicrosoftTeamsTenantBasedHandleRequestData{} this.Attributes = attributes this.Type = typeVar return &this } -// NewMicrosoftTeamsApiHandleRequestDataWithDefaults instantiates a new MicrosoftTeamsApiHandleRequestData object. +// NewMicrosoftTeamsTenantBasedHandleRequestDataWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleRequestData object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleRequestDataWithDefaults() *MicrosoftTeamsApiHandleRequestData { - this := MicrosoftTeamsApiHandleRequestData{} - var typeVar MicrosoftTeamsApiHandleType = MICROSOFTTEAMSAPIHANDLETYPE_HANDLE +func NewMicrosoftTeamsTenantBasedHandleRequestDataWithDefaults() *MicrosoftTeamsTenantBasedHandleRequestData { + this := MicrosoftTeamsTenantBasedHandleRequestData{} + var typeVar MicrosoftTeamsTenantBasedHandleType = MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE this.Type = typeVar return &this } // GetAttributes returns the Attributes field value. -func (o *MicrosoftTeamsApiHandleRequestData) GetAttributes() MicrosoftTeamsApiHandleRequestAttributes { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) GetAttributes() MicrosoftTeamsTenantBasedHandleRequestAttributes { if o == nil { - var ret MicrosoftTeamsApiHandleRequestAttributes + var ret MicrosoftTeamsTenantBasedHandleRequestAttributes return ret } return o.Attributes @@ -53,7 +53,7 @@ func (o *MicrosoftTeamsApiHandleRequestData) GetAttributes() MicrosoftTeamsApiHa // GetAttributesOk returns a tuple with the Attributes field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestData) GetAttributesOk() (*MicrosoftTeamsApiHandleRequestAttributes, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) GetAttributesOk() (*MicrosoftTeamsTenantBasedHandleRequestAttributes, bool) { if o == nil { return nil, false } @@ -61,14 +61,14 @@ func (o *MicrosoftTeamsApiHandleRequestData) GetAttributesOk() (*MicrosoftTeamsA } // SetAttributes sets field value. -func (o *MicrosoftTeamsApiHandleRequestData) SetAttributes(v MicrosoftTeamsApiHandleRequestAttributes) { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) SetAttributes(v MicrosoftTeamsTenantBasedHandleRequestAttributes) { o.Attributes = v } // GetType returns the Type field value. -func (o *MicrosoftTeamsApiHandleRequestData) GetType() MicrosoftTeamsApiHandleType { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) GetType() MicrosoftTeamsTenantBasedHandleType { if o == nil { - var ret MicrosoftTeamsApiHandleType + var ret MicrosoftTeamsTenantBasedHandleType return ret } return o.Type @@ -76,7 +76,7 @@ func (o *MicrosoftTeamsApiHandleRequestData) GetType() MicrosoftTeamsApiHandleTy // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleRequestData) GetTypeOk() (*MicrosoftTeamsApiHandleType, bool) { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) GetTypeOk() (*MicrosoftTeamsTenantBasedHandleType, bool) { if o == nil { return nil, false } @@ -84,12 +84,12 @@ func (o *MicrosoftTeamsApiHandleRequestData) GetTypeOk() (*MicrosoftTeamsApiHand } // SetType sets field value. -func (o *MicrosoftTeamsApiHandleRequestData) SetType(v MicrosoftTeamsApiHandleType) { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) SetType(v MicrosoftTeamsTenantBasedHandleType) { o.Type = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleRequestData) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleRequestData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -104,10 +104,10 @@ func (o MicrosoftTeamsApiHandleRequestData) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleRequestData) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleRequestData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *MicrosoftTeamsApiHandleRequestAttributes `json:"attributes"` - Type *MicrosoftTeamsApiHandleType `json:"type"` + Attributes *MicrosoftTeamsTenantBasedHandleRequestAttributes `json:"attributes"` + Type *MicrosoftTeamsTenantBasedHandleType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_create_api_handle_response.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_response.go similarity index 62% rename from api/datadogV2/model_microsoft_teams_create_api_handle_response.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_response.go index e7a79477b62..95300be219a 100644 --- a/api/datadogV2/model_microsoft_teams_create_api_handle_response.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_response.go @@ -10,37 +10,37 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsCreateApiHandleResponse Response of a handle. -type MicrosoftTeamsCreateApiHandleResponse struct { - // Handle data from a response. - Data MicrosoftTeamsApiHandleResponseData `json:"data"` +// MicrosoftTeamsTenantBasedHandleResponse Response of a tenant-based handle. +type MicrosoftTeamsTenantBasedHandleResponse struct { + // Tenant-based handle data from a response. + Data MicrosoftTeamsTenantBasedHandleResponseData `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsCreateApiHandleResponse instantiates a new MicrosoftTeamsCreateApiHandleResponse object. +// NewMicrosoftTeamsTenantBasedHandleResponse instantiates a new MicrosoftTeamsTenantBasedHandleResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsCreateApiHandleResponse(data MicrosoftTeamsApiHandleResponseData) *MicrosoftTeamsCreateApiHandleResponse { - this := MicrosoftTeamsCreateApiHandleResponse{} +func NewMicrosoftTeamsTenantBasedHandleResponse(data MicrosoftTeamsTenantBasedHandleResponseData) *MicrosoftTeamsTenantBasedHandleResponse { + this := MicrosoftTeamsTenantBasedHandleResponse{} this.Data = data return &this } -// NewMicrosoftTeamsCreateApiHandleResponseWithDefaults instantiates a new MicrosoftTeamsCreateApiHandleResponse object. +// NewMicrosoftTeamsTenantBasedHandleResponseWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleResponse object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsCreateApiHandleResponseWithDefaults() *MicrosoftTeamsCreateApiHandleResponse { - this := MicrosoftTeamsCreateApiHandleResponse{} +func NewMicrosoftTeamsTenantBasedHandleResponseWithDefaults() *MicrosoftTeamsTenantBasedHandleResponse { + this := MicrosoftTeamsTenantBasedHandleResponse{} return &this } // GetData returns the Data field value. -func (o *MicrosoftTeamsCreateApiHandleResponse) GetData() MicrosoftTeamsApiHandleResponseData { +func (o *MicrosoftTeamsTenantBasedHandleResponse) GetData() MicrosoftTeamsTenantBasedHandleResponseData { if o == nil { - var ret MicrosoftTeamsApiHandleResponseData + var ret MicrosoftTeamsTenantBasedHandleResponseData return ret } return o.Data @@ -48,7 +48,7 @@ func (o *MicrosoftTeamsCreateApiHandleResponse) GetData() MicrosoftTeamsApiHandl // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsCreateApiHandleResponse) GetDataOk() (*MicrosoftTeamsApiHandleResponseData, bool) { +func (o *MicrosoftTeamsTenantBasedHandleResponse) GetDataOk() (*MicrosoftTeamsTenantBasedHandleResponseData, bool) { if o == nil { return nil, false } @@ -56,12 +56,12 @@ func (o *MicrosoftTeamsCreateApiHandleResponse) GetDataOk() (*MicrosoftTeamsApiH } // SetData sets field value. -func (o *MicrosoftTeamsCreateApiHandleResponse) SetData(v MicrosoftTeamsApiHandleResponseData) { +func (o *MicrosoftTeamsTenantBasedHandleResponse) SetData(v MicrosoftTeamsTenantBasedHandleResponseData) { o.Data = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsCreateApiHandleResponse) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -75,9 +75,9 @@ func (o MicrosoftTeamsCreateApiHandleResponse) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsCreateApiHandleResponse) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *MicrosoftTeamsApiHandleResponseData `json:"data"` + Data *MicrosoftTeamsTenantBasedHandleResponseData `json:"data"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_api_handle_response_data.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_response_data.go similarity index 55% rename from api/datadogV2/model_microsoft_teams_api_handle_response_data.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handle_response_data.go index 9a5d6b19548..68c5d1dbed6 100644 --- a/api/datadogV2/model_microsoft_teams_api_handle_response_data.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_response_data.go @@ -8,44 +8,44 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandleResponseData Handle data from a response. -type MicrosoftTeamsApiHandleResponseData struct { - // Handle attributes. - Attributes *MicrosoftTeamsApiHandleAttributes `json:"attributes,omitempty"` - // The ID of the handle. +// MicrosoftTeamsTenantBasedHandleResponseData Tenant-based handle data from a response. +type MicrosoftTeamsTenantBasedHandleResponseData struct { + // Tenant-based handle attributes. + Attributes *MicrosoftTeamsTenantBasedHandleAttributes `json:"attributes,omitempty"` + // The ID of the tenant-based handle. Id *string `json:"id,omitempty"` - // Specifies the handle resource type. - Type *MicrosoftTeamsApiHandleType `json:"type,omitempty"` + // Specifies the tenant-based handle resource type. + Type *MicrosoftTeamsTenantBasedHandleType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandleResponseData instantiates a new MicrosoftTeamsApiHandleResponseData object. +// NewMicrosoftTeamsTenantBasedHandleResponseData instantiates a new MicrosoftTeamsTenantBasedHandleResponseData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandleResponseData() *MicrosoftTeamsApiHandleResponseData { - this := MicrosoftTeamsApiHandleResponseData{} - var typeVar MicrosoftTeamsApiHandleType = MICROSOFTTEAMSAPIHANDLETYPE_HANDLE +func NewMicrosoftTeamsTenantBasedHandleResponseData() *MicrosoftTeamsTenantBasedHandleResponseData { + this := MicrosoftTeamsTenantBasedHandleResponseData{} + var typeVar MicrosoftTeamsTenantBasedHandleType = MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE this.Type = &typeVar return &this } -// NewMicrosoftTeamsApiHandleResponseDataWithDefaults instantiates a new MicrosoftTeamsApiHandleResponseData object. +// NewMicrosoftTeamsTenantBasedHandleResponseDataWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandleResponseData object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandleResponseDataWithDefaults() *MicrosoftTeamsApiHandleResponseData { - this := MicrosoftTeamsApiHandleResponseData{} - var typeVar MicrosoftTeamsApiHandleType = MICROSOFTTEAMSAPIHANDLETYPE_HANDLE +func NewMicrosoftTeamsTenantBasedHandleResponseDataWithDefaults() *MicrosoftTeamsTenantBasedHandleResponseData { + this := MicrosoftTeamsTenantBasedHandleResponseData{} + var typeVar MicrosoftTeamsTenantBasedHandleType = MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE this.Type = &typeVar return &this } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleResponseData) GetAttributes() MicrosoftTeamsApiHandleAttributes { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetAttributes() MicrosoftTeamsTenantBasedHandleAttributes { if o == nil || o.Attributes == nil { - var ret MicrosoftTeamsApiHandleAttributes + var ret MicrosoftTeamsTenantBasedHandleAttributes return ret } return *o.Attributes @@ -53,7 +53,7 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetAttributes() MicrosoftTeamsApiH // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleResponseData) GetAttributesOk() (*MicrosoftTeamsApiHandleAttributes, bool) { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetAttributesOk() (*MicrosoftTeamsTenantBasedHandleAttributes, bool) { if o == nil || o.Attributes == nil { return nil, false } @@ -61,17 +61,17 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetAttributesOk() (*MicrosoftTeams } // HasAttributes returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleResponseData) HasAttributes() bool { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) HasAttributes() bool { return o != nil && o.Attributes != nil } -// SetAttributes gets a reference to the given MicrosoftTeamsApiHandleAttributes and assigns it to the Attributes field. -func (o *MicrosoftTeamsApiHandleResponseData) SetAttributes(v MicrosoftTeamsApiHandleAttributes) { +// SetAttributes gets a reference to the given MicrosoftTeamsTenantBasedHandleAttributes and assigns it to the Attributes field. +func (o *MicrosoftTeamsTenantBasedHandleResponseData) SetAttributes(v MicrosoftTeamsTenantBasedHandleAttributes) { o.Attributes = &v } // GetId returns the Id field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleResponseData) GetId() string { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetId() string { if o == nil || o.Id == nil { var ret string return ret @@ -81,7 +81,7 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleResponseData) GetIdOk() (*string, bool) { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetIdOk() (*string, bool) { if o == nil || o.Id == nil { return nil, false } @@ -89,19 +89,19 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleResponseData) HasId() bool { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) HasId() bool { return o != nil && o.Id != nil } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *MicrosoftTeamsApiHandleResponseData) SetId(v string) { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) SetId(v string) { o.Id = &v } // GetType returns the Type field value if set, zero value otherwise. -func (o *MicrosoftTeamsApiHandleResponseData) GetType() MicrosoftTeamsApiHandleType { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetType() MicrosoftTeamsTenantBasedHandleType { if o == nil || o.Type == nil { - var ret MicrosoftTeamsApiHandleType + var ret MicrosoftTeamsTenantBasedHandleType return ret } return *o.Type @@ -109,7 +109,7 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetType() MicrosoftTeamsApiHandleT // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandleResponseData) GetTypeOk() (*MicrosoftTeamsApiHandleType, bool) { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) GetTypeOk() (*MicrosoftTeamsTenantBasedHandleType, bool) { if o == nil || o.Type == nil { return nil, false } @@ -117,17 +117,17 @@ func (o *MicrosoftTeamsApiHandleResponseData) GetTypeOk() (*MicrosoftTeamsApiHan } // HasType returns a boolean if a field has been set. -func (o *MicrosoftTeamsApiHandleResponseData) HasType() bool { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) HasType() bool { return o != nil && o.Type != nil } -// SetType gets a reference to the given MicrosoftTeamsApiHandleType and assigns it to the Type field. -func (o *MicrosoftTeamsApiHandleResponseData) SetType(v MicrosoftTeamsApiHandleType) { +// SetType gets a reference to the given MicrosoftTeamsTenantBasedHandleType and assigns it to the Type field. +func (o *MicrosoftTeamsTenantBasedHandleResponseData) SetType(v MicrosoftTeamsTenantBasedHandleType) { o.Type = &v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandleResponseData) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandleResponseData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -149,11 +149,11 @@ func (o MicrosoftTeamsApiHandleResponseData) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandleResponseData) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandleResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *MicrosoftTeamsApiHandleAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Type *MicrosoftTeamsApiHandleType `json:"type,omitempty"` + Attributes *MicrosoftTeamsTenantBasedHandleAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *MicrosoftTeamsTenantBasedHandleType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_tenant_based_handle_type.go b/api/datadogV2/model_microsoft_teams_tenant_based_handle_type.go new file mode 100644 index 00000000000..c6184d1263f --- /dev/null +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handle_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MicrosoftTeamsTenantBasedHandleType Specifies the tenant-based handle resource type. +type MicrosoftTeamsTenantBasedHandleType string + +// List of MicrosoftTeamsTenantBasedHandleType. +const ( + MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE MicrosoftTeamsTenantBasedHandleType = "tenant-based-handle" +) + +var allowedMicrosoftTeamsTenantBasedHandleTypeEnumValues = []MicrosoftTeamsTenantBasedHandleType{ + MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *MicrosoftTeamsTenantBasedHandleType) GetAllowedValues() []MicrosoftTeamsTenantBasedHandleType { + return allowedMicrosoftTeamsTenantBasedHandleTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *MicrosoftTeamsTenantBasedHandleType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = MicrosoftTeamsTenantBasedHandleType(value) + return nil +} + +// NewMicrosoftTeamsTenantBasedHandleTypeFromValue returns a pointer to a valid MicrosoftTeamsTenantBasedHandleType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewMicrosoftTeamsTenantBasedHandleTypeFromValue(v string) (*MicrosoftTeamsTenantBasedHandleType, error) { + ev := MicrosoftTeamsTenantBasedHandleType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for MicrosoftTeamsTenantBasedHandleType: valid values are %v", v, allowedMicrosoftTeamsTenantBasedHandleTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v MicrosoftTeamsTenantBasedHandleType) IsValid() bool { + for _, existing := range allowedMicrosoftTeamsTenantBasedHandleTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MicrosoftTeamsTenantBasedHandleType value. +func (v MicrosoftTeamsTenantBasedHandleType) Ptr() *MicrosoftTeamsTenantBasedHandleType { + return &v +} diff --git a/api/datadogV2/model_microsoft_teams_api_handles_response.go b/api/datadogV2/model_microsoft_teams_tenant_based_handles_response.go similarity index 59% rename from api/datadogV2/model_microsoft_teams_api_handles_response.go rename to api/datadogV2/model_microsoft_teams_tenant_based_handles_response.go index df5a0d9ee5f..03dce8a973f 100644 --- a/api/datadogV2/model_microsoft_teams_api_handles_response.go +++ b/api/datadogV2/model_microsoft_teams_tenant_based_handles_response.go @@ -10,37 +10,37 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsApiHandlesResponse Response with a list of handles. -type MicrosoftTeamsApiHandlesResponse struct { - // An array of handles. - Data []MicrosoftTeamsApiHandleInfoResponseData `json:"data"` +// MicrosoftTeamsTenantBasedHandlesResponse Response with a list of tenant-based handles. +type MicrosoftTeamsTenantBasedHandlesResponse struct { + // An array of tenant-based handles. + Data []MicrosoftTeamsTenantBasedHandleInfoResponseData `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsApiHandlesResponse instantiates a new MicrosoftTeamsApiHandlesResponse object. +// NewMicrosoftTeamsTenantBasedHandlesResponse instantiates a new MicrosoftTeamsTenantBasedHandlesResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsApiHandlesResponse(data []MicrosoftTeamsApiHandleInfoResponseData) *MicrosoftTeamsApiHandlesResponse { - this := MicrosoftTeamsApiHandlesResponse{} +func NewMicrosoftTeamsTenantBasedHandlesResponse(data []MicrosoftTeamsTenantBasedHandleInfoResponseData) *MicrosoftTeamsTenantBasedHandlesResponse { + this := MicrosoftTeamsTenantBasedHandlesResponse{} this.Data = data return &this } -// NewMicrosoftTeamsApiHandlesResponseWithDefaults instantiates a new MicrosoftTeamsApiHandlesResponse object. +// NewMicrosoftTeamsTenantBasedHandlesResponseWithDefaults instantiates a new MicrosoftTeamsTenantBasedHandlesResponse object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsApiHandlesResponseWithDefaults() *MicrosoftTeamsApiHandlesResponse { - this := MicrosoftTeamsApiHandlesResponse{} +func NewMicrosoftTeamsTenantBasedHandlesResponseWithDefaults() *MicrosoftTeamsTenantBasedHandlesResponse { + this := MicrosoftTeamsTenantBasedHandlesResponse{} return &this } // GetData returns the Data field value. -func (o *MicrosoftTeamsApiHandlesResponse) GetData() []MicrosoftTeamsApiHandleInfoResponseData { +func (o *MicrosoftTeamsTenantBasedHandlesResponse) GetData() []MicrosoftTeamsTenantBasedHandleInfoResponseData { if o == nil { - var ret []MicrosoftTeamsApiHandleInfoResponseData + var ret []MicrosoftTeamsTenantBasedHandleInfoResponseData return ret } return o.Data @@ -48,7 +48,7 @@ func (o *MicrosoftTeamsApiHandlesResponse) GetData() []MicrosoftTeamsApiHandleIn // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsApiHandlesResponse) GetDataOk() (*[]MicrosoftTeamsApiHandleInfoResponseData, bool) { +func (o *MicrosoftTeamsTenantBasedHandlesResponse) GetDataOk() (*[]MicrosoftTeamsTenantBasedHandleInfoResponseData, bool) { if o == nil { return nil, false } @@ -56,12 +56,12 @@ func (o *MicrosoftTeamsApiHandlesResponse) GetDataOk() (*[]MicrosoftTeamsApiHand } // SetData sets field value. -func (o *MicrosoftTeamsApiHandlesResponse) SetData(v []MicrosoftTeamsApiHandleInfoResponseData) { +func (o *MicrosoftTeamsTenantBasedHandlesResponse) SetData(v []MicrosoftTeamsTenantBasedHandleInfoResponseData) { o.Data = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsApiHandlesResponse) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsTenantBasedHandlesResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -75,9 +75,9 @@ func (o MicrosoftTeamsApiHandlesResponse) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsApiHandlesResponse) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsTenantBasedHandlesResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *[]MicrosoftTeamsApiHandleInfoResponseData `json:"data"` + Data *[]MicrosoftTeamsTenantBasedHandleInfoResponseData `json:"data"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_create_api_handle_request.go b/api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request.go similarity index 60% rename from api/datadogV2/model_microsoft_teams_create_api_handle_request.go rename to api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request.go index a7128942239..7af90fc5b3e 100644 --- a/api/datadogV2/model_microsoft_teams_create_api_handle_request.go +++ b/api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request.go @@ -10,37 +10,37 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsCreateApiHandleRequest Create handle request. -type MicrosoftTeamsCreateApiHandleRequest struct { - // Handle data from a response. - Data MicrosoftTeamsApiHandleRequestData `json:"data"` +// MicrosoftTeamsUpdateTenantBasedHandleRequest Update tenant-based handle request. +type MicrosoftTeamsUpdateTenantBasedHandleRequest struct { + // Tenant-based handle data from a response. + Data MicrosoftTeamsUpdateTenantBasedHandleRequestData `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsCreateApiHandleRequest instantiates a new MicrosoftTeamsCreateApiHandleRequest object. +// NewMicrosoftTeamsUpdateTenantBasedHandleRequest instantiates a new MicrosoftTeamsUpdateTenantBasedHandleRequest object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsCreateApiHandleRequest(data MicrosoftTeamsApiHandleRequestData) *MicrosoftTeamsCreateApiHandleRequest { - this := MicrosoftTeamsCreateApiHandleRequest{} +func NewMicrosoftTeamsUpdateTenantBasedHandleRequest(data MicrosoftTeamsUpdateTenantBasedHandleRequestData) *MicrosoftTeamsUpdateTenantBasedHandleRequest { + this := MicrosoftTeamsUpdateTenantBasedHandleRequest{} this.Data = data return &this } -// NewMicrosoftTeamsCreateApiHandleRequestWithDefaults instantiates a new MicrosoftTeamsCreateApiHandleRequest object. +// NewMicrosoftTeamsUpdateTenantBasedHandleRequestWithDefaults instantiates a new MicrosoftTeamsUpdateTenantBasedHandleRequest object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsCreateApiHandleRequestWithDefaults() *MicrosoftTeamsCreateApiHandleRequest { - this := MicrosoftTeamsCreateApiHandleRequest{} +func NewMicrosoftTeamsUpdateTenantBasedHandleRequestWithDefaults() *MicrosoftTeamsUpdateTenantBasedHandleRequest { + this := MicrosoftTeamsUpdateTenantBasedHandleRequest{} return &this } // GetData returns the Data field value. -func (o *MicrosoftTeamsCreateApiHandleRequest) GetData() MicrosoftTeamsApiHandleRequestData { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequest) GetData() MicrosoftTeamsUpdateTenantBasedHandleRequestData { if o == nil { - var ret MicrosoftTeamsApiHandleRequestData + var ret MicrosoftTeamsUpdateTenantBasedHandleRequestData return ret } return o.Data @@ -48,7 +48,7 @@ func (o *MicrosoftTeamsCreateApiHandleRequest) GetData() MicrosoftTeamsApiHandle // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsCreateApiHandleRequest) GetDataOk() (*MicrosoftTeamsApiHandleRequestData, bool) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequest) GetDataOk() (*MicrosoftTeamsUpdateTenantBasedHandleRequestData, bool) { if o == nil { return nil, false } @@ -56,12 +56,12 @@ func (o *MicrosoftTeamsCreateApiHandleRequest) GetDataOk() (*MicrosoftTeamsApiHa } // SetData sets field value. -func (o *MicrosoftTeamsCreateApiHandleRequest) SetData(v MicrosoftTeamsApiHandleRequestData) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequest) SetData(v MicrosoftTeamsUpdateTenantBasedHandleRequestData) { o.Data = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsCreateApiHandleRequest) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsUpdateTenantBasedHandleRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -75,9 +75,9 @@ func (o MicrosoftTeamsCreateApiHandleRequest) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsCreateApiHandleRequest) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequest) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *MicrosoftTeamsApiHandleRequestData `json:"data"` + Data *MicrosoftTeamsUpdateTenantBasedHandleRequestData `json:"data"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_microsoft_teams_update_api_handle_request_data.go b/api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request_data.go similarity index 57% rename from api/datadogV2/model_microsoft_teams_update_api_handle_request_data.go rename to api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request_data.go index 8e808f1c826..c9a5258a20a 100644 --- a/api/datadogV2/model_microsoft_teams_update_api_handle_request_data.go +++ b/api/datadogV2/model_microsoft_teams_update_tenant_based_handle_request_data.go @@ -10,42 +10,42 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// MicrosoftTeamsUpdateApiHandleRequestData Handle data from a response. -type MicrosoftTeamsUpdateApiHandleRequestData struct { - // Handle attributes. - Attributes MicrosoftTeamsApiHandleAttributes `json:"attributes"` - // Specifies the handle resource type. - Type MicrosoftTeamsApiHandleType `json:"type"` +// MicrosoftTeamsUpdateTenantBasedHandleRequestData Tenant-based handle data from a response. +type MicrosoftTeamsUpdateTenantBasedHandleRequestData struct { + // Tenant-based handle attributes. + Attributes MicrosoftTeamsTenantBasedHandleAttributes `json:"attributes"` + // Specifies the tenant-based handle resource type. + Type MicrosoftTeamsTenantBasedHandleType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewMicrosoftTeamsUpdateApiHandleRequestData instantiates a new MicrosoftTeamsUpdateApiHandleRequestData object. +// NewMicrosoftTeamsUpdateTenantBasedHandleRequestData instantiates a new MicrosoftTeamsUpdateTenantBasedHandleRequestData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewMicrosoftTeamsUpdateApiHandleRequestData(attributes MicrosoftTeamsApiHandleAttributes, typeVar MicrosoftTeamsApiHandleType) *MicrosoftTeamsUpdateApiHandleRequestData { - this := MicrosoftTeamsUpdateApiHandleRequestData{} +func NewMicrosoftTeamsUpdateTenantBasedHandleRequestData(attributes MicrosoftTeamsTenantBasedHandleAttributes, typeVar MicrosoftTeamsTenantBasedHandleType) *MicrosoftTeamsUpdateTenantBasedHandleRequestData { + this := MicrosoftTeamsUpdateTenantBasedHandleRequestData{} this.Attributes = attributes this.Type = typeVar return &this } -// NewMicrosoftTeamsUpdateApiHandleRequestDataWithDefaults instantiates a new MicrosoftTeamsUpdateApiHandleRequestData object. +// NewMicrosoftTeamsUpdateTenantBasedHandleRequestDataWithDefaults instantiates a new MicrosoftTeamsUpdateTenantBasedHandleRequestData object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewMicrosoftTeamsUpdateApiHandleRequestDataWithDefaults() *MicrosoftTeamsUpdateApiHandleRequestData { - this := MicrosoftTeamsUpdateApiHandleRequestData{} - var typeVar MicrosoftTeamsApiHandleType = MICROSOFTTEAMSAPIHANDLETYPE_HANDLE +func NewMicrosoftTeamsUpdateTenantBasedHandleRequestDataWithDefaults() *MicrosoftTeamsUpdateTenantBasedHandleRequestData { + this := MicrosoftTeamsUpdateTenantBasedHandleRequestData{} + var typeVar MicrosoftTeamsTenantBasedHandleType = MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE this.Type = typeVar return &this } // GetAttributes returns the Attributes field value. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetAttributes() MicrosoftTeamsApiHandleAttributes { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) GetAttributes() MicrosoftTeamsTenantBasedHandleAttributes { if o == nil { - var ret MicrosoftTeamsApiHandleAttributes + var ret MicrosoftTeamsTenantBasedHandleAttributes return ret } return o.Attributes @@ -53,7 +53,7 @@ func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetAttributes() MicrosoftTeam // GetAttributesOk returns a tuple with the Attributes field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetAttributesOk() (*MicrosoftTeamsApiHandleAttributes, bool) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) GetAttributesOk() (*MicrosoftTeamsTenantBasedHandleAttributes, bool) { if o == nil { return nil, false } @@ -61,14 +61,14 @@ func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetAttributesOk() (*Microsoft } // SetAttributes sets field value. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) SetAttributes(v MicrosoftTeamsApiHandleAttributes) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) SetAttributes(v MicrosoftTeamsTenantBasedHandleAttributes) { o.Attributes = v } // GetType returns the Type field value. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetType() MicrosoftTeamsApiHandleType { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) GetType() MicrosoftTeamsTenantBasedHandleType { if o == nil { - var ret MicrosoftTeamsApiHandleType + var ret MicrosoftTeamsTenantBasedHandleType return ret } return o.Type @@ -76,7 +76,7 @@ func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetType() MicrosoftTeamsApiHa // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetTypeOk() (*MicrosoftTeamsApiHandleType, bool) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) GetTypeOk() (*MicrosoftTeamsTenantBasedHandleType, bool) { if o == nil { return nil, false } @@ -84,12 +84,12 @@ func (o *MicrosoftTeamsUpdateApiHandleRequestData) GetTypeOk() (*MicrosoftTeamsA } // SetType sets field value. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) SetType(v MicrosoftTeamsApiHandleType) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) SetType(v MicrosoftTeamsTenantBasedHandleType) { o.Type = v } // MarshalJSON serializes the struct using spec logic. -func (o MicrosoftTeamsUpdateApiHandleRequestData) MarshalJSON() ([]byte, error) { +func (o MicrosoftTeamsUpdateTenantBasedHandleRequestData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -104,10 +104,10 @@ func (o MicrosoftTeamsUpdateApiHandleRequestData) MarshalJSON() ([]byte, error) } // UnmarshalJSON deserializes the given payload. -func (o *MicrosoftTeamsUpdateApiHandleRequestData) UnmarshalJSON(bytes []byte) (err error) { +func (o *MicrosoftTeamsUpdateTenantBasedHandleRequestData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *MicrosoftTeamsApiHandleAttributes `json:"attributes"` - Type *MicrosoftTeamsApiHandleType `json:"type"` + Attributes *MicrosoftTeamsTenantBasedHandleAttributes `json:"attributes"` + Type *MicrosoftTeamsTenantBasedHandleType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/examples/v2/microsoft-teams-integration/CreateApiHandle.go b/examples/v2/microsoft-teams-integration/CreateTenantBasedHandle.go similarity index 63% rename from examples/v2/microsoft-teams-integration/CreateApiHandle.go rename to examples/v2/microsoft-teams-integration/CreateTenantBasedHandle.go index a6a2169254a..841bea643d4 100644 --- a/examples/v2/microsoft-teams-integration/CreateApiHandle.go +++ b/examples/v2/microsoft-teams-integration/CreateTenantBasedHandle.go @@ -1,4 +1,4 @@ -// Create handle returns "CREATED" response +// Create tenant-based handle returns "CREATED" response package main @@ -13,28 +13,28 @@ import ( ) func main() { - body := datadogV2.MicrosoftTeamsCreateApiHandleRequest{ - Data: datadogV2.MicrosoftTeamsApiHandleRequestData{ - Attributes: datadogV2.MicrosoftTeamsApiHandleRequestAttributes{ + body := datadogV2.MicrosoftTeamsCreateTenantBasedHandleRequest{ + Data: datadogV2.MicrosoftTeamsTenantBasedHandleRequestData{ + Attributes: datadogV2.MicrosoftTeamsTenantBasedHandleRequestAttributes{ ChannelId: "fake-channel-id", Name: "fake-handle-name", TeamId: "00000000-0000-0000-0000-000000000000", TenantId: "00000000-0000-0000-0000-000000000001", }, - Type: datadogV2.MICROSOFTTEAMSAPIHANDLETYPE_HANDLE, + Type: datadogV2.MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.CreateApiHandle(ctx, body) + resp, r, err := api.CreateTenantBasedHandle(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.CreateApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.CreateApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.go b/examples/v2/microsoft-teams-integration/CreateTenantBasedHandle_1540689753.go similarity index 69% rename from examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.go rename to examples/v2/microsoft-teams-integration/CreateTenantBasedHandle_1540689753.go index d960aedb70b..743faf57872 100644 --- a/examples/v2/microsoft-teams-integration/CreateApiHandle_1540689753.go +++ b/examples/v2/microsoft-teams-integration/CreateTenantBasedHandle_1540689753.go @@ -13,28 +13,28 @@ import ( ) func main() { - body := datadogV2.MicrosoftTeamsCreateApiHandleRequest{ - Data: datadogV2.MicrosoftTeamsApiHandleRequestData{ - Attributes: datadogV2.MicrosoftTeamsApiHandleRequestAttributes{ + body := datadogV2.MicrosoftTeamsCreateTenantBasedHandleRequest{ + Data: datadogV2.MicrosoftTeamsTenantBasedHandleRequestData{ + Attributes: datadogV2.MicrosoftTeamsTenantBasedHandleRequestAttributes{ ChannelId: "19:iD_D2xy_sAa-JV851JJYwIa6mlW9F9Nxm3SLyZq68qY1@thread.tacv2", Name: "Example-Microsoft-Teams-Integration", TeamId: "e5f50a58-c929-4fb3-8866-e2cd836de3c2", TenantId: "4d3bac44-0230-4732-9e70-cc00736f0a97", }, - Type: datadogV2.MICROSOFTTEAMSAPIHANDLETYPE_HANDLE, + Type: datadogV2.MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.CreateApiHandle(ctx, body) + resp, r, err := api.CreateTenantBasedHandle(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.CreateApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.CreateApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.CreateTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/DeleteApiHandle.go b/examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle.go similarity index 77% rename from examples/v2/microsoft-teams-integration/DeleteApiHandle.go rename to examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle.go index 93be0cf350e..41ced169ccb 100644 --- a/examples/v2/microsoft-teams-integration/DeleteApiHandle.go +++ b/examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle.go @@ -1,4 +1,4 @@ -// Delete handle returns "OK" response +// Delete tenant-based handle returns "OK" response package main @@ -16,10 +16,10 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - r, err := api.DeleteApiHandle(ctx, "handle_id") + r, err := api.DeleteTenantBasedHandle(ctx, "handle_id") if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.DeleteApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.DeleteTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } diff --git a/examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.go b/examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle_377884154.go similarity index 70% rename from examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.go rename to examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle_377884154.go index 33607d37b7f..8484cbe0a64 100644 --- a/examples/v2/microsoft-teams-integration/DeleteApiHandle_377884154.go +++ b/examples/v2/microsoft-teams-integration/DeleteTenantBasedHandle_377884154.go @@ -12,17 +12,17 @@ import ( ) func main() { - // there is a valid "api_handle" in the system - APIHandleDataID := os.Getenv("API_HANDLE_DATA_ID") + // there is a valid "tenant_based_handle" in the system + TenantBasedHandleDataID := os.Getenv("TENANT_BASED_HANDLE_DATA_ID") ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - r, err := api.DeleteApiHandle(ctx, APIHandleDataID) + r, err := api.DeleteTenantBasedHandle(ctx, TenantBasedHandleDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.DeleteApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.DeleteTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } diff --git a/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.go b/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.go deleted file mode 100644 index c251c46b3c8..00000000000 --- a/examples/v2/microsoft-teams-integration/GetApiHandleByName_1103107145.go +++ /dev/null @@ -1,32 +0,0 @@ -// Get api handle information by name returns "OK" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - // there is a valid "api_handle" in the system - APIHandleDataAttributesName := os.Getenv("API_HANDLE_DATA_ATTRIBUTES_NAME") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.GetApiHandleByName(ctx, APIHandleDataAttributesName) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetApiHandleByName`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetApiHandleByName`:\n%s\n", responseContent) -} diff --git a/examples/v2/microsoft-teams-integration/GetApiHandleByName.go b/examples/v2/microsoft-teams-integration/GetTenantBasedHandle.go similarity index 75% rename from examples/v2/microsoft-teams-integration/GetApiHandleByName.go rename to examples/v2/microsoft-teams-integration/GetTenantBasedHandle.go index 23fb4675db9..87131ea4ab5 100644 --- a/examples/v2/microsoft-teams-integration/GetApiHandleByName.go +++ b/examples/v2/microsoft-teams-integration/GetTenantBasedHandle.go @@ -1,4 +1,4 @@ -// Get handle information by name returns "OK" response +// Get tenant-based handle information returns "OK" response package main @@ -17,13 +17,13 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.GetApiHandleByName(ctx, "handle_name") + resp, r, err := api.GetTenantBasedHandle(ctx, "handle_id") if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetApiHandleByName`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetApiHandleByName`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.go b/examples/v2/microsoft-teams-integration/GetTenantBasedHandle_2883785101.go similarity index 71% rename from examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.go rename to examples/v2/microsoft-teams-integration/GetTenantBasedHandle_2883785101.go index 128e09e3913..f122ee287e6 100644 --- a/examples/v2/microsoft-teams-integration/GetApiHandle_2883785101.go +++ b/examples/v2/microsoft-teams-integration/GetTenantBasedHandle_2883785101.go @@ -13,20 +13,20 @@ import ( ) func main() { - // there is a valid "api_handle" in the system - APIHandleDataID := os.Getenv("API_HANDLE_DATA_ID") + // there is a valid "tenant_based_handle" in the system + TenantBasedHandleDataID := os.Getenv("TENANT_BASED_HANDLE_DATA_ID") ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.GetApiHandle(ctx, APIHandleDataID) + resp, r, err := api.GetTenantBasedHandle(ctx, TenantBasedHandleDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/ListApiHandles.go b/examples/v2/microsoft-teams-integration/ListApiHandles.go deleted file mode 100644 index 0934c8dae56..00000000000 --- a/examples/v2/microsoft-teams-integration/ListApiHandles.go +++ /dev/null @@ -1,29 +0,0 @@ -// Get all handles returns "OK" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.ListApiHandles(ctx, *datadogV2.NewListApiHandlesOptionalParameters()) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.ListApiHandles`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.ListApiHandles`:\n%s\n", responseContent) -} diff --git a/examples/v2/microsoft-teams-integration/GetApiHandle.go b/examples/v2/microsoft-teams-integration/ListTenantBasedHandles.go similarity index 72% rename from examples/v2/microsoft-teams-integration/GetApiHandle.go rename to examples/v2/microsoft-teams-integration/ListTenantBasedHandles.go index 598ce342f58..c6179c28ebb 100644 --- a/examples/v2/microsoft-teams-integration/GetApiHandle.go +++ b/examples/v2/microsoft-teams-integration/ListTenantBasedHandles.go @@ -1,4 +1,4 @@ -// Get handle information returns "OK" response +// Get all tenant-based handles returns "OK" response package main @@ -17,13 +17,13 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.GetApiHandle(ctx, "handle_id") + resp, r, err := api.ListTenantBasedHandles(ctx, *datadogV2.NewListTenantBasedHandlesOptionalParameters()) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.GetApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.ListTenantBasedHandles`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.GetApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.ListTenantBasedHandles`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/ListApiHandles_769592979.go b/examples/v2/microsoft-teams-integration/ListTenantBasedHandles_769592979.go similarity index 77% rename from examples/v2/microsoft-teams-integration/ListApiHandles_769592979.go rename to examples/v2/microsoft-teams-integration/ListTenantBasedHandles_769592979.go index 4c7adf913f2..1a3006ca370 100644 --- a/examples/v2/microsoft-teams-integration/ListApiHandles_769592979.go +++ b/examples/v2/microsoft-teams-integration/ListTenantBasedHandles_769592979.go @@ -17,13 +17,13 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.ListApiHandles(ctx, *datadogV2.NewListApiHandlesOptionalParameters()) + resp, r, err := api.ListTenantBasedHandles(ctx, *datadogV2.NewListTenantBasedHandlesOptionalParameters()) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.ListApiHandles`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.ListTenantBasedHandles`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.ListApiHandles`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.ListTenantBasedHandles`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/UpdateApiHandle.go b/examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle.go similarity index 65% rename from examples/v2/microsoft-teams-integration/UpdateApiHandle.go rename to examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle.go index da6a68ea4e3..df156c69968 100644 --- a/examples/v2/microsoft-teams-integration/UpdateApiHandle.go +++ b/examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle.go @@ -1,4 +1,4 @@ -// Update handle returns "OK" response +// Update tenant-based handle returns "OK" response package main @@ -13,28 +13,28 @@ import ( ) func main() { - body := datadogV2.MicrosoftTeamsUpdateApiHandleRequest{ - Data: datadogV2.MicrosoftTeamsUpdateApiHandleRequestData{ - Attributes: datadogV2.MicrosoftTeamsApiHandleAttributes{ + body := datadogV2.MicrosoftTeamsUpdateTenantBasedHandleRequest{ + Data: datadogV2.MicrosoftTeamsUpdateTenantBasedHandleRequestData{ + Attributes: datadogV2.MicrosoftTeamsTenantBasedHandleAttributes{ ChannelId: datadog.PtrString("fake-channel-id"), Name: datadog.PtrString("fake-handle-name"), TeamId: datadog.PtrString("00000000-0000-0000-0000-000000000000"), TenantId: datadog.PtrString("00000000-0000-0000-0000-000000000001"), }, - Type: datadogV2.MICROSOFTTEAMSAPIHANDLETYPE_HANDLE, + Type: datadogV2.MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.UpdateApiHandle(ctx, "handle_id", body) + resp, r, err := api.UpdateTenantBasedHandle(ctx, "handle_id", body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.UpdateApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.UpdateApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.go b/examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle_419892746.go similarity index 57% rename from examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.go rename to examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle_419892746.go index 46c74aaf827..86cbdf0192f 100644 --- a/examples/v2/microsoft-teams-integration/UpdateApiHandle_419892746.go +++ b/examples/v2/microsoft-teams-integration/UpdateTenantBasedHandle_419892746.go @@ -13,28 +13,28 @@ import ( ) func main() { - // there is a valid "api_handle" in the system - APIHandleDataID := os.Getenv("API_HANDLE_DATA_ID") + // there is a valid "tenant_based_handle" in the system + TenantBasedHandleDataID := os.Getenv("TENANT_BASED_HANDLE_DATA_ID") - body := datadogV2.MicrosoftTeamsUpdateApiHandleRequest{ - Data: datadogV2.MicrosoftTeamsUpdateApiHandleRequestData{ - Attributes: datadogV2.MicrosoftTeamsApiHandleAttributes{ + body := datadogV2.MicrosoftTeamsUpdateTenantBasedHandleRequest{ + Data: datadogV2.MicrosoftTeamsUpdateTenantBasedHandleRequestData{ + Attributes: datadogV2.MicrosoftTeamsTenantBasedHandleAttributes{ Name: datadog.PtrString("fake-handle-name--updated"), }, - Type: datadogV2.MICROSOFTTEAMSAPIHANDLETYPE_HANDLE, + Type: datadogV2.MICROSOFTTEAMSTENANTBASEDHANDLETYPE_TENANT_BASED_HANDLE, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMicrosoftTeamsIntegrationApi(apiClient) - resp, r, err := api.UpdateApiHandle(ctx, APIHandleDataID, body) + resp, r, err := api.UpdateTenantBasedHandle(ctx, TenantBasedHandleDataID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.UpdateApiHandle`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.UpdateApiHandle`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle`:\n%s\n", responseContent) } diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.freeze deleted file mode 100644 index 032d18d1ad2..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:03.835Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.yaml deleted file mode 100644 index f0129356a6e..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Create_api_handle_returns_CREATED_response.yaml +++ /dev/null @@ -1,37 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 1 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4d853924-8004-11ef-a396-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.freeze deleted file mode 100644 index c424a36934c..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:04.126Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.yaml deleted file mode 100644 index 42c684d8981..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Delete_api_handle_returns_OK_response.yaml +++ /dev/null @@ -1,52 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 1 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4da666b2-8004-11ef-a397-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4da666b2-8004-11ef-a397-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.freeze deleted file mode 100644 index e2451a0ca56..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:04.412Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.yaml deleted file mode 100644 index db9170b11b7..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_all_api_handles_returns_OK_response.yaml +++ /dev/null @@ -1,61 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 1 - method: GET - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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."}}]}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4dd2b640-8004-11ef-a398-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.freeze deleted file mode 100644 index f659c7f4956..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:04.773Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.yaml deleted file mode 100644 index cbeccaeab5e..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_by_name_returns_OK_response.yaml +++ /dev/null @@ -1,56 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 1 - method: GET - url: 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: '{"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."}}}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e084346-8004-11ef-b4b6-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.freeze deleted file mode 100644 index 712c03f8798..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:05.113Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.yaml deleted file mode 100644 index 2e763d17e0a..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Get_api_handle_information_returns_OK_response.yaml +++ /dev/null @@ -1,56 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 1 - method: GET - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e3c0816-8004-11ef-b813-da7ad0900002 - response: - body: '{"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."}}}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e3c0816-8004-11ef-b813-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.freeze deleted file mode 100644 index af5a435fda0..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T14:49:05.470Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.yaml deleted file mode 100644 index f372be7b75d..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Microsoft_Teams_Integration/Scenario_Update_api_handle_returns_OK_response.yaml +++ /dev/null @@ -1,59 +0,0 @@ -interactions: -- request: - body: | - {"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"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles - response: - body: '{"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"}}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Update_api_handle_returns_OK_response-1727794145--updated"},"type":"handle"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 1 - method: PATCH - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e741fa8-8004-11ef-8fa4-da7ad0900002 - response: - body: '{"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."}}}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/integration/ms-teams/configuration/tenant-based-handles/4e741fa8-8004-11ef-8fa4-da7ad0900002 - response: - body: '' - code: 204 - duration: 0ms - headers: {} - status: 204 No Content -version: 2 diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index d3652a2a757..efc7bed91b5 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -216,13 +216,13 @@ "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}" + "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\": \"tenant-based-handle\"\n }\n}" } ], - "step": "there is a valid \"api_handle\" in the system", - "key": "api_handle", + "step": "there is a valid \"tenant_based_handle\" in the system", + "key": "tenant_based_handle", "tag": "Microsoft Teams Integration", - "operationId": "CreateApiHandle" + "operationId": "CreateTenantBasedHandle" }, { "parameters": [ diff --git a/tests/scenarios/features/v2/microsoft_teams_integration.feature b/tests/scenarios/features/v2/microsoft_teams_integration.feature index f1a34862f85..59f31993a73 100644 --- a/tests/scenarios/features/v2/microsoft_teams_integration.feature +++ b/tests/scenarios/features/v2/microsoft_teams_integration.feature @@ -10,132 +10,121 @@ Feature: Microsoft Teams Integration And a valid "appKeyAuth" key in the system And an instance of "MicrosoftTeamsIntegration" API - @team:DataDog/chat-integrations + @integration-only @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"}} + Given new "CreateTenantBasedHandle" 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": "tenant-based-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"}} + Scenario: Create tenant-based handle returns "Bad Request" response + Given new "CreateTenantBasedHandle" 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": "tenant-based-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"}} + Scenario: Create tenant-based handle returns "CREATED" response + Given new "CreateTenantBasedHandle" 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": "tenant-based-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"}} + Scenario: Create tenant-based handle returns "Conflict" response + Given new "CreateTenantBasedHandle" 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": "tenant-based-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"}} + Scenario: Create tenant-based handle returns "Failed Precondition" response + Given new "CreateTenantBasedHandle" 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": "tenant-based-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"}} + Scenario: Create tenant-based handle returns "Not Found" response + Given new "CreateTenantBasedHandle" 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": "tenant-based-handle"}} When the request is sent Then the response status is 404 Not Found - @team:DataDog/chat-integrations + @integration-only @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" + Given there is a valid "tenant_based_handle" in the system + And new "DeleteTenantBasedHandle" request + And request contains "handle_id" parameter from "tenant_based_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 + Scenario: Delete tenant-based handle returns "Bad Request" response + Given new "DeleteTenantBasedHandle" 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 + Scenario: Delete tenant-based handle returns "Failed Precondition" response + Given new "DeleteTenantBasedHandle" 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 + Scenario: Delete tenant-based handle returns "OK" response + Given new "DeleteTenantBasedHandle" 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 + @integration-only @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 + Given there is a valid "tenant_based_handle" in the system + And new "ListTenantBasedHandles" 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" + And the response "data[0].type" is equal to "ms-teams-tenant-based-handle-info" @generated @skip @team:DataDog/chat-integrations - Scenario: Get all handles returns "Bad Request" response - Given new "ListApiHandles" request + Scenario: Get all tenant-based handles returns "Bad Request" response + Given new "ListTenantBasedHandles" 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 + Scenario: Get all tenant-based handles returns "Failed Precondition" response + Given new "ListTenantBasedHandles" 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 + Scenario: Get all tenant-based handles returns "Not Found" response + Given new "ListTenantBasedHandles" 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 + Scenario: Get all tenant-based handles returns "OK" response + Given new "ListTenantBasedHandles" 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 + @integration-only @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" + Given there is a valid "tenant_based_handle" in the system + And new "GetTenantBasedHandle" request + And request contains "handle_id" parameter from "tenant_based_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" + And the response "data.attributes.name" has the same value as "tenant_based_handle.data.attributes.name" + And the response "data.attributes.channel_id" has the same value as "tenant_based_handle.data.attributes.channel_id" + And the response "data.attributes.team_id" has the same value as "tenant_based_handle.data.attributes.team_id" + And the response "data.attributes.tenant_id" has the same value as "tenant_based_handle.data.attributes.tenant_id" @generated @skip @team:DataDog/chat-integrations Scenario: Get channel information by name returns "Bad Request" response @@ -165,107 +154,79 @@ Feature: Microsoft Teams Integration 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 + Scenario: Get tenant-based handle information returns "Bad Request" response + Given new "GetTenantBasedHandle" 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 + Scenario: Get tenant-based handle information returns "Failed Precondition" response + Given new "GetTenantBasedHandle" 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 + Scenario: Get tenant-based handle information returns "Not Found" response + Given new "GetTenantBasedHandle" 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 + Scenario: Get tenant-based handle information returns "OK" response + Given new "GetTenantBasedHandle" 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 + @integration-only @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"}} + Given there is a valid "tenant_based_handle" in the system + And new "UpdateTenantBasedHandle" request + And request contains "handle_id" parameter from "tenant_based_handle.data.id" + And body with value {"data": {"attributes": {"name": "{{tenant_based_handle.data.attributes.name}}--updated"}, "type": "tenant-based-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" + And the response "data.attributes.name" is equal to "{{tenant_based_handle.data.attributes.name}}--updated" @generated @skip @team:DataDog/chat-integrations - Scenario: Update handle returns "Bad Request" response - Given new "UpdateApiHandle" request + Scenario: Update tenant-based handle returns "Bad Request" response + Given new "UpdateTenantBasedHandle" 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"}} + 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": "tenant-based-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 + Scenario: Update tenant-based handle returns "Conflict" response + Given new "UpdateTenantBasedHandle" 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"}} + 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": "tenant-based-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 + Scenario: Update tenant-based handle returns "Failed Precondition" response + Given new "UpdateTenantBasedHandle" 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"}} + 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": "tenant-based-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 + Scenario: Update tenant-based handle returns "Not Found" response + Given new "UpdateTenantBasedHandle" 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"}} + 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": "tenant-based-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 + Scenario: Update tenant-based handle returns "OK" response + Given new "UpdateTenantBasedHandle" 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"}} + 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": "tenant-based-handle"}} When the request is sent Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 66c71e9fbb3..62da7c99ef9 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -794,16 +794,16 @@ "type": "safe" } }, - "ListApiHandles": { + "ListTenantBasedHandles": { "tag": "Microsoft Teams Integration", "undo": { "type": "safe" } }, - "CreateApiHandle": { + "CreateTenantBasedHandle": { "tag": "Microsoft Teams Integration", "undo": { - "operationId": "DeleteApiHandle", + "operationId": "DeleteTenantBasedHandle", "parameters": [ { "name": "handle_id", @@ -813,25 +813,19 @@ "type": "unsafe" } }, - "GetApiHandleByName": { - "tag": "Microsoft Teams Integration", - "undo": { - "type": "safe" - } - }, - "DeleteApiHandle": { + "DeleteTenantBasedHandle": { "tag": "Microsoft Teams Integration", "undo": { "type": "idempotent" } }, - "GetApiHandle": { + "GetTenantBasedHandle": { "tag": "Microsoft Teams Integration", "undo": { "type": "safe" } }, - "UpdateApiHandle": { + "UpdateTenantBasedHandle": { "tag": "Microsoft Teams Integration", "undo": { "type": "idempotent"