diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5fb172fd364..f9e16964b1d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -698,28 +698,6 @@ components: schema: example: "ExampleServiceName" type: string - IncidentTeamIDPathParameter: - description: The ID of the incident team. - in: path - name: team_id - required: true - schema: - type: string - IncidentTeamIncludeQueryParameter: - description: Specifies which types of related objects should be included in the response. - in: query - name: "include" - required: false - schema: - $ref: "#/components/schemas/IncidentRelatedObject" - IncidentTeamSearchQueryParameter: - description: A search query that filters teams by name. - in: query - name: "filter" - required: false - schema: - example: "ExampleTeamName" - type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -34692,158 +34670,6 @@ components: - SEV_3 - SEV_4 - SEV_5 - IncidentTeamCreateAttributes: - description: The incident team's attributes for a create request. - properties: - name: - description: Name of the incident team. - example: "team name" - type: string - required: - - name - type: object - IncidentTeamCreateData: - description: Incident Team data for a create request. - properties: - attributes: - $ref: "#/components/schemas/IncidentTeamCreateAttributes" - relationships: - $ref: "#/components/schemas/IncidentTeamRelationships" - type: - $ref: "#/components/schemas/IncidentTeamType" - required: - - type - type: object - IncidentTeamCreateRequest: - description: Create request with an incident team payload. - properties: - data: - $ref: "#/components/schemas/IncidentTeamCreateData" - required: - - data - type: object - IncidentTeamIncludedItems: - description: An object related to an incident team which is present in the included payload. - oneOf: - - $ref: "#/components/schemas/User" - IncidentTeamRelationships: - description: The incident team's relationships. - properties: - created_by: - $ref: "#/components/schemas/RelationshipToUser" - last_modified_by: - $ref: "#/components/schemas/RelationshipToUser" - readOnly: true - type: object - IncidentTeamResponse: - description: Response with an incident team payload. - properties: - data: - $ref: "#/components/schemas/IncidentTeamResponseData" - included: - description: Included objects from relationships. - items: - $ref: "#/components/schemas/IncidentTeamIncludedItems" - readOnly: true - type: array - required: - - data - type: object - IncidentTeamResponseAttributes: - description: The incident team's attributes from a response. - properties: - created: - description: Timestamp of when the incident team was created. - format: date-time - readOnly: true - type: string - modified: - description: Timestamp of when the incident team was modified. - format: date-time - readOnly: true - type: string - name: - description: Name of the incident team. - example: "team name" - type: string - type: object - IncidentTeamResponseData: - description: Incident Team data from a response. - properties: - attributes: - $ref: "#/components/schemas/IncidentTeamResponseAttributes" - id: - description: The incident team's ID. - example: "00000000-7ea3-0000-000a-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentTeamRelationships" - type: - $ref: "#/components/schemas/IncidentTeamType" - type: object - IncidentTeamType: - default: teams - description: Incident Team resource type. - enum: - - teams - example: teams - type: string - x-enum-varnames: - - TEAMS - IncidentTeamUpdateAttributes: - description: The incident team's attributes for an update request. - properties: - name: - description: Name of the incident team. - example: "team name" - type: string - required: - - name - type: object - IncidentTeamUpdateData: - description: Incident Team data for an update request. - properties: - attributes: - $ref: "#/components/schemas/IncidentTeamUpdateAttributes" - id: - description: The incident team's ID. - example: "00000000-7ea3-0000-0001-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentTeamRelationships" - type: - $ref: "#/components/schemas/IncidentTeamType" - required: - - type - type: object - IncidentTeamUpdateRequest: - description: Update request with an incident team payload. - properties: - data: - $ref: "#/components/schemas/IncidentTeamUpdateData" - required: - - data - type: object - IncidentTeamsResponse: - description: Response with a list of incident team payloads. - properties: - data: - description: An array of incident teams. - example: [{"attributes": {"name": "team name"}, "id": "00000000-7ea3-0000-0000-000000000000", "type": "teams"}] - items: - $ref: "#/components/schemas/IncidentTeamResponseData" - type: array - included: - description: Included related resources which the user requested. - items: - $ref: "#/components/schemas/IncidentTeamIncludedItems" - readOnly: true - type: array - meta: - $ref: "#/components/schemas/IncidentResponseMeta" - required: - - data - type: "object" IncidentTimelineCellCreateAttributes: description: The timeline cell's attributes for a create request. oneOf: @@ -143086,276 +142912,6 @@ paths: operator: OR permissions: - teams_read - /api/v2/teams: - get: - deprecated: true - description: >- - Get all incident teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident teams. - operationId: ListIncidentTeams - parameters: - - $ref: "#/components/parameters/IncidentTeamIncludeQueryParameter" - - $ref: "#/components/parameters/PageSize" - - $ref: "#/components/parameters/PageOffset" - - $ref: "#/components/parameters/IncidentTeamSearchQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - name: team name - id: 00000000-0000-0000-0000-000000000002 - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamsResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get a list of all incident teams - tags: - - Incident Teams - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/). - post: - deprecated: true - description: Creates a new incident team. - operationId: CreateIncidentTeam - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: team name - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamCreateRequest" - description: Incident Team Payload. - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: team name - id: 00000000-0000-0000-0000-000000000001 - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamResponse" - description: CREATED - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Create a new incident team - tags: - - Incident Teams - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/). - /api/v2/teams/{team_id}: - delete: - deprecated: true - description: Deletes an existing incident team. - operationId: DeleteIncidentTeam - parameters: - - $ref: "#/components/parameters/IncidentTeamIDPathParameter" - responses: - "204": - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Delete an existing incident team - tags: - - Incident Teams - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/). - get: - deprecated: true - description: |- - Get details of an incident team. If the `include[users]` query parameter is provided, - the included attribute will contain the users related to these incident teams. - operationId: GetIncidentTeam - parameters: - - $ref: "#/components/parameters/IncidentTeamIDPathParameter" - - $ref: "#/components/parameters/IncidentTeamIncludeQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: team name - id: 00000000-0000-0000-0000-000000000004 - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get details of an incident team - tags: - - Incident Teams - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/). - patch: - deprecated: true - description: >- - Updates an existing incident team. Only provide the attributes which should be updated as this request is a partial update. - operationId: UpdateIncidentTeam - parameters: - - $ref: "#/components/parameters/IncidentTeamIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: team name - id: 00000000-7ea3-0000-0001-000000000000 - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamUpdateRequest" - description: Incident Team Payload. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: team name - id: 00000000-0000-0000-0000-000000000003 - type: teams - schema: - $ref: "#/components/schemas/IncidentTeamResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Update an existing incident team - tags: - - Incident Teams - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/). /api/v2/test/flaky-test-management/tests: patch: description: |- @@ -146093,8 +145649,6 @@ tags: name: IP Allowlist - description: Create, update, delete, and retrieve services which can be associated with incidents. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incident Services - - description: The Incident Teams endpoints are deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/) to create, update, delete, and retrieve teams which can be associated with incidents. - name: Incident Teams - description: Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents - description: |- diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index b2e71d5b30d..1e1620319e4 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -927,11 +927,6 @@ func NewConfiguration() *Configuration { "v2.AddMemberTeam": false, "v2.ListMemberTeams": false, "v2.RemoveMemberTeam": false, - "v2.CreateIncidentTeam": false, - "v2.DeleteIncidentTeam": false, - "v2.GetIncidentTeam": false, - "v2.ListIncidentTeams": false, - "v2.UpdateIncidentTeam": false, }, RetryConfiguration: RetryConfiguration{ EnableRetry: false, diff --git a/api/datadogV2/api_incident_teams.go b/api/datadogV2/api_incident_teams.go deleted file mode 100644 index 79a6ea617d3..00000000000 --- a/api/datadogV2/api_incident_teams.go +++ /dev/null @@ -1,551 +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 ( - _context "context" - _fmt "fmt" - _log "log" - _nethttp "net/http" - _neturl "net/url" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// IncidentTeamsApi service type -type IncidentTeamsApi datadog.Service - -// CreateIncidentTeam Create a new incident team. -// Creates a new incident team. -// -// Deprecated: This API is deprecated. -func (a *IncidentTeamsApi) CreateIncidentTeam(ctx _context.Context, body IncidentTeamCreateRequest) (IncidentTeamResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue IncidentTeamResponse - ) - - operationId := "v2.CreateIncidentTeam" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentTeamsApi.CreateIncidentTeam") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/teams" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" - - // body params - localVarPostBody = &body - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return localVarReturnValue, nil, err - } - } else { - 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 == 401 || 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 -} - -// DeleteIncidentTeam Delete an existing incident team. -// Deletes an existing incident team. -// -// Deprecated: This API is deprecated. -func (a *IncidentTeamsApi) DeleteIncidentTeam(ctx _context.Context, teamId string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - ) - - operationId := "v2.DeleteIncidentTeam" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentTeamsApi.DeleteIncidentTeam") - if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" - - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return nil, err - } - } else { - 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 nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || 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 localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// GetIncidentTeamOptionalParameters holds optional parameters for GetIncidentTeam. -type GetIncidentTeamOptionalParameters struct { - Include *IncidentRelatedObject -} - -// NewGetIncidentTeamOptionalParameters creates an empty struct for parameters. -func NewGetIncidentTeamOptionalParameters() *GetIncidentTeamOptionalParameters { - this := GetIncidentTeamOptionalParameters{} - return &this -} - -// WithInclude sets the corresponding parameter name and returns the struct. -func (r *GetIncidentTeamOptionalParameters) WithInclude(include IncidentRelatedObject) *GetIncidentTeamOptionalParameters { - r.Include = &include - return r -} - -// GetIncidentTeam Get details of an incident team. -// Get details of an incident team. If the `include[users]` query parameter is provided, -// the included attribute will contain the users related to these incident teams. -// -// Deprecated: This API is deprecated. -func (a *IncidentTeamsApi) GetIncidentTeam(ctx _context.Context, teamId string, o ...GetIncidentTeamOptionalParameters) (IncidentTeamResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue IncidentTeamResponse - optionalParams GetIncidentTeamOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetIncidentTeamOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - operationId := "v2.GetIncidentTeam" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentTeamsApi.GetIncidentTeam") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if optionalParams.Include != nil { - localVarQueryParams.Add("include", datadog.ParameterToString(*optionalParams.Include, "")) - } - localVarHeaderParams["Accept"] = "application/json" - - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return localVarReturnValue, nil, err - } - } else { - 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 == 401 || 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 -} - -// ListIncidentTeamsOptionalParameters holds optional parameters for ListIncidentTeams. -type ListIncidentTeamsOptionalParameters struct { - Include *IncidentRelatedObject - PageSize *int64 - PageOffset *int64 - Filter *string -} - -// NewListIncidentTeamsOptionalParameters creates an empty struct for parameters. -func NewListIncidentTeamsOptionalParameters() *ListIncidentTeamsOptionalParameters { - this := ListIncidentTeamsOptionalParameters{} - return &this -} - -// WithInclude sets the corresponding parameter name and returns the struct. -func (r *ListIncidentTeamsOptionalParameters) WithInclude(include IncidentRelatedObject) *ListIncidentTeamsOptionalParameters { - r.Include = &include - return r -} - -// WithPageSize sets the corresponding parameter name and returns the struct. -func (r *ListIncidentTeamsOptionalParameters) WithPageSize(pageSize int64) *ListIncidentTeamsOptionalParameters { - r.PageSize = &pageSize - return r -} - -// WithPageOffset sets the corresponding parameter name and returns the struct. -func (r *ListIncidentTeamsOptionalParameters) WithPageOffset(pageOffset int64) *ListIncidentTeamsOptionalParameters { - r.PageOffset = &pageOffset - return r -} - -// WithFilter sets the corresponding parameter name and returns the struct. -func (r *ListIncidentTeamsOptionalParameters) WithFilter(filter string) *ListIncidentTeamsOptionalParameters { - r.Filter = &filter - return r -} - -// ListIncidentTeams Get a list of all incident teams. -// Get all incident teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident teams. -// -// Deprecated: This API is deprecated. -func (a *IncidentTeamsApi) ListIncidentTeams(ctx _context.Context, o ...ListIncidentTeamsOptionalParameters) (IncidentTeamsResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue IncidentTeamsResponse - optionalParams ListIncidentTeamsOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListIncidentTeamsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - operationId := "v2.ListIncidentTeams" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentTeamsApi.ListIncidentTeams") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/teams" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if optionalParams.Include != nil { - localVarQueryParams.Add("include", datadog.ParameterToString(*optionalParams.Include, "")) - } - if optionalParams.PageSize != nil { - localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) - } - if optionalParams.PageOffset != nil { - localVarQueryParams.Add("page[offset]", datadog.ParameterToString(*optionalParams.PageOffset, "")) - } - if optionalParams.Filter != nil { - localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) - } - localVarHeaderParams["Accept"] = "application/json" - - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return localVarReturnValue, nil, err - } - } else { - 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 == 401 || 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 -} - -// UpdateIncidentTeam Update an existing incident team. -// Updates an existing incident team. Only provide the attributes which should be updated as this request is a partial update. -// -// Deprecated: This API is deprecated. -func (a *IncidentTeamsApi) UpdateIncidentTeam(ctx _context.Context, teamId string, body IncidentTeamUpdateRequest) (IncidentTeamResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue IncidentTeamResponse - ) - - operationId := "v2.UpdateIncidentTeam" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentTeamsApi.UpdateIncidentTeam") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" - - // body params - localVarPostBody = &body - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return localVarReturnValue, nil, err - } - } else { - 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 == 401 || 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 -} - -// NewIncidentTeamsApi Returns NewIncidentTeamsApi. -func NewIncidentTeamsApi(client *datadog.APIClient) *IncidentTeamsApi { - return &IncidentTeamsApi{ - Client: client, - } -} diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index ce6e493e6c9..db22e6d0c42 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -360,11 +360,6 @@ // - [IncidentServicesApi.GetIncidentService] // - [IncidentServicesApi.ListIncidentServices] // - [IncidentServicesApi.UpdateIncidentService] -// - [IncidentTeamsApi.CreateIncidentTeam] -// - [IncidentTeamsApi.DeleteIncidentTeam] -// - [IncidentTeamsApi.GetIncidentTeam] -// - [IncidentTeamsApi.ListIncidentTeams] -// - [IncidentTeamsApi.UpdateIncidentTeam] // - [IncidentsApi.CreateGlobalIncidentHandle] // - [IncidentsApi.CreateIncident] // - [IncidentsApi.CreateIncidentAttachment] diff --git a/api/datadogV2/model_incident_team_create_attributes.go b/api/datadogV2/model_incident_team_create_attributes.go deleted file mode 100644 index 2e4db05c58f..00000000000 --- a/api/datadogV2/model_incident_team_create_attributes.go +++ /dev/null @@ -1,101 +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" -) - -// IncidentTeamCreateAttributes The incident team's attributes for a create request. -type IncidentTeamCreateAttributes struct { - // Name of the incident team. - Name string `json:"name"` - // 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:"-"` -} - -// NewIncidentTeamCreateAttributes instantiates a new IncidentTeamCreateAttributes 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 NewIncidentTeamCreateAttributes(name string) *IncidentTeamCreateAttributes { - this := IncidentTeamCreateAttributes{} - this.Name = name - return &this -} - -// NewIncidentTeamCreateAttributesWithDefaults instantiates a new IncidentTeamCreateAttributes 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 NewIncidentTeamCreateAttributesWithDefaults() *IncidentTeamCreateAttributes { - this := IncidentTeamCreateAttributes{} - return &this -} - -// GetName returns the Name field value. -func (o *IncidentTeamCreateAttributes) GetName() string { - if o == nil { - var ret string - return ret - } - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamCreateAttributes) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value. -func (o *IncidentTeamCreateAttributes) SetName(v string) { - o.Name = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamCreateAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["name"] = o.Name - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Name *string `json:"name"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Name == nil { - return fmt.Errorf("required field name missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"name"}) - } else { - return err - } - o.Name = *all.Name - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_create_data.go b/api/datadogV2/model_incident_team_create_data.go deleted file mode 100644 index 66d6ab05858..00000000000 --- a/api/datadogV2/model_incident_team_create_data.go +++ /dev/null @@ -1,189 +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" -) - -// IncidentTeamCreateData Incident Team data for a create request. -type IncidentTeamCreateData struct { - // The incident team's attributes for a create request. - Attributes *IncidentTeamCreateAttributes `json:"attributes,omitempty"` - // The incident team's relationships. - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - // Incident Team resource type. - Type IncidentTeamType `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:"-"` -} - -// NewIncidentTeamCreateData instantiates a new IncidentTeamCreateData 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 NewIncidentTeamCreateData(typeVar IncidentTeamType) *IncidentTeamCreateData { - this := IncidentTeamCreateData{} - this.Type = typeVar - return &this -} - -// NewIncidentTeamCreateDataWithDefaults instantiates a new IncidentTeamCreateData 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 NewIncidentTeamCreateDataWithDefaults() *IncidentTeamCreateData { - this := IncidentTeamCreateData{} - var typeVar IncidentTeamType = INCIDENTTEAMTYPE_TEAMS - this.Type = typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *IncidentTeamCreateData) GetAttributes() IncidentTeamCreateAttributes { - if o == nil || o.Attributes == nil { - var ret IncidentTeamCreateAttributes - return ret - } - return *o.Attributes -} - -// 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 *IncidentTeamCreateData) GetAttributesOk() (*IncidentTeamCreateAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *IncidentTeamCreateData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given IncidentTeamCreateAttributes and assigns it to the Attributes field. -func (o *IncidentTeamCreateData) SetAttributes(v IncidentTeamCreateAttributes) { - o.Attributes = &v -} - -// GetRelationships returns the Relationships field value if set, zero value otherwise. -func (o *IncidentTeamCreateData) GetRelationships() IncidentTeamRelationships { - if o == nil || o.Relationships == nil { - var ret IncidentTeamRelationships - return ret - } - return *o.Relationships -} - -// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamCreateData) GetRelationshipsOk() (*IncidentTeamRelationships, bool) { - if o == nil || o.Relationships == nil { - return nil, false - } - return o.Relationships, true -} - -// HasRelationships returns a boolean if a field has been set. -func (o *IncidentTeamCreateData) HasRelationships() bool { - return o != nil && o.Relationships != nil -} - -// SetRelationships gets a reference to the given IncidentTeamRelationships and assigns it to the Relationships field. -func (o *IncidentTeamCreateData) SetRelationships(v IncidentTeamRelationships) { - o.Relationships = &v -} - -// GetType returns the Type field value. -func (o *IncidentTeamCreateData) GetType() IncidentTeamType { - if o == nil { - var ret IncidentTeamType - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamCreateData) GetTypeOk() (*IncidentTeamType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value. -func (o *IncidentTeamCreateData) SetType(v IncidentTeamType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamCreateData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Relationships != nil { - toSerialize["relationships"] = o.Relationships - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamCreateData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *IncidentTeamCreateAttributes `json:"attributes,omitempty"` - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - Type *IncidentTeamType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "relationships", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Relationships = all.Relationships - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_create_request.go b/api/datadogV2/model_incident_team_create_request.go deleted file mode 100644 index 4644a1c66d1..00000000000 --- a/api/datadogV2/model_incident_team_create_request.go +++ /dev/null @@ -1,110 +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" -) - -// IncidentTeamCreateRequest Create request with an incident team payload. -type IncidentTeamCreateRequest struct { - // Incident Team data for a create request. - Data IncidentTeamCreateData `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:"-"` -} - -// NewIncidentTeamCreateRequest instantiates a new IncidentTeamCreateRequest 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 NewIncidentTeamCreateRequest(data IncidentTeamCreateData) *IncidentTeamCreateRequest { - this := IncidentTeamCreateRequest{} - this.Data = data - return &this -} - -// NewIncidentTeamCreateRequestWithDefaults instantiates a new IncidentTeamCreateRequest 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 NewIncidentTeamCreateRequestWithDefaults() *IncidentTeamCreateRequest { - this := IncidentTeamCreateRequest{} - return &this -} - -// GetData returns the Data field value. -func (o *IncidentTeamCreateRequest) GetData() IncidentTeamCreateData { - if o == nil { - var ret IncidentTeamCreateData - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamCreateRequest) GetDataOk() (*IncidentTeamCreateData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value. -func (o *IncidentTeamCreateRequest) SetData(v IncidentTeamCreateData) { - o.Data = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamCreateRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["data"] = o.Data - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamCreateRequest) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *IncidentTeamCreateData `json:"data"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Data == nil { - return fmt.Errorf("required field data missing") - } - 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.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_incident_team_included_items.go b/api/datadogV2/model_incident_team_included_items.go deleted file mode 100644 index 03640d03550..00000000000 --- a/api/datadogV2/model_incident_team_included_items.go +++ /dev/null @@ -1,73 +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" -) - -// IncidentTeamIncludedItems - An object related to an incident team which is present in the included payload. -type IncidentTeamIncludedItems struct { - User *User - - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject interface{} -} - -// UserAsIncidentTeamIncludedItems is a convenience function that returns User wrapped in IncidentTeamIncludedItems. -func UserAsIncidentTeamIncludedItems(v *User) IncidentTeamIncludedItems { - return IncidentTeamIncludedItems{User: v} -} - -// UnmarshalJSON turns data into one of the pointers in the struct. -func (obj *IncidentTeamIncludedItems) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into User - err = datadog.Unmarshal(data, &obj.User) - if err == nil { - if obj.User != nil && obj.User.UnparsedObject == nil { - jsonUser, _ := datadog.Marshal(obj.User) - if string(jsonUser) == "{}" && string(data) != "{}" { // empty struct - obj.User = nil - } else { - match++ - } - } else { - obj.User = nil - } - } else { - obj.User = nil - } - - if match != 1 { // more than 1 match - // reset to nil - obj.User = nil - return datadog.Unmarshal(data, &obj.UnparsedObject) - } - return nil // exactly one match -} - -// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. -func (obj IncidentTeamIncludedItems) MarshalJSON() ([]byte, error) { - if obj.User != nil { - return datadog.Marshal(&obj.User) - } - - if obj.UnparsedObject != nil { - return datadog.Marshal(obj.UnparsedObject) - } - return nil, nil // no data in oneOf schemas -} - -// GetActualInstance returns the actual instance. -func (obj *IncidentTeamIncludedItems) GetActualInstance() interface{} { - if obj.User != nil { - return obj.User - } - - // all schemas are nil - return nil -} diff --git a/api/datadogV2/model_incident_team_relationships.go b/api/datadogV2/model_incident_team_relationships.go deleted file mode 100644 index c9e49e22580..00000000000 --- a/api/datadogV2/model_incident_team_relationships.go +++ /dev/null @@ -1,149 +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" -) - -// IncidentTeamRelationships The incident team's relationships. -type IncidentTeamRelationships struct { - // Relationship to user. - CreatedBy *RelationshipToUser `json:"created_by,omitempty"` - // Relationship to user. - LastModifiedBy *RelationshipToUser `json:"last_modified_by,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:"-"` -} - -// NewIncidentTeamRelationships instantiates a new IncidentTeamRelationships 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 NewIncidentTeamRelationships() *IncidentTeamRelationships { - this := IncidentTeamRelationships{} - return &this -} - -// NewIncidentTeamRelationshipsWithDefaults instantiates a new IncidentTeamRelationships 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 NewIncidentTeamRelationshipsWithDefaults() *IncidentTeamRelationships { - this := IncidentTeamRelationships{} - return &this -} - -// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. -func (o *IncidentTeamRelationships) GetCreatedBy() RelationshipToUser { - if o == nil || o.CreatedBy == nil { - var ret RelationshipToUser - return ret - } - return *o.CreatedBy -} - -// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamRelationships) GetCreatedByOk() (*RelationshipToUser, bool) { - if o == nil || o.CreatedBy == nil { - return nil, false - } - return o.CreatedBy, true -} - -// HasCreatedBy returns a boolean if a field has been set. -func (o *IncidentTeamRelationships) HasCreatedBy() bool { - return o != nil && o.CreatedBy != nil -} - -// SetCreatedBy gets a reference to the given RelationshipToUser and assigns it to the CreatedBy field. -func (o *IncidentTeamRelationships) SetCreatedBy(v RelationshipToUser) { - o.CreatedBy = &v -} - -// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. -func (o *IncidentTeamRelationships) GetLastModifiedBy() RelationshipToUser { - if o == nil || o.LastModifiedBy == nil { - var ret RelationshipToUser - return ret - } - return *o.LastModifiedBy -} - -// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamRelationships) GetLastModifiedByOk() (*RelationshipToUser, bool) { - if o == nil || o.LastModifiedBy == nil { - return nil, false - } - return o.LastModifiedBy, true -} - -// HasLastModifiedBy returns a boolean if a field has been set. -func (o *IncidentTeamRelationships) HasLastModifiedBy() bool { - return o != nil && o.LastModifiedBy != nil -} - -// SetLastModifiedBy gets a reference to the given RelationshipToUser and assigns it to the LastModifiedBy field. -func (o *IncidentTeamRelationships) SetLastModifiedBy(v RelationshipToUser) { - o.LastModifiedBy = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamRelationships) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.CreatedBy != nil { - toSerialize["created_by"] = o.CreatedBy - } - if o.LastModifiedBy != nil { - toSerialize["last_modified_by"] = o.LastModifiedBy - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamRelationships) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - CreatedBy *RelationshipToUser `json:"created_by,omitempty"` - LastModifiedBy *RelationshipToUser `json:"last_modified_by,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{"created_by", "last_modified_by"}) - } else { - return err - } - - hasInvalidField := false - if all.CreatedBy != nil && all.CreatedBy.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.CreatedBy = all.CreatedBy - if all.LastModifiedBy != nil && all.LastModifiedBy.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.LastModifiedBy = all.LastModifiedBy - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_response.go b/api/datadogV2/model_incident_team_response.go deleted file mode 100644 index 4ec0d91246e..00000000000 --- a/api/datadogV2/model_incident_team_response.go +++ /dev/null @@ -1,145 +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" -) - -// IncidentTeamResponse Response with an incident team payload. -type IncidentTeamResponse struct { - // Incident Team data from a response. - Data IncidentTeamResponseData `json:"data"` - // Included objects from relationships. - Included []IncidentTeamIncludedItems `json:"included,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:"-"` -} - -// NewIncidentTeamResponse instantiates a new IncidentTeamResponse 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 NewIncidentTeamResponse(data IncidentTeamResponseData) *IncidentTeamResponse { - this := IncidentTeamResponse{} - this.Data = data - return &this -} - -// NewIncidentTeamResponseWithDefaults instantiates a new IncidentTeamResponse 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 NewIncidentTeamResponseWithDefaults() *IncidentTeamResponse { - this := IncidentTeamResponse{} - return &this -} - -// GetData returns the Data field value. -func (o *IncidentTeamResponse) GetData() IncidentTeamResponseData { - if o == nil { - var ret IncidentTeamResponseData - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamResponse) GetDataOk() (*IncidentTeamResponseData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value. -func (o *IncidentTeamResponse) SetData(v IncidentTeamResponseData) { - o.Data = v -} - -// GetIncluded returns the Included field value if set, zero value otherwise. -func (o *IncidentTeamResponse) GetIncluded() []IncidentTeamIncludedItems { - if o == nil || o.Included == nil { - var ret []IncidentTeamIncludedItems - return ret - } - return o.Included -} - -// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamResponse) GetIncludedOk() (*[]IncidentTeamIncludedItems, bool) { - if o == nil || o.Included == nil { - return nil, false - } - return &o.Included, true -} - -// HasIncluded returns a boolean if a field has been set. -func (o *IncidentTeamResponse) HasIncluded() bool { - return o != nil && o.Included != nil -} - -// SetIncluded gets a reference to the given []IncidentTeamIncludedItems and assigns it to the Included field. -func (o *IncidentTeamResponse) SetIncluded(v []IncidentTeamIncludedItems) { - o.Included = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["data"] = o.Data - if o.Included != nil { - toSerialize["included"] = o.Included - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *IncidentTeamResponseData `json:"data"` - Included []IncidentTeamIncludedItems `json:"included,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Data == nil { - return fmt.Errorf("required field data missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "included"}) - } else { - return err - } - - hasInvalidField := false - if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = *all.Data - o.Included = all.Included - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_response_attributes.go b/api/datadogV2/model_incident_team_response_attributes.go deleted file mode 100644 index f759369eb91..00000000000 --- a/api/datadogV2/model_incident_team_response_attributes.go +++ /dev/null @@ -1,182 +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 ( - "time" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// IncidentTeamResponseAttributes The incident team's attributes from a response. -type IncidentTeamResponseAttributes struct { - // Timestamp of when the incident team was created. - Created *time.Time `json:"created,omitempty"` - // Timestamp of when the incident team was modified. - Modified *time.Time `json:"modified,omitempty"` - // Name of the incident team. - Name *string `json:"name,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:"-"` -} - -// NewIncidentTeamResponseAttributes instantiates a new IncidentTeamResponseAttributes 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 NewIncidentTeamResponseAttributes() *IncidentTeamResponseAttributes { - this := IncidentTeamResponseAttributes{} - return &this -} - -// NewIncidentTeamResponseAttributesWithDefaults instantiates a new IncidentTeamResponseAttributes 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 NewIncidentTeamResponseAttributesWithDefaults() *IncidentTeamResponseAttributes { - this := IncidentTeamResponseAttributes{} - return &this -} - -// GetCreated returns the Created field value if set, zero value otherwise. -func (o *IncidentTeamResponseAttributes) GetCreated() time.Time { - if o == nil || o.Created == nil { - var ret time.Time - return ret - } - return *o.Created -} - -// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamResponseAttributes) GetCreatedOk() (*time.Time, bool) { - if o == nil || o.Created == nil { - return nil, false - } - return o.Created, true -} - -// HasCreated returns a boolean if a field has been set. -func (o *IncidentTeamResponseAttributes) HasCreated() bool { - return o != nil && o.Created != nil -} - -// SetCreated gets a reference to the given time.Time and assigns it to the Created field. -func (o *IncidentTeamResponseAttributes) SetCreated(v time.Time) { - o.Created = &v -} - -// GetModified returns the Modified field value if set, zero value otherwise. -func (o *IncidentTeamResponseAttributes) GetModified() time.Time { - if o == nil || o.Modified == nil { - var ret time.Time - return ret - } - return *o.Modified -} - -// GetModifiedOk returns a tuple with the Modified field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamResponseAttributes) GetModifiedOk() (*time.Time, bool) { - if o == nil || o.Modified == nil { - return nil, false - } - return o.Modified, true -} - -// HasModified returns a boolean if a field has been set. -func (o *IncidentTeamResponseAttributes) HasModified() bool { - return o != nil && o.Modified != nil -} - -// SetModified gets a reference to the given time.Time and assigns it to the Modified field. -func (o *IncidentTeamResponseAttributes) SetModified(v time.Time) { - o.Modified = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *IncidentTeamResponseAttributes) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// 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 *IncidentTeamResponseAttributes) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *IncidentTeamResponseAttributes) 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 *IncidentTeamResponseAttributes) SetName(v string) { - o.Name = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamResponseAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Created != nil { - if o.Created.Nanosecond() == 0 { - toSerialize["created"] = o.Created.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["created"] = o.Created.Format("2006-01-02T15:04:05.000Z07:00") - } - } - if o.Modified != nil { - if o.Modified.Nanosecond() == 0 { - toSerialize["modified"] = o.Modified.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["modified"] = o.Modified.Format("2006-01-02T15:04:05.000Z07:00") - } - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Created *time.Time `json:"created,omitempty"` - Modified *time.Time `json:"modified,omitempty"` - Name *string `json:"name,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{"created", "modified", "name"}) - } else { - return err - } - o.Created = all.Created - o.Modified = all.Modified - o.Name = all.Name - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_response_data.go b/api/datadogV2/model_incident_team_response_data.go deleted file mode 100644 index c805ab22bf2..00000000000 --- a/api/datadogV2/model_incident_team_response_data.go +++ /dev/null @@ -1,227 +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" -) - -// IncidentTeamResponseData Incident Team data from a response. -type IncidentTeamResponseData struct { - // The incident team's attributes from a response. - Attributes *IncidentTeamResponseAttributes `json:"attributes,omitempty"` - // The incident team's ID. - Id *string `json:"id,omitempty"` - // The incident team's relationships. - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - // Incident Team resource type. - Type *IncidentTeamType `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:"-"` -} - -// NewIncidentTeamResponseData instantiates a new IncidentTeamResponseData 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 NewIncidentTeamResponseData() *IncidentTeamResponseData { - this := IncidentTeamResponseData{} - var typeVar IncidentTeamType = INCIDENTTEAMTYPE_TEAMS - this.Type = &typeVar - return &this -} - -// NewIncidentTeamResponseDataWithDefaults instantiates a new IncidentTeamResponseData 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 NewIncidentTeamResponseDataWithDefaults() *IncidentTeamResponseData { - this := IncidentTeamResponseData{} - var typeVar IncidentTeamType = INCIDENTTEAMTYPE_TEAMS - this.Type = &typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *IncidentTeamResponseData) GetAttributes() IncidentTeamResponseAttributes { - if o == nil || o.Attributes == nil { - var ret IncidentTeamResponseAttributes - return ret - } - return *o.Attributes -} - -// 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 *IncidentTeamResponseData) GetAttributesOk() (*IncidentTeamResponseAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *IncidentTeamResponseData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given IncidentTeamResponseAttributes and assigns it to the Attributes field. -func (o *IncidentTeamResponseData) SetAttributes(v IncidentTeamResponseAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *IncidentTeamResponseData) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// 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 *IncidentTeamResponseData) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *IncidentTeamResponseData) 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 *IncidentTeamResponseData) SetId(v string) { - o.Id = &v -} - -// GetRelationships returns the Relationships field value if set, zero value otherwise. -func (o *IncidentTeamResponseData) GetRelationships() IncidentTeamRelationships { - if o == nil || o.Relationships == nil { - var ret IncidentTeamRelationships - return ret - } - return *o.Relationships -} - -// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamResponseData) GetRelationshipsOk() (*IncidentTeamRelationships, bool) { - if o == nil || o.Relationships == nil { - return nil, false - } - return o.Relationships, true -} - -// HasRelationships returns a boolean if a field has been set. -func (o *IncidentTeamResponseData) HasRelationships() bool { - return o != nil && o.Relationships != nil -} - -// SetRelationships gets a reference to the given IncidentTeamRelationships and assigns it to the Relationships field. -func (o *IncidentTeamResponseData) SetRelationships(v IncidentTeamRelationships) { - o.Relationships = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *IncidentTeamResponseData) GetType() IncidentTeamType { - if o == nil || o.Type == nil { - var ret IncidentTeamType - return ret - } - return *o.Type -} - -// 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 *IncidentTeamResponseData) GetTypeOk() (*IncidentTeamType, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *IncidentTeamResponseData) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given IncidentTeamType and assigns it to the Type field. -func (o *IncidentTeamResponseData) SetType(v IncidentTeamType) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamResponseData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Relationships != nil { - toSerialize["relationships"] = o.Relationships - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamResponseData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *IncidentTeamResponseAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - Type *IncidentTeamType `json:"type,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{"attributes", "id", "relationships", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Relationships = all.Relationships - if all.Type != nil && !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_type.go b/api/datadogV2/model_incident_team_type.go deleted file mode 100644 index eb378db63eb..00000000000 --- a/api/datadogV2/model_incident_team_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" -) - -// IncidentTeamType Incident Team resource type. -type IncidentTeamType string - -// List of IncidentTeamType. -const ( - INCIDENTTEAMTYPE_TEAMS IncidentTeamType = "teams" -) - -var allowedIncidentTeamTypeEnumValues = []IncidentTeamType{ - INCIDENTTEAMTYPE_TEAMS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *IncidentTeamType) GetAllowedValues() []IncidentTeamType { - return allowedIncidentTeamTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *IncidentTeamType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = IncidentTeamType(value) - return nil -} - -// NewIncidentTeamTypeFromValue returns a pointer to a valid IncidentTeamType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewIncidentTeamTypeFromValue(v string) (*IncidentTeamType, error) { - ev := IncidentTeamType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for IncidentTeamType: valid values are %v", v, allowedIncidentTeamTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v IncidentTeamType) IsValid() bool { - for _, existing := range allowedIncidentTeamTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to IncidentTeamType value. -func (v IncidentTeamType) Ptr() *IncidentTeamType { - return &v -} diff --git a/api/datadogV2/model_incident_team_update_attributes.go b/api/datadogV2/model_incident_team_update_attributes.go deleted file mode 100644 index 4da5d818d90..00000000000 --- a/api/datadogV2/model_incident_team_update_attributes.go +++ /dev/null @@ -1,101 +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" -) - -// IncidentTeamUpdateAttributes The incident team's attributes for an update request. -type IncidentTeamUpdateAttributes struct { - // Name of the incident team. - Name string `json:"name"` - // 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:"-"` -} - -// NewIncidentTeamUpdateAttributes instantiates a new IncidentTeamUpdateAttributes 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 NewIncidentTeamUpdateAttributes(name string) *IncidentTeamUpdateAttributes { - this := IncidentTeamUpdateAttributes{} - this.Name = name - return &this -} - -// NewIncidentTeamUpdateAttributesWithDefaults instantiates a new IncidentTeamUpdateAttributes 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 NewIncidentTeamUpdateAttributesWithDefaults() *IncidentTeamUpdateAttributes { - this := IncidentTeamUpdateAttributes{} - return &this -} - -// GetName returns the Name field value. -func (o *IncidentTeamUpdateAttributes) GetName() string { - if o == nil { - var ret string - return ret - } - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamUpdateAttributes) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value. -func (o *IncidentTeamUpdateAttributes) SetName(v string) { - o.Name = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamUpdateAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["name"] = o.Name - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Name *string `json:"name"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Name == nil { - return fmt.Errorf("required field name missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"name"}) - } else { - return err - } - o.Name = *all.Name - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_update_data.go b/api/datadogV2/model_incident_team_update_data.go deleted file mode 100644 index a5be7230cd1..00000000000 --- a/api/datadogV2/model_incident_team_update_data.go +++ /dev/null @@ -1,224 +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" -) - -// IncidentTeamUpdateData Incident Team data for an update request. -type IncidentTeamUpdateData struct { - // The incident team's attributes for an update request. - Attributes *IncidentTeamUpdateAttributes `json:"attributes,omitempty"` - // The incident team's ID. - Id *string `json:"id,omitempty"` - // The incident team's relationships. - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - // Incident Team resource type. - Type IncidentTeamType `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:"-"` -} - -// NewIncidentTeamUpdateData instantiates a new IncidentTeamUpdateData 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 NewIncidentTeamUpdateData(typeVar IncidentTeamType) *IncidentTeamUpdateData { - this := IncidentTeamUpdateData{} - this.Type = typeVar - return &this -} - -// NewIncidentTeamUpdateDataWithDefaults instantiates a new IncidentTeamUpdateData 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 NewIncidentTeamUpdateDataWithDefaults() *IncidentTeamUpdateData { - this := IncidentTeamUpdateData{} - var typeVar IncidentTeamType = INCIDENTTEAMTYPE_TEAMS - this.Type = typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *IncidentTeamUpdateData) GetAttributes() IncidentTeamUpdateAttributes { - if o == nil || o.Attributes == nil { - var ret IncidentTeamUpdateAttributes - return ret - } - return *o.Attributes -} - -// 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 *IncidentTeamUpdateData) GetAttributesOk() (*IncidentTeamUpdateAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *IncidentTeamUpdateData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given IncidentTeamUpdateAttributes and assigns it to the Attributes field. -func (o *IncidentTeamUpdateData) SetAttributes(v IncidentTeamUpdateAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *IncidentTeamUpdateData) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// 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 *IncidentTeamUpdateData) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *IncidentTeamUpdateData) 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 *IncidentTeamUpdateData) SetId(v string) { - o.Id = &v -} - -// GetRelationships returns the Relationships field value if set, zero value otherwise. -func (o *IncidentTeamUpdateData) GetRelationships() IncidentTeamRelationships { - if o == nil || o.Relationships == nil { - var ret IncidentTeamRelationships - return ret - } - return *o.Relationships -} - -// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamUpdateData) GetRelationshipsOk() (*IncidentTeamRelationships, bool) { - if o == nil || o.Relationships == nil { - return nil, false - } - return o.Relationships, true -} - -// HasRelationships returns a boolean if a field has been set. -func (o *IncidentTeamUpdateData) HasRelationships() bool { - return o != nil && o.Relationships != nil -} - -// SetRelationships gets a reference to the given IncidentTeamRelationships and assigns it to the Relationships field. -func (o *IncidentTeamUpdateData) SetRelationships(v IncidentTeamRelationships) { - o.Relationships = &v -} - -// GetType returns the Type field value. -func (o *IncidentTeamUpdateData) GetType() IncidentTeamType { - if o == nil { - var ret IncidentTeamType - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamUpdateData) GetTypeOk() (*IncidentTeamType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value. -func (o *IncidentTeamUpdateData) SetType(v IncidentTeamType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamUpdateData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Relationships != nil { - toSerialize["relationships"] = o.Relationships - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamUpdateData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *IncidentTeamUpdateAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Relationships *IncidentTeamRelationships `json:"relationships,omitempty"` - Type *IncidentTeamType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Relationships = all.Relationships - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_incident_team_update_request.go b/api/datadogV2/model_incident_team_update_request.go deleted file mode 100644 index de3b65c61b8..00000000000 --- a/api/datadogV2/model_incident_team_update_request.go +++ /dev/null @@ -1,110 +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" -) - -// IncidentTeamUpdateRequest Update request with an incident team payload. -type IncidentTeamUpdateRequest struct { - // Incident Team data for an update request. - Data IncidentTeamUpdateData `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:"-"` -} - -// NewIncidentTeamUpdateRequest instantiates a new IncidentTeamUpdateRequest 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 NewIncidentTeamUpdateRequest(data IncidentTeamUpdateData) *IncidentTeamUpdateRequest { - this := IncidentTeamUpdateRequest{} - this.Data = data - return &this -} - -// NewIncidentTeamUpdateRequestWithDefaults instantiates a new IncidentTeamUpdateRequest 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 NewIncidentTeamUpdateRequestWithDefaults() *IncidentTeamUpdateRequest { - this := IncidentTeamUpdateRequest{} - return &this -} - -// GetData returns the Data field value. -func (o *IncidentTeamUpdateRequest) GetData() IncidentTeamUpdateData { - if o == nil { - var ret IncidentTeamUpdateData - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamUpdateRequest) GetDataOk() (*IncidentTeamUpdateData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value. -func (o *IncidentTeamUpdateRequest) SetData(v IncidentTeamUpdateData) { - o.Data = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["data"] = o.Data - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *IncidentTeamUpdateData `json:"data"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Data == nil { - return fmt.Errorf("required field data missing") - } - 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.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_incident_teams_response.go b/api/datadogV2/model_incident_teams_response.go deleted file mode 100644 index 03c380bf37c..00000000000 --- a/api/datadogV2/model_incident_teams_response.go +++ /dev/null @@ -1,180 +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" -) - -// IncidentTeamsResponse Response with a list of incident team payloads. -type IncidentTeamsResponse struct { - // An array of incident teams. - Data []IncidentTeamResponseData `json:"data"` - // Included related resources which the user requested. - Included []IncidentTeamIncludedItems `json:"included,omitempty"` - // The metadata object containing pagination metadata. - Meta *IncidentResponseMeta `json:"meta,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:"-"` -} - -// NewIncidentTeamsResponse instantiates a new IncidentTeamsResponse 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 NewIncidentTeamsResponse(data []IncidentTeamResponseData) *IncidentTeamsResponse { - this := IncidentTeamsResponse{} - this.Data = data - return &this -} - -// NewIncidentTeamsResponseWithDefaults instantiates a new IncidentTeamsResponse 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 NewIncidentTeamsResponseWithDefaults() *IncidentTeamsResponse { - this := IncidentTeamsResponse{} - return &this -} - -// GetData returns the Data field value. -func (o *IncidentTeamsResponse) GetData() []IncidentTeamResponseData { - if o == nil { - var ret []IncidentTeamResponseData - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *IncidentTeamsResponse) GetDataOk() (*[]IncidentTeamResponseData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value. -func (o *IncidentTeamsResponse) SetData(v []IncidentTeamResponseData) { - o.Data = v -} - -// GetIncluded returns the Included field value if set, zero value otherwise. -func (o *IncidentTeamsResponse) GetIncluded() []IncidentTeamIncludedItems { - if o == nil || o.Included == nil { - var ret []IncidentTeamIncludedItems - return ret - } - return o.Included -} - -// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamsResponse) GetIncludedOk() (*[]IncidentTeamIncludedItems, bool) { - if o == nil || o.Included == nil { - return nil, false - } - return &o.Included, true -} - -// HasIncluded returns a boolean if a field has been set. -func (o *IncidentTeamsResponse) HasIncluded() bool { - return o != nil && o.Included != nil -} - -// SetIncluded gets a reference to the given []IncidentTeamIncludedItems and assigns it to the Included field. -func (o *IncidentTeamsResponse) SetIncluded(v []IncidentTeamIncludedItems) { - o.Included = v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *IncidentTeamsResponse) GetMeta() IncidentResponseMeta { - if o == nil || o.Meta == nil { - var ret IncidentResponseMeta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IncidentTeamsResponse) GetMetaOk() (*IncidentResponseMeta, bool) { - if o == nil || o.Meta == nil { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *IncidentTeamsResponse) HasMeta() bool { - return o != nil && o.Meta != nil -} - -// SetMeta gets a reference to the given IncidentResponseMeta and assigns it to the Meta field. -func (o *IncidentTeamsResponse) SetMeta(v IncidentResponseMeta) { - o.Meta = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o IncidentTeamsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["data"] = o.Data - if o.Included != nil { - toSerialize["included"] = o.Included - } - if o.Meta != nil { - toSerialize["meta"] = o.Meta - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *IncidentTeamsResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *[]IncidentTeamResponseData `json:"data"` - Included []IncidentTeamIncludedItems `json:"included,omitempty"` - Meta *IncidentResponseMeta `json:"meta,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Data == nil { - return fmt.Errorf("required field data missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "meta"}) - } else { - return err - } - - hasInvalidField := false - o.Data = *all.Data - o.Included = all.Included - if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Meta = all.Meta - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/examples/v2/incident-teams/CreateIncidentTeam.go b/examples/v2/incident-teams/CreateIncidentTeam.go deleted file mode 100644 index 7c121b94e5e..00000000000 --- a/examples/v2/incident-teams/CreateIncidentTeam.go +++ /dev/null @@ -1,38 +0,0 @@ -// Create a new incident team returns "CREATED" 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() { - body := datadogV2.IncidentTeamCreateRequest{ - Data: datadogV2.IncidentTeamCreateData{ - Type: datadogV2.INCIDENTTEAMTYPE_TEAMS, - Attributes: &datadogV2.IncidentTeamCreateAttributes{ - Name: "Example-Incident-Team", - }, - }, - } - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.CreateIncidentTeam", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewIncidentTeamsApi(apiClient) - resp, r, err := api.CreateIncidentTeam(ctx, body) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `IncidentTeamsApi.CreateIncidentTeam`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `IncidentTeamsApi.CreateIncidentTeam`:\n%s\n", responseContent) -} diff --git a/examples/v2/incident-teams/DeleteIncidentTeam.go b/examples/v2/incident-teams/DeleteIncidentTeam.go deleted file mode 100644 index 3a547fbdbcf..00000000000 --- a/examples/v2/incident-teams/DeleteIncidentTeam.go +++ /dev/null @@ -1,29 +0,0 @@ -// Delete an existing incident team returns "OK" response - -package main - -import ( - "context" - "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 "team" in the system - TeamDataID := os.Getenv("TEAM_DATA_ID") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.DeleteIncidentTeam", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewIncidentTeamsApi(apiClient) - r, err := api.DeleteIncidentTeam(ctx, TeamDataID) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `IncidentTeamsApi.DeleteIncidentTeam`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} diff --git a/examples/v2/incident-teams/GetIncidentTeam.go b/examples/v2/incident-teams/GetIncidentTeam.go deleted file mode 100644 index 4742c988f48..00000000000 --- a/examples/v2/incident-teams/GetIncidentTeam.go +++ /dev/null @@ -1,33 +0,0 @@ -// Get details of an incident team 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 "team" in the system - TeamDataID := os.Getenv("TEAM_DATA_ID") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.GetIncidentTeam", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewIncidentTeamsApi(apiClient) - resp, r, err := api.GetIncidentTeam(ctx, TeamDataID, *datadogV2.NewGetIncidentTeamOptionalParameters()) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `IncidentTeamsApi.GetIncidentTeam`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `IncidentTeamsApi.GetIncidentTeam`:\n%s\n", responseContent) -} diff --git a/examples/v2/incident-teams/ListIncidentTeams.go b/examples/v2/incident-teams/ListIncidentTeams.go deleted file mode 100644 index 4d8df277496..00000000000 --- a/examples/v2/incident-teams/ListIncidentTeams.go +++ /dev/null @@ -1,33 +0,0 @@ -// Get a list of all incident teams 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 "team" in the system - TeamDataAttributesName := os.Getenv("TEAM_DATA_ATTRIBUTES_NAME") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.ListIncidentTeams", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewIncidentTeamsApi(apiClient) - resp, r, err := api.ListIncidentTeams(ctx, *datadogV2.NewListIncidentTeamsOptionalParameters().WithFilter(TeamDataAttributesName)) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `IncidentTeamsApi.ListIncidentTeams`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `IncidentTeamsApi.ListIncidentTeams`:\n%s\n", responseContent) -} diff --git a/examples/v2/incident-teams/UpdateIncidentTeam.go b/examples/v2/incident-teams/UpdateIncidentTeam.go deleted file mode 100644 index b1c8ea30ba5..00000000000 --- a/examples/v2/incident-teams/UpdateIncidentTeam.go +++ /dev/null @@ -1,41 +0,0 @@ -// Update an existing incident team 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 "team" in the system - TeamDataID := os.Getenv("TEAM_DATA_ID") - - body := datadogV2.IncidentTeamUpdateRequest{ - Data: datadogV2.IncidentTeamUpdateData{ - Type: datadogV2.INCIDENTTEAMTYPE_TEAMS, - Attributes: &datadogV2.IncidentTeamUpdateAttributes{ - Name: "team name-updated", - }, - }, - } - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.UpdateIncidentTeam", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewIncidentTeamsApi(apiClient) - resp, r, err := api.UpdateIncidentTeam(ctx, TeamDataID, body) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `IncidentTeamsApi.UpdateIncidentTeam`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `IncidentTeamsApi.UpdateIncidentTeam`:\n%s\n", responseContent) -} diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index f8a2c389cb1..1dfa6b5a793 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -151,7 +151,6 @@ var apiMappings = map[string]map[string]reflect.Value{ "StatusPagesApi": reflect.ValueOf(datadogV2.NewStatusPagesApi), "SyntheticsApi": reflect.ValueOf(datadogV2.NewSyntheticsApi), "TeamsApi": reflect.ValueOf(datadogV2.NewTeamsApi), - "IncidentTeamsApi": reflect.ValueOf(datadogV2.NewIncidentTeamsApi), "WidgetsApi": reflect.ValueOf(datadogV2.NewWidgetsApi), "WorkflowAutomationApi": reflect.ValueOf(datadogV2.NewWorkflowAutomationApi), }, diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.freeze deleted file mode 100644 index 1d02b7f5cbe..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-11-06T21:59:33.507Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.yaml deleted file mode 100644 index 4835ab0c642..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Create_a_new_incident_team_returns_CREATED_response.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"name":"Test-Create_a_new_incident_team_returns_CREATED_response-1699307973"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/teams - response: - body: '{"data":{"type":"teams","id":"ad2b4266-f087-5b33-9da5-e726f61fd9b0","attributes":{"name":"Test-Create_a_new_incident_team_returns_CREATED_response-1699307973","created":"2023-11-06T21:59:33.756628+00:00","modified":"2023-11-06T21:59:33.756628+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 1 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/ad2b4266-f087-5b33-9da5-e726f61fd9b0 - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.freeze deleted file mode 100644 index ddd60cfaeeb..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-11-06T21:59:33.925Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.yaml deleted file mode 100644 index 9a56555a240..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Delete_an_existing_incident_team_returns_OK_response.yaml +++ /dev/null @@ -1,58 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"name":"Test-Delete_an_existing_incident_team_returns_OK_response-1699307973"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/teams - response: - body: '{"data":{"type":"teams","id":"a5250cc2-827f-509c-8159-2e0ccfb43cd3","attributes":{"name":"Test-Delete_an_existing_incident_team_returns_OK_response-1699307973","created":"2023-11-06T21:59:34.043971+00:00","modified":"2023-11-06T21:59:34.043971+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 1 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/a5250cc2-827f-509c-8159-2e0ccfb43cd3 - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/a5250cc2-827f-509c-8159-2e0ccfb43cd3 - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.freeze deleted file mode 100644 index fe3e133ecee..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-11-06T21:59:34.298Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.yaml deleted file mode 100644 index 5b8bd0e6da3..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_a_list_of_all_incident_teams_returns_OK_response.yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"name":"Test-Get_a_list_of_all_incident_teams_returns_OK_response-1699307974"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/teams - response: - body: '{"data":{"type":"teams","id":"7f1a6db2-da0d-51cd-bcfc-7462b9ce9ff8","attributes":{"name":"Test-Get_a_list_of_all_incident_teams_returns_OK_response-1699307974","created":"2023-11-06T21:59:34.424755+00:00","modified":"2023-11-06T21:59:34.424755+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 1 - method: GET - url: https://api.datadoghq.com/api/v2/teams?filter=Test-Get_a_list_of_all_incident_teams_returns_OK_response-1699307974 - response: - body: '{"data":[{"type":"teams","id":"7f1a6db2-da0d-51cd-bcfc-7462b9ce9ff8","attributes":{"name":"Test-Get_a_list_of_all_incident_teams_returns_OK_response-1699307974","created":"2023-11-06T21:59:34.424755+00:00","modified":"2023-11-06T21:59:34.424755+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}],"meta":{"pagination":{"offset":0,"next_offset":1,"size":1,"total":3852},"sort":"ASC","total":3852}} - - ' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/7f1a6db2-da0d-51cd-bcfc-7462b9ce9ff8 - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.freeze deleted file mode 100644 index 5791822adeb..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-11-06T21:59:34.734Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.yaml deleted file mode 100644 index 2fcc521f349..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Get_details_of_an_incident_team_returns_OK_response.yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"name":"Test-Get_details_of_an_incident_team_returns_OK_response-1699307974"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/teams - response: - body: '{"data":{"type":"teams","id":"98da5ea5-4d67-5296-b971-b8cd48f3e5f3","attributes":{"name":"Test-Get_details_of_an_incident_team_returns_OK_response-1699307974","created":"2023-11-06T21:59:34.850054+00:00","modified":"2023-11-06T21:59:34.850054+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 1 - method: GET - url: https://api.datadoghq.com/api/v2/teams/98da5ea5-4d67-5296-b971-b8cd48f3e5f3 - response: - body: '{"data":{"type":"teams","id":"98da5ea5-4d67-5296-b971-b8cd48f3e5f3","attributes":{"name":"Test-Get_details_of_an_incident_team_returns_OK_response-1699307974","created":"2023-11-06T21:59:34.850054+00:00","modified":"2023-11-06T21:59:34.850054+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}} - - ' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/98da5ea5-4d67-5296-b971-b8cd48f3e5f3 - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.freeze deleted file mode 100644 index 95003d7bde7..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-11-06T21:59:35.100Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.yaml deleted file mode 100644 index a253376f351..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Incident_Teams/Scenario_Update_an_existing_incident_team_returns_OK_response.yaml +++ /dev/null @@ -1,63 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"name":"Test-Update_an_existing_incident_team_returns_OK_response-1699307975"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/teams - response: - body: '{"data":{"type":"teams","id":"90c4f5c8-5965-533e-8b56-cffad17e03bf","attributes":{"name":"Test-Update_an_existing_incident_team_returns_OK_response-1699307975","created":"2023-11-06T21:59:35.219247+00:00","modified":"2023-11-06T21:59:35.219247+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Update_an_existing_incident_team_returns_OK_response-1699307975-updated"},"type":"teams"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 1 - method: PATCH - url: https://api.datadoghq.com/api/v2/teams/90c4f5c8-5965-533e-8b56-cffad17e03bf - response: - body: '{"data":{"type":"teams","id":"90c4f5c8-5965-533e-8b56-cffad17e03bf","attributes":{"name":"Test-Update_an_existing_incident_team_returns_OK_response-1699307975-updated","created":"2023-11-06T21:59:35.219247+00:00","modified":"2023-11-06T21:59:35.364568+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}]} - - ' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 2 - method: DELETE - url: https://api.datadoghq.com/api/v2/teams/90c4f5c8-5965-533e-8b56-cffad17e03bf - response: - body: '' - code: 204 - duration: 0ms - headers: - Content-Type: - - text/html; charset=utf-8 - status: 204 No Content -version: 2 diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 98e2edab7a1..48979b4fe7b 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -1533,18 +1533,6 @@ "tag": "Teams", "operationId": "CreateTeamNotificationRule" }, - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\"\n },\n \"type\": \"teams\"\n }\n}" - } - ], - "step": "there is a valid \"team\" in the system", - "key": "team", - "tag": "Incident Teams", - "operationId": "CreateIncidentTeam" - }, { "parameters": [ { diff --git a/tests/scenarios/features/v2/incident_teams.feature b/tests/scenarios/features/v2/incident_teams.feature deleted file mode 100644 index 5bbb4926393..00000000000 --- a/tests/scenarios/features/v2/incident_teams.feature +++ /dev/null @@ -1,146 +0,0 @@ -@endpoint(incident-teams) @endpoint(incident-teams-v2) -Feature: Incident Teams - The Incident Teams endpoints are deprecated. See the [Teams API - endpoints](https://docs.datadoghq.com/api/latest/teams/) to create, - update, delete, and retrieve teams which can be associated with incidents. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "IncidentTeams" API - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident team returns "Bad Request" response - Given operation "CreateIncidentTeam" enabled - And new "CreateIncidentTeam" request - And body with value {"data": {"attributes": {"name": "team name"}, "type": "teams"}} - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/incident-app - Scenario: Create a new incident team returns "CREATED" response - Given operation "CreateIncidentTeam" enabled - And new "CreateIncidentTeam" request - And body with value {"data": {"type": "teams", "attributes": {"name": "{{ unique }}"}}} - When the request is sent - Then the response status is 201 CREATED - And the response "data.type" is equal to "teams" - And the response "data.attributes.name" is equal to "{{ unique }}" - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident team returns "Not Found" response - Given operation "CreateIncidentTeam" enabled - And new "CreateIncidentTeam" request - And body with value {"data": {"attributes": {"name": "team name"}, "type": "teams"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident team returns "Bad Request" response - Given operation "DeleteIncidentTeam" enabled - And new "DeleteIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident team returns "Not Found" response - Given operation "DeleteIncidentTeam" enabled - And new "DeleteIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Delete an existing incident team returns "OK" response - Given there is a valid "team" in the system - And operation "DeleteIncidentTeam" enabled - And new "DeleteIncidentTeam" request - And request contains "team_id" parameter from "team.data.id" - When the request is sent - Then the response status is 204 OK - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident teams returns "Bad Request" response - Given operation "ListIncidentTeams" enabled - And new "ListIncidentTeams" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident teams returns "Not Found" response - Given operation "ListIncidentTeams" enabled - And new "ListIncidentTeams" request - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get a list of all incident teams returns "OK" response - Given there is a valid "team" in the system - And operation "ListIncidentTeams" enabled - And new "ListIncidentTeams" request - And request contains "filter" parameter from "team.data.attributes.name" - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].type" is equal to "teams" - And the response "data[0].attributes.name" has the same value as "team.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident team returns "Bad Request" response - Given operation "GetIncidentTeam" enabled - And new "GetIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident team returns "Not Found" response - Given operation "GetIncidentTeam" enabled - And new "GetIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get details of an incident team returns "OK" response - Given there is a valid "team" in the system - And operation "GetIncidentTeam" enabled - And new "GetIncidentTeam" request - And request contains "team_id" parameter from "team.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data.type" is equal to "teams" - And the response "data.id" is equal to "{{ team.data.id }}" - And the response "data.attributes.name" has the same value as "team.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident team returns "Bad Request" response - Given operation "UpdateIncidentTeam" enabled - And new "UpdateIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "team name"}, "id": "00000000-7ea3-0000-0001-000000000000", "type": "teams"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident team returns "Not Found" response - Given operation "UpdateIncidentTeam" enabled - And new "UpdateIncidentTeam" request - And request contains "team_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "team name"}, "id": "00000000-7ea3-0000-0001-000000000000", "type": "teams"}} - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Update an existing incident team returns "OK" response - Given there is a valid "team" in the system - And operation "UpdateIncidentTeam" enabled - And new "UpdateIncidentTeam" request - And request contains "team_id" parameter from "team.data.id" - And body with value {"data": {"type": "teams", "attributes": {"name": "{{ team.data.attributes.name }}-updated"}}} - When the request is sent - Then the response status is 200 OK - And the response "data.type" is equal to "teams" - And the response "data.id" is equal to "{{ team.data.id }}" - And the response "data.attributes.name" is equal to "{{ team.data.attributes.name }}-updated" diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 8f3cc28492d..a3e509a0bcb 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -6964,43 +6964,6 @@ "type": "idempotent" } }, - "ListIncidentTeams": { - "tag": "Incident Teams", - "undo": { - "type": "safe" - } - }, - "CreateIncidentTeam": { - "tag": "Incident Teams", - "undo": { - "operationId": "DeleteIncidentTeam", - "parameters": [ - { - "name": "team_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, - "DeleteIncidentTeam": { - "tag": "Incident Teams", - "undo": { - "type": "idempotent" - } - }, - "GetIncidentTeam": { - "tag": "Incident Teams", - "undo": { - "type": "safe" - } - }, - "UpdateIncidentTeam": { - "tag": "Incident Teams", - "undo": { - "type": "idempotent" - } - }, "UpdateFlakyTests": { "tag": "Test Optimization", "undo": {