diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a5b1012c5d22..729e373ca026 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1997,6 +1997,46 @@ components: required: true schema: type: string + TeamsOwnershipFilterApplicationIdParameter: + description: Filter mappings by RUM application ID. Each value must be a valid UUID. + in: query + name: filter[application_id] + schema: + items: + format: uuid + type: string + type: array + TeamsOwnershipFilterServiceParameter: + description: Filter mappings by RUM application service name. + in: query + name: filter[service] + schema: + items: + type: string + type: array + TeamsOwnershipFilterTeamHandleParameter: + description: Filter mappings by owning team handle. + in: query + name: filter[team_handle] + schema: + items: + type: string + type: array + TeamsOwnershipFilterViewNameParameter: + description: Filter mappings by RUM view name. + in: query + name: filter[view_name] + schema: + items: + type: string + type: array + TeamsOwnershipMappingIdParameter: + description: The ID of the teams ownership mapping. + in: path + name: id + required: true + schema: + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -112863,6 +112903,390 @@ components: example: "number_size" type: string type: object + TeamsOwnershipMappingBatchError: + description: An error encountered while validating or applying an operation. + properties: + detail: + description: A human-readable explanation specific to this error. + example: "prefix match_type is not enabled for this org" + type: string + status: + description: The HTTP status code applicable to this error. + example: "400" + type: string + title: + description: A short, human-readable summary of the error. + example: "Bad Request" + type: string + required: + - status + - title + type: object + TeamsOwnershipMappingBatchOperation: + description: A single add or remove operation, applied atomically with every other operation in the request. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationData" + op: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationOp" + ref: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationRef" + required: + - op + type: object + TeamsOwnershipMappingBatchOperationData: + description: The mapping to add. Required when `op` is `add`. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationDataAttributes" + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - attributes + type: object + TeamsOwnershipMappingBatchOperationDataAttributes: + description: |- + The attributes of the mapping to add. `team_handle` and `view_name` are required + when `op` is `add`. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + example: "11111111-2222-3333-4444-555555555555" + format: uuid + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + type: object + TeamsOwnershipMappingBatchOperationOp: + description: Whether this operation adds a new mapping or removes an existing one. + enum: + - add + - remove + example: add + type: string + x-enum-varnames: ["ADD", "REMOVE"] + TeamsOwnershipMappingBatchOperationRef: + description: Identifies an existing mapping to remove. Required when `op` is `remove`. + properties: + id: + description: The ID of the mapping to remove. + example: "456" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - id + type: object + TeamsOwnershipMappingBatchRequest: + description: The request body for bulk-creating and bulk-removing teams ownership mappings. + properties: + atomic:operations: + description: The ordered list of add and remove operations to apply atomically. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperation" + type: array + required: + - atomic:operations + type: object + TeamsOwnershipMappingBatchResponse: + description: |- + The response body for the bulk create and remove operation. On success, `atomic:results` + contains one entry per operation, in request order. On failure, no operations were applied + and `errors` describes what went wrong. + properties: + atomic:results: + description: |- + The result of each operation. + Add operations are processed first, then remove operations, so results may not appear + in the same order as the request. Present only on success. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResult" + type: array + errors: + description: The validation or processing errors encountered. Present only when the request could not be completed. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchError" + type: array + type: object + TeamsOwnershipMappingBatchResult: + description: |- + The result of a single operation. + Add operations are processed first, then remove operations, so results may not appear + in the same order as the request. Empty for `remove` operations. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResultData" + type: object + TeamsOwnershipMappingBatchResultData: + description: The mapping created by an `add` operation. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseAttributes" + id: + description: The unique identifier of the teams ownership mapping. + example: "123" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - id + - attributes + type: object + TeamsOwnershipMappingCreateData: + description: The JSON:API data envelope for a teams ownership mapping create request. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateDataAttributes" + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - attributes + type: object + TeamsOwnershipMappingCreateDataAttributes: + description: The attributes of the teams ownership mapping to create. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + example: "11111111-2222-3333-4444-555555555555" + format: uuid + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - team_handle + - view_name + type: object + TeamsOwnershipMappingCreateRequest: + description: The request body for creating a teams ownership mapping. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateData" + required: + - data + type: object + TeamsOwnershipMappingResponse: + description: The response body for a single teams ownership mapping. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseData" + required: + - data + type: object + TeamsOwnershipMappingResponseAttributes: + description: The attributes of a teams ownership mapping. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, this is the real application UUID. + For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + example: "11111111-2222-3333-4444-555555555555" + type: string + created_at: + description: Timestamp when the mapping was created. + example: "2026-01-15T09:30:00.000Z" + format: date-time + type: string + created_by: + description: The UUID of the user who created the mapping. + example: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + org_id: + description: The ID of the organization that owns this mapping. + example: 123456 + format: int64 + type: integer + service: + description: The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - team_handle + - view_name + - service + - application_id + - org_id + - created_at + - created_by + - match_type + type: object + TeamsOwnershipMappingResponseData: + description: The JSON:API data envelope for a teams ownership mapping. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseAttributes" + id: + description: The unique identifier of the teams ownership mapping. + example: "123" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - id + - type + - attributes + type: object + TeamsOwnershipMappingType: + default: teams_ownership_mappings + description: The type of the resource. The value should always be teams_ownership_mappings. + enum: + - teams_ownership_mappings + example: teams_ownership_mappings + type: string + x-enum-varnames: ["TEAMS_OWNERSHIP_MAPPINGS"] + TeamsOwnershipMappingsResponse: + description: The response body for a list of teams ownership mappings. + properties: + data: + description: A list of teams ownership mappings. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseData" + type: array + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + type: object + TeamsOwnershipMatchType: + default: exact + description: How the `view_name` is matched against RUM view names. + enum: + - exact + - prefix + example: exact + type: string + x-enum-varnames: ["EXACT", "PREFIX"] + TeamsOwnershipRuleResponseAttributes: + description: The attributes of a teams ownership rule. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, this is the real application UUID. + For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + example: "11111111-2222-3333-4444-555555555555" + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + example: "web-checkout" + type: string + teams: + description: The teams that own the matched views, each paired with the ID of its underlying mapping. + items: + $ref: "#/components/schemas/TeamsOwnershipRuleTeamMapping" + type: array + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - teams + - view_name + - service + - application_id + - match_type + type: object + TeamsOwnershipRuleResponseData: + description: The JSON:API data envelope for a teams ownership rule. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipRuleResponseAttributes" + id: + description: |- + A deterministic identifier derived from the rule's grouping key. + This ID cannot be used to delete the rule directly; delete individual mappings + using the `mapping_id` under `teams` instead. + example: "3b1e2f7a9c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipRuleType" + required: + - id + - type + - attributes + type: object + TeamsOwnershipRuleTeamMapping: + description: An individual team's ownership entry within a teams ownership rule. + properties: + mapping_id: + description: The ID of the underlying mapping, used to delete this team's ownership individually. + example: "123" + type: string + team_handle: + description: The handle of the owning team. + example: "team-rum" + type: string + required: + - team_handle + - mapping_id + type: object + TeamsOwnershipRuleType: + default: teams_ownership_grouped_mappings + description: The type of the resource. The value should always be teams_ownership_grouped_mappings. + enum: + - teams_ownership_grouped_mappings + example: teams_ownership_grouped_mappings + type: string + x-enum-varnames: ["TEAMS_OWNERSHIP_GROUPED_MAPPINGS"] + TeamsOwnershipRulesResponse: + description: The response body for a list of teams ownership rules. + properties: + data: + description: A list of teams ownership rules. + items: + $ref: "#/components/schemas/TeamsOwnershipRuleResponseData" + type: array + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + type: object TeamsResponse: description: Response with multiple teams properties: @@ -183423,6 +183847,299 @@ paths: tags: - Rum Metrics x-codegen-request-body-name: body + /api/v2/rum/config/teams-ownership/mappings: + get: + description: Get the list of teams ownership mappings for your organization, optionally filtered. + operationId: ListTeamsOwnershipMappings + parameters: + - $ref: "#/components/parameters/TeamsOwnershipFilterViewNameParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterTeamHandleParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterApplicationIdParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterServiceParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List teams ownership mappings + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create a teams ownership mapping for your organization. + Returns the teams ownership mapping object from the request body when the request is successful. + operationId: CreateTeamsOwnershipMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateRequest" + description: The definition of the teams ownership mapping to create. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a teams ownership mapping + tags: + - Rum Teams Ownership + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/mappings/operations: + post: + description: |- + Add and remove teams ownership mappings for your organization in a single atomic request, following + the JSON:API [atomic operations extension](https://jsonapi.org/ext/atomic/). + Operations are applied together: if any operation is invalid, none of the operations are applied. + Add operations are processed before remove operations, so results may not appear in the same + order as the request. + operationId: CreateTeamsOwnershipMappingsBatch + requestBody: + content: + application/json: + examples: + default: + value: + atomic:operations: + - data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + type: teams_ownership_mappings + op: add + - op: remove + ref: + id: "456" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchRequest" + description: The ordered list of add and remove operations to apply atomically. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + atomic:results: + - data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + - {} + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResponse" + description: OK + "400": + content: + application/json: + examples: + default: + value: + errors: + - detail: "prefix match_type is not enabled for this org" + status: "400" + title: "Bad Request" + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: |- + Bad Request. One or more operations failed validation, so none of the operations were applied. + Errors are returned in the JSON:API atomic operations error format rather than the standard error response. + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Bulk create and remove teams ownership mappings + tags: + - Rum Teams Ownership + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/mappings/{id}: + delete: + description: Delete a specific teams ownership mapping from your organization. + operationId: DeleteTeamsOwnershipMapping + parameters: + - $ref: "#/components/parameters/TeamsOwnershipMappingIdParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a teams ownership mapping + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific teams ownership mapping from your organization. + operationId: GetTeamsOwnershipMapping + parameters: + - $ref: "#/components/parameters/TeamsOwnershipMappingIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a teams ownership mapping + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/rules: + get: + description: |- + Get the list of teams ownership rules for your organization, optionally filtered. + Rules group the underlying mappings by `view_name`, `application_id`, `service`, and `match_type`, + collapsing every team that owns the same view into a single entry. + operationId: ListTeamsOwnershipRules + parameters: + - $ref: "#/components/parameters/TeamsOwnershipFilterViewNameParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterTeamHandleParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterApplicationIdParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterServiceParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + teams: + - mapping_id: "123" + team_handle: "team-rum" + view_name: "/checkout" + id: "3b1e2f7a9c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f" + type: teams_ownership_grouped_mappings + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TeamsOwnershipRulesResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List teams ownership rules + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rum/events: get: description: |- @@ -213932,6 +214649,10 @@ tags: - description: |- Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters + - description: |- + Manage [teams ownership](https://docs.datadoghq.com/real_user_monitoring/platform/ownership/) mappings + between RUM views and the teams that own them. + name: Rum Teams Ownership - description: |- Configure your [Datadog Salesforce integration](https://docs.datadoghq.com/integrations/salesforce/) directly through the Datadog API. diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.rb b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.rb new file mode 100644 index 000000000000..b94673ffd7a5 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.rb @@ -0,0 +1,21 @@ +# Create a teams ownership mapping returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_teams_ownership_mapping".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new + +body = DatadogAPIClient::V2::TeamsOwnershipMappingCreateRequest.new({ + data: DatadogAPIClient::V2::TeamsOwnershipMappingCreateData.new({ + attributes: DatadogAPIClient::V2::TeamsOwnershipMappingCreateDataAttributes.new({ + application_id: "11111111-2222-3333-4444-555555555555", + match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT, + service: "web-checkout", + team_handle: "team-rum", + view_name: "/checkout", + }), + type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS, + }), +}) +p api_instance.create_teams_ownership_mapping(body) diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.rb b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.rb new file mode 100644 index 000000000000..6ad2a41bd441 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.rb @@ -0,0 +1,18 @@ +# Create teams ownership mapping returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new + +body = DatadogAPIClient::V2::TeamsOwnershipMappingCreateRequest.new({ + data: DatadogAPIClient::V2::TeamsOwnershipMappingCreateData.new({ + type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS, + attributes: DatadogAPIClient::V2::TeamsOwnershipMappingCreateDataAttributes.new({ + team_handle: "team-rum", + view_name: "/checkout", + service: "web-checkout", + application_id: "11111111-2222-3333-4444-555555555555", + match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT, + }), + }), +}) +p api_instance.create_teams_ownership_mapping(body) diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.rb b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.rb new file mode 100644 index 000000000000..cf3df426d00e --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.rb @@ -0,0 +1,30 @@ +# Bulk create and remove teams ownership mappings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new + +body = DatadogAPIClient::V2::TeamsOwnershipMappingBatchRequest.new({ + atomic_operations: [ + DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperation.new({ + op: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationOp::ADD, + data: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationData.new({ + type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS, + attributes: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationDataAttributes.new({ + team_handle: "team-rum", + view_name: "/checkout", + service: "web-checkout", + application_id: "11111111-2222-3333-4444-555555555555", + match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT, + }), + }), + }), + DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperation.new({ + op: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationOp::REMOVE, + ref: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationRef.new({ + type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS, + id: "456", + }), + }), + ], +}) +p api_instance.create_teams_ownership_mappings_batch(body) diff --git a/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.rb b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.rb new file mode 100644 index 000000000000..c937135389a2 --- /dev/null +++ b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.rb @@ -0,0 +1,5 @@ +# Delete a teams ownership mapping returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new +api_instance.delete_teams_ownership_mapping("123") diff --git a/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.rb b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.rb new file mode 100644 index 000000000000..1108734b5332 --- /dev/null +++ b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.rb @@ -0,0 +1,5 @@ +# Get a teams ownership mapping returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new +p api_instance.get_teams_ownership_mapping("123") diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.rb b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.rb new file mode 100644 index 000000000000..8880c2d8f70a --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.rb @@ -0,0 +1,5 @@ +# List teams ownership mappings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new +p api_instance.list_teams_ownership_mappings() diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.rb b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.rb new file mode 100644 index 000000000000..934e8371bed3 --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.rb @@ -0,0 +1,5 @@ +# List teams ownership rules returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new +p api_instance.list_teams_ownership_rules() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c0073a54762f..3b86b084fc59 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5420,6 +5420,30 @@ "metric_id" => "String", "body" => "RumMetricUpdateRequest", }, + "v2.ListTeamsOwnershipMappings" => { + "filter_view_name" => "Array", + "filter_team_handle" => "Array", + "filter_application_id" => "Array", + "filter_service" => "Array", + }, + "v2.CreateTeamsOwnershipMapping" => { + "body" => "TeamsOwnershipMappingCreateRequest", + }, + "v2.CreateTeamsOwnershipMappingsBatch" => { + "body" => "TeamsOwnershipMappingBatchRequest", + }, + "v2.DeleteTeamsOwnershipMapping" => { + "id" => "String", + }, + "v2.GetTeamsOwnershipMapping" => { + "id" => "String", + }, + "v2.ListTeamsOwnershipRules" => { + "filter_view_name" => "Array", + "filter_team_handle" => "Array", + "filter_application_id" => "Array", + "filter_service" => "Array", + }, "v2.CreateRUMOperation" => { "body" => "RUMOperationCreateRequest", }, diff --git a/features/v2/rum_teams_ownership.feature b/features/v2/rum_teams_ownership.feature new file mode 100644 index 000000000000..5455d1af85e8 --- /dev/null +++ b/features/v2/rum_teams_ownership.feature @@ -0,0 +1,127 @@ +@endpoint(rum-teams-ownership) @endpoint(rum-teams-ownership-v2) +Feature: Rum Teams Ownership + Manage [teams ownership](https://docs.datadoghq.com/real_user_monitoring/p + latform/ownership/) mappings between RUM views and the teams that own + them. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RumTeamsOwnership" API + + @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "Bad Request" response + Given new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "Bad Request. One or more operations failed validation, so none of the operations were applied." response + Given operation "CreateTeamsOwnershipMappingsBatch" enabled + And new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations": [{"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}, "op": "add", "ref": {"id": "456", "type": "teams_ownership_mappings"}}]} + When the request is sent + Then the response status is 400 Bad Request. One or more operations failed validation, so none of the operations were applied. + + @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "OK" response + Given new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"11111111-2222-3333-4444-555555555555","match_type":"exact"}}},{"op":"remove","ref":{"type":"teams_ownership_mappings","id":"456"}}]} + When the request is sent + Then the response status is 200 OK + And the response "atomic:results[0].data.type" is equal to "teams_ownership_mappings" + And the response "atomic:results[0].data.attributes.team_handle" is equal to "team-rum" + And the response "atomic:results[0].data.attributes.match_type" is equal to "exact" + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a teams ownership mapping returns "Bad Request" response + Given operation "CreateTeamsOwnershipMapping" enabled + And new "CreateTeamsOwnershipMapping" request + And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a teams ownership mapping returns "Created" response + Given operation "CreateTeamsOwnershipMapping" enabled + And new "CreateTeamsOwnershipMapping" request + And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}} + When the request is sent + Then the response status is 201 Created + + @team:DataDog/rum-backend + Scenario: Create teams ownership mapping returns "Bad Request" response + Given new "CreateTeamsOwnershipMapping" request + And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/rum-backend + Scenario: Create teams ownership mapping returns "Created" response + Given new "CreateTeamsOwnershipMapping" request + And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"11111111-2222-3333-4444-555555555555","match_type":"exact"}}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "teams_ownership_mappings" + And the response "data.attributes.team_handle" is equal to "team-rum" + And the response "data.attributes.view_name" is equal to "/checkout" + And the response "data.attributes.service" is equal to "web-checkout" + And the response "data.attributes.application_id" is equal to "11111111-2222-3333-4444-555555555555" + And the response "data.attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: Delete a teams ownership mapping returns "No Content" response + Given new "DeleteTeamsOwnershipMapping" request + And request contains "id" parameter with value "123" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/rum-backend + Scenario: Delete a teams ownership mapping returns "Not Found" response + Given new "DeleteTeamsOwnershipMapping" request + And request contains "id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/rum-backend + Scenario: Get a teams ownership mapping returns "Not Found" response + Given new "GetTeamsOwnershipMapping" request + And request contains "id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/rum-backend + Scenario: Get a teams ownership mapping returns "OK" response + Given new "GetTeamsOwnershipMapping" request + And request contains "id" parameter with value "123" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "123" + And the response "data.type" is equal to "teams_ownership_mappings" + And the response "data.attributes.team_handle" is equal to "team-rum" + And the response "data.attributes.view_name" is equal to "/checkout" + And the response "data.attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: List teams ownership mappings returns "OK" response + Given new "ListTeamsOwnershipMappings" request + 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_ownership_mappings" + And the response "data[0].attributes.team_handle" is equal to "team-rum" + And the response "data[0].attributes.view_name" is equal to "/checkout" + And the response "data[0].attributes.service" is equal to "web-checkout" + And the response "data[0].attributes.application_id" is equal to "11111111-2222-3333-4444-555555555555" + And the response "data[0].attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: List teams ownership rules returns "OK" response + Given new "ListTeamsOwnershipRules" request + 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_ownership_grouped_mappings" + And the response "data[0].attributes.view_name" is equal to "/checkout" + And the response "data[0].attributes.match_type" is equal to "exact" diff --git a/features/v2/undo.json b/features/v2/undo.json index df961ee10c84..118bc7179d65 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7057,6 +7057,51 @@ "type": "idempotent" } }, + "ListTeamsOwnershipMappings": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, + "CreateTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "operationId": "DeleteTeamsOwnershipMapping", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateTeamsOwnershipMappingsBatch": { + "tag": "Rum Teams Ownership", + "undo": { + "operationId": "CreateTeamsOwnershipMappingsBatch", + "parameters": [], + "type": "unsafe" + } + }, + "DeleteTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "idempotent" + } + }, + "GetTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, + "ListTeamsOwnershipRules": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, "ListRUMEvents": { "tag": "RUM", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index ab4a0dc4daa4..6a187dd9d812 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -673,6 +673,12 @@ def initialize "v2.create_rum_config": false, "v2.get_rum_config": false, "v2.update_rum_config": false, + "v2.create_teams_ownership_mapping": false, + "v2.create_teams_ownership_mappings_batch": false, + "v2.delete_teams_ownership_mapping": false, + "v2.get_teams_ownership_mapping": false, + "v2.list_teams_ownership_mappings": false, + "v2.list_teams_ownership_rules": false, "v2.create_rum_operation": false, "v2.create_rum_operation_strong_link": false, "v2.delete_rum_operation": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8c9591985f8a..0b0c1bc9d043 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -8015,6 +8015,30 @@ def overrides "v2.teams_hierarchy_links_response_links" => "TeamsHierarchyLinksResponseLinks", "v2.teams_hierarchy_links_response_meta" => "TeamsHierarchyLinksResponseMeta", "v2.teams_hierarchy_links_response_meta_page" => "TeamsHierarchyLinksResponseMetaPage", + "v2.teams_ownership_mapping_batch_error" => "TeamsOwnershipMappingBatchError", + "v2.teams_ownership_mapping_batch_operation" => "TeamsOwnershipMappingBatchOperation", + "v2.teams_ownership_mapping_batch_operation_data" => "TeamsOwnershipMappingBatchOperationData", + "v2.teams_ownership_mapping_batch_operation_data_attributes" => "TeamsOwnershipMappingBatchOperationDataAttributes", + "v2.teams_ownership_mapping_batch_operation_op" => "TeamsOwnershipMappingBatchOperationOp", + "v2.teams_ownership_mapping_batch_operation_ref" => "TeamsOwnershipMappingBatchOperationRef", + "v2.teams_ownership_mapping_batch_request" => "TeamsOwnershipMappingBatchRequest", + "v2.teams_ownership_mapping_batch_response" => "TeamsOwnershipMappingBatchResponse", + "v2.teams_ownership_mapping_batch_result" => "TeamsOwnershipMappingBatchResult", + "v2.teams_ownership_mapping_batch_result_data" => "TeamsOwnershipMappingBatchResultData", + "v2.teams_ownership_mapping_create_data" => "TeamsOwnershipMappingCreateData", + "v2.teams_ownership_mapping_create_data_attributes" => "TeamsOwnershipMappingCreateDataAttributes", + "v2.teams_ownership_mapping_create_request" => "TeamsOwnershipMappingCreateRequest", + "v2.teams_ownership_mapping_response" => "TeamsOwnershipMappingResponse", + "v2.teams_ownership_mapping_response_attributes" => "TeamsOwnershipMappingResponseAttributes", + "v2.teams_ownership_mapping_response_data" => "TeamsOwnershipMappingResponseData", + "v2.teams_ownership_mappings_response" => "TeamsOwnershipMappingsResponse", + "v2.teams_ownership_mapping_type" => "TeamsOwnershipMappingType", + "v2.teams_ownership_match_type" => "TeamsOwnershipMatchType", + "v2.teams_ownership_rule_response_attributes" => "TeamsOwnershipRuleResponseAttributes", + "v2.teams_ownership_rule_response_data" => "TeamsOwnershipRuleResponseData", + "v2.teams_ownership_rules_response" => "TeamsOwnershipRulesResponse", + "v2.teams_ownership_rule_team_mapping" => "TeamsOwnershipRuleTeamMapping", + "v2.teams_ownership_rule_type" => "TeamsOwnershipRuleType", "v2.teams_response" => "TeamsResponse", "v2.teams_response_links" => "TeamsResponseLinks", "v2.teams_response_meta" => "TeamsResponseMeta", @@ -8640,6 +8664,7 @@ def overrides "v2.rum_replay_sessions_api" => "RumReplaySessionsAPI", "v2.rum_replay_viewership_api" => "RumReplayViewershipAPI", "v2.rum_retention_filters_api" => "RumRetentionFiltersAPI", + "v2.rum_teams_ownership_api" => "RumTeamsOwnershipAPI", "v2.salesforce_integration_api" => "SalesforceIntegrationAPI", "v2.scorecards_api" => "ScorecardsAPI", "v2.seats_api" => "SeatsAPI", diff --git a/lib/datadog_api_client/v2/api/rum_teams_ownership_api.rb b/lib/datadog_api_client/v2/api/rum_teams_ownership_api.rb new file mode 100644 index 000000000000..35260835c8de --- /dev/null +++ b/lib/datadog_api_client/v2/api/rum_teams_ownership_api.rb @@ -0,0 +1,471 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class RumTeamsOwnershipAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a teams ownership mapping. + # + # @see #create_teams_ownership_mapping_with_http_info + def create_teams_ownership_mapping(body, opts = {}) + data, _status_code, _headers = create_teams_ownership_mapping_with_http_info(body, opts) + data + end + + # Create a teams ownership mapping. + # + # Create a teams ownership mapping for your organization. + # Returns the teams ownership mapping object from the request body when the request is successful. + # + # @param body [TeamsOwnershipMappingCreateRequest] The definition of the teams ownership mapping to create. + # @param opts [Hash] the optional parameters + # @return [Array<(TeamsOwnershipMappingResponse, Integer, Hash)>] TeamsOwnershipMappingResponse data, response status code and response headers + def create_teams_ownership_mapping_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_teams_ownership_mapping".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_teams_ownership_mapping") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_teams_ownership_mapping")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.create_teams_ownership_mapping ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumTeamsOwnershipAPI.create_teams_ownership_mapping" + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/mappings' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TeamsOwnershipMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_teams_ownership_mapping, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#create_teams_ownership_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Bulk create and remove teams ownership mappings. + # + # @see #create_teams_ownership_mappings_batch_with_http_info + def create_teams_ownership_mappings_batch(body, opts = {}) + data, _status_code, _headers = create_teams_ownership_mappings_batch_with_http_info(body, opts) + data + end + + # Bulk create and remove teams ownership mappings. + # + # Add and remove teams ownership mappings for your organization in a single atomic request, following + # the JSON:API [atomic operations extension](https://jsonapi.org/ext/atomic/). + # Operations are applied together: if any operation is invalid, none of the operations are applied. + # Add operations are processed before remove operations, so results may not appear in the same + # order as the request. + # + # @param body [TeamsOwnershipMappingBatchRequest] The ordered list of add and remove operations to apply atomically. + # @param opts [Hash] the optional parameters + # @return [Array<(TeamsOwnershipMappingBatchResponse, Integer, Hash)>] TeamsOwnershipMappingBatchResponse data, response status code and response headers + def create_teams_ownership_mappings_batch_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_teams_ownership_mappings_batch".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_teams_ownership_mappings_batch") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_teams_ownership_mappings_batch")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.create_teams_ownership_mappings_batch ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumTeamsOwnershipAPI.create_teams_ownership_mappings_batch" + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/mappings/operations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TeamsOwnershipMappingBatchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_teams_ownership_mappings_batch, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#create_teams_ownership_mappings_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a teams ownership mapping. + # + # @see #delete_teams_ownership_mapping_with_http_info + def delete_teams_ownership_mapping(id, opts = {}) + delete_teams_ownership_mapping_with_http_info(id, opts) + nil + end + + # Delete a teams ownership mapping. + # + # Delete a specific teams ownership mapping from your organization. + # + # @param id [String] The ID of the teams ownership mapping. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_teams_ownership_mapping_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_teams_ownership_mapping".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_teams_ownership_mapping") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_teams_ownership_mapping")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.delete_teams_ownership_mapping ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling RumTeamsOwnershipAPI.delete_teams_ownership_mapping" + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/mappings/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_teams_ownership_mapping, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#delete_teams_ownership_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a teams ownership mapping. + # + # @see #get_teams_ownership_mapping_with_http_info + def get_teams_ownership_mapping(id, opts = {}) + data, _status_code, _headers = get_teams_ownership_mapping_with_http_info(id, opts) + data + end + + # Get a teams ownership mapping. + # + # Get a specific teams ownership mapping from your organization. + # + # @param id [String] The ID of the teams ownership mapping. + # @param opts [Hash] the optional parameters + # @return [Array<(TeamsOwnershipMappingResponse, Integer, Hash)>] TeamsOwnershipMappingResponse data, response status code and response headers + def get_teams_ownership_mapping_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_teams_ownership_mapping".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_teams_ownership_mapping") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_teams_ownership_mapping")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.get_teams_ownership_mapping ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling RumTeamsOwnershipAPI.get_teams_ownership_mapping" + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/mappings/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamsOwnershipMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_teams_ownership_mapping, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#get_teams_ownership_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List teams ownership mappings. + # + # @see #list_teams_ownership_mappings_with_http_info + def list_teams_ownership_mappings(opts = {}) + data, _status_code, _headers = list_teams_ownership_mappings_with_http_info(opts) + data + end + + # List teams ownership mappings. + # + # Get the list of teams ownership mappings for your organization, optionally filtered. + # + # @param opts [Hash] the optional parameters + # @option opts [Array] :filter_view_name Filter mappings by RUM view name. + # @option opts [Array] :filter_team_handle Filter mappings by owning team handle. + # @option opts [Array] :filter_application_id Filter mappings by RUM application ID. Each value must be a valid UUID. + # @option opts [Array] :filter_service Filter mappings by RUM application service name. + # @return [Array<(TeamsOwnershipMappingsResponse, Integer, Hash)>] TeamsOwnershipMappingsResponse data, response status code and response headers + def list_teams_ownership_mappings_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_teams_ownership_mappings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_teams_ownership_mappings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_teams_ownership_mappings")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.list_teams_ownership_mappings ...' + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/mappings' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[view_name]'] = @api_client.build_collection_param(opts[:'filter_view_name'], :multi) if !opts[:'filter_view_name'].nil? + query_params[:'filter[team_handle]'] = @api_client.build_collection_param(opts[:'filter_team_handle'], :multi) if !opts[:'filter_team_handle'].nil? + query_params[:'filter[application_id]'] = @api_client.build_collection_param(opts[:'filter_application_id'], :multi) if !opts[:'filter_application_id'].nil? + query_params[:'filter[service]'] = @api_client.build_collection_param(opts[:'filter_service'], :multi) if !opts[:'filter_service'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamsOwnershipMappingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_teams_ownership_mappings, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#list_teams_ownership_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List teams ownership rules. + # + # @see #list_teams_ownership_rules_with_http_info + def list_teams_ownership_rules(opts = {}) + data, _status_code, _headers = list_teams_ownership_rules_with_http_info(opts) + data + end + + # List teams ownership rules. + # + # Get the list of teams ownership rules for your organization, optionally filtered. + # Rules group the underlying mappings by `view_name`, `application_id`, `service`, and `match_type`, + # collapsing every team that owns the same view into a single entry. + # + # @param opts [Hash] the optional parameters + # @option opts [Array] :filter_view_name Filter mappings by RUM view name. + # @option opts [Array] :filter_team_handle Filter mappings by owning team handle. + # @option opts [Array] :filter_application_id Filter mappings by RUM application ID. Each value must be a valid UUID. + # @option opts [Array] :filter_service Filter mappings by RUM application service name. + # @return [Array<(TeamsOwnershipRulesResponse, Integer, Hash)>] TeamsOwnershipRulesResponse data, response status code and response headers + def list_teams_ownership_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_teams_ownership_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_teams_ownership_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_teams_ownership_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumTeamsOwnershipAPI.list_teams_ownership_rules ...' + end + # resource path + local_var_path = '/api/v2/rum/config/teams-ownership/rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[view_name]'] = @api_client.build_collection_param(opts[:'filter_view_name'], :multi) if !opts[:'filter_view_name'].nil? + query_params[:'filter[team_handle]'] = @api_client.build_collection_param(opts[:'filter_team_handle'], :multi) if !opts[:'filter_team_handle'].nil? + query_params[:'filter[application_id]'] = @api_client.build_collection_param(opts[:'filter_application_id'], :multi) if !opts[:'filter_application_id'].nil? + query_params[:'filter[service]'] = @api_client.build_collection_param(opts[:'filter_service'], :multi) if !opts[:'filter_service'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamsOwnershipRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_teams_ownership_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumTeamsOwnershipAPI#list_teams_ownership_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_error.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_error.rb new file mode 100644 index 000000000000..153a8ae0ad6b --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_error.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An error encountered while validating or applying an operation. + class TeamsOwnershipMappingBatchError + include BaseGenericModel + + # A human-readable explanation specific to this error. + attr_accessor :detail + + # The HTTP status code applicable to this error. + attr_reader :status + + # A short, human-readable summary of the error. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'detail' => :'detail', + :'status' => :'status', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'detail' => :'String', + :'status' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail && + status == o.status && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [detail, status, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation.rb new file mode 100644 index 000000000000..cfa075ff6ff0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single add or remove operation, applied atomically with every other operation in the request. + class TeamsOwnershipMappingBatchOperation + include BaseGenericModel + + # The mapping to add. Required when `op` is `add`. + attr_accessor :data + + # Whether this operation adds a new mapping or removes an existing one. + attr_reader :op + + # Identifies an existing mapping to remove. Required when `op` is `remove`. + attr_accessor :ref + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'op' => :'op', + :'ref' => :'ref' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamsOwnershipMappingBatchOperationData', + :'op' => :'TeamsOwnershipMappingBatchOperationOp', + :'ref' => :'TeamsOwnershipMappingBatchOperationRef' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperation` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'op') + self.op = attributes[:'op'] + end + + if attributes.key?(:'ref') + self.ref = attributes[:'ref'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @op.nil? + true + end + + # Custom attribute writer method with validation + # @param op [Object] Object to be assigned + # @!visibility private + def op=(op) + if op.nil? + fail ArgumentError, 'invalid value for "op", op cannot be nil.' + end + @op = op + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + op == o.op && + ref == o.ref && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, op, ref, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data.rb new file mode 100644 index 000000000000..871af5fe72e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The mapping to add. Required when `op` is `add`. + class TeamsOwnershipMappingBatchOperationData + include BaseGenericModel + + # The attributes of the mapping to add. `team_handle` and `view_name` are required + # when `op` is `add`. + attr_reader :attributes + + # The type of the resource. The value should always be teams_ownership_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamsOwnershipMappingBatchOperationDataAttributes', + :'type' => :'TeamsOwnershipMappingType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data_attributes.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data_attributes.rb new file mode 100644 index 000000000000..2c98091cb476 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_data_attributes.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the mapping to add. `team_handle` and `view_name` are required + # when `op` is `add`. + class TeamsOwnershipMappingBatchOperationDataAttributes + include BaseGenericModel + + # The ID of the RUM application this mapping applies to. + # For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + # For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + attr_accessor :application_id + + # How the `view_name` is matched against RUM view names. + attr_accessor :match_type + + # The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + attr_accessor :service + + # The handle of the team that owns the matched RUM views. + attr_accessor :team_handle + + # The RUM view name to match, or its prefix when `match_type` is `prefix`. + attr_accessor :view_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'application_id' => :'application_id', + :'match_type' => :'match_type', + :'service' => :'service', + :'team_handle' => :'team_handle', + :'view_name' => :'view_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'UUID', + :'match_type' => :'TeamsOwnershipMatchType', + :'service' => :'String', + :'team_handle' => :'String', + :'view_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'team_handle') + self.team_handle = attributes[:'team_handle'] + end + + if attributes.key?(:'view_name') + self.view_name = attributes[:'view_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + match_type == o.match_type && + service == o.service && + team_handle == o.team_handle && + view_name == o.view_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, match_type, service, team_handle, view_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_op.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_op.rb new file mode 100644 index 000000000000..5ddd1345024d --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_op.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Whether this operation adds a new mapping or removes an existing one. + class TeamsOwnershipMappingBatchOperationOp + include BaseEnumModel + + ADD = "add".freeze + REMOVE = "remove".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_ref.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_ref.rb new file mode 100644 index 000000000000..8de5a5719f33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_operation_ref.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Identifies an existing mapping to remove. Required when `op` is `remove`. + class TeamsOwnershipMappingBatchOperationRef + include BaseGenericModel + + # The ID of the mapping to remove. + attr_reader :id + + # The type of the resource. The value should always be teams_ownership_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'TeamsOwnershipMappingType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationRef` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_request.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_request.rb new file mode 100644 index 000000000000..4dd8706204a6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_request.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The request body for bulk-creating and bulk-removing teams ownership mappings. + class TeamsOwnershipMappingBatchRequest + include BaseGenericModel + + # The ordered list of add and remove operations to apply atomically. + attr_reader :atomic_operations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'atomic_operations' => :'atomic:operations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'atomic_operations' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'atomic_operations') + if (value = attributes[:'atomic_operations']).is_a?(Array) + self.atomic_operations = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @atomic_operations.nil? + true + end + + # Custom attribute writer method with validation + # @param atomic_operations [Object] Object to be assigned + # @!visibility private + def atomic_operations=(atomic_operations) + if atomic_operations.nil? + fail ArgumentError, 'invalid value for "atomic_operations", atomic_operations cannot be nil.' + end + @atomic_operations = atomic_operations + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + atomic_operations == o.atomic_operations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [atomic_operations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_response.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_response.rb new file mode 100644 index 000000000000..f8692b5ae0ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response body for the bulk create and remove operation. On success, `atomic:results` + # contains one entry per operation, in request order. On failure, no operations were applied + # and `errors` describes what went wrong. + class TeamsOwnershipMappingBatchResponse + include BaseGenericModel + + # The result of each operation. + # Add operations are processed first, then remove operations, so results may not appear + # in the same order as the request. Present only on success. + attr_accessor :atomic_results + + # The validation or processing errors encountered. Present only when the request could not be completed. + attr_accessor :errors + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'atomic_results' => :'atomic:results', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'atomic_results' => :'Array', + :'errors' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'atomic_results') + if (value = attributes[:'atomic_results']).is_a?(Array) + self.atomic_results = value + end + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + atomic_results == o.atomic_results && + errors == o.errors && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [atomic_results, errors, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result.rb new file mode 100644 index 000000000000..64c7fb2b2412 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The result of a single operation. + # Add operations are processed first, then remove operations, so results may not appear + # in the same order as the request. Empty for `remove` operations. + class TeamsOwnershipMappingBatchResult + include BaseGenericModel + + # The mapping created by an `add` operation. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamsOwnershipMappingBatchResultData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result_data.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result_data.rb new file mode 100644 index 000000000000..2763f8e38828 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_batch_result_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The mapping created by an `add` operation. + class TeamsOwnershipMappingBatchResultData + include BaseGenericModel + + # The attributes of a teams ownership mapping. + attr_reader :attributes + + # The unique identifier of the teams ownership mapping. + attr_reader :id + + # The type of the resource. The value should always be teams_ownership_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamsOwnershipMappingResponseAttributes', + :'id' => :'String', + :'type' => :'TeamsOwnershipMappingType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingBatchResultData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data.rb new file mode 100644 index 000000000000..e3be701b8c34 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data envelope for a teams ownership mapping create request. + class TeamsOwnershipMappingCreateData + include BaseGenericModel + + # The attributes of the teams ownership mapping to create. + attr_reader :attributes + + # The type of the resource. The value should always be teams_ownership_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamsOwnershipMappingCreateDataAttributes', + :'type' => :'TeamsOwnershipMappingType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data_attributes.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data_attributes.rb new file mode 100644 index 000000000000..5666b538d9e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_data_attributes.rb @@ -0,0 +1,176 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the teams ownership mapping to create. + class TeamsOwnershipMappingCreateDataAttributes + include BaseGenericModel + + # The ID of the RUM application this mapping applies to. + # For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + # For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + attr_accessor :application_id + + # How the `view_name` is matched against RUM view names. + attr_accessor :match_type + + # The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + attr_accessor :service + + # The handle of the team that owns the matched RUM views. + attr_reader :team_handle + + # The RUM view name to match, or its prefix when `match_type` is `prefix`. + attr_reader :view_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'application_id' => :'application_id', + :'match_type' => :'match_type', + :'service' => :'service', + :'team_handle' => :'team_handle', + :'view_name' => :'view_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'UUID', + :'match_type' => :'TeamsOwnershipMatchType', + :'service' => :'String', + :'team_handle' => :'String', + :'view_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingCreateDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'team_handle') + self.team_handle = attributes[:'team_handle'] + end + + if attributes.key?(:'view_name') + self.view_name = attributes[:'view_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @team_handle.nil? + return false if @view_name.nil? + true + end + + # Custom attribute writer method with validation + # @param team_handle [Object] Object to be assigned + # @!visibility private + def team_handle=(team_handle) + if team_handle.nil? + fail ArgumentError, 'invalid value for "team_handle", team_handle cannot be nil.' + end + @team_handle = team_handle + end + + # Custom attribute writer method with validation + # @param view_name [Object] Object to be assigned + # @!visibility private + def view_name=(view_name) + if view_name.nil? + fail ArgumentError, 'invalid value for "view_name", view_name cannot be nil.' + end + @view_name = view_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + match_type == o.match_type && + service == o.service && + team_handle == o.team_handle && + view_name == o.view_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, match_type, service, team_handle, view_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_request.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_request.rb new file mode 100644 index 000000000000..a633cde4671c --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The request body for creating a teams ownership mapping. + class TeamsOwnershipMappingCreateRequest + include BaseGenericModel + + # The JSON:API data envelope for a teams ownership mapping create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamsOwnershipMappingCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_response.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response.rb new file mode 100644 index 000000000000..776f2bb13786 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response body for a single teams ownership mapping. + class TeamsOwnershipMappingResponse + include BaseGenericModel + + # The JSON:API data envelope for a teams ownership mapping. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamsOwnershipMappingResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_attributes.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_attributes.rb new file mode 100644 index 000000000000..2ec5424df3f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_attributes.rb @@ -0,0 +1,272 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a teams ownership mapping. + class TeamsOwnershipMappingResponseAttributes + include BaseGenericModel + + # The ID of the RUM application this mapping applies to. + # For browser applications, this is the real application UUID. + # For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + attr_reader :application_id + + # Timestamp when the mapping was created. + attr_reader :created_at + + # The UUID of the user who created the mapping. + attr_reader :created_by + + # How the `view_name` is matched against RUM view names. + attr_reader :match_type + + # The ID of the organization that owns this mapping. + attr_reader :org_id + + # The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + attr_reader :service + + # The handle of the team that owns the matched RUM views. + attr_reader :team_handle + + # The RUM view name to match, or its prefix when `match_type` is `prefix`. + attr_reader :view_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'application_id' => :'application_id', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'match_type' => :'match_type', + :'org_id' => :'org_id', + :'service' => :'service', + :'team_handle' => :'team_handle', + :'view_name' => :'view_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'String', + :'created_at' => :'Time', + :'created_by' => :'String', + :'match_type' => :'TeamsOwnershipMatchType', + :'org_id' => :'Integer', + :'service' => :'String', + :'team_handle' => :'String', + :'view_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'team_handle') + self.team_handle = attributes[:'team_handle'] + end + + if attributes.key?(:'view_name') + self.view_name = attributes[:'view_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @application_id.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @match_type.nil? + return false if @org_id.nil? + return false if @service.nil? + return false if @team_handle.nil? + return false if @view_name.nil? + true + end + + # Custom attribute writer method with validation + # @param application_id [Object] Object to be assigned + # @!visibility private + def application_id=(application_id) + if application_id.nil? + fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.' + end + @application_id = application_id + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param match_type [Object] Object to be assigned + # @!visibility private + def match_type=(match_type) + if match_type.nil? + fail ArgumentError, 'invalid value for "match_type", match_type cannot be nil.' + end + @match_type = match_type + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param team_handle [Object] Object to be assigned + # @!visibility private + def team_handle=(team_handle) + if team_handle.nil? + fail ArgumentError, 'invalid value for "team_handle", team_handle cannot be nil.' + end + @team_handle = team_handle + end + + # Custom attribute writer method with validation + # @param view_name [Object] Object to be assigned + # @!visibility private + def view_name=(view_name) + if view_name.nil? + fail ArgumentError, 'invalid value for "view_name", view_name cannot be nil.' + end + @view_name = view_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + created_at == o.created_at && + created_by == o.created_by && + match_type == o.match_type && + org_id == o.org_id && + service == o.service && + team_handle == o.team_handle && + view_name == o.view_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, created_at, created_by, match_type, org_id, service, team_handle, view_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_data.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_data.rb new file mode 100644 index 000000000000..09b5f2f6e0b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data envelope for a teams ownership mapping. + class TeamsOwnershipMappingResponseData + include BaseGenericModel + + # The attributes of a teams ownership mapping. + attr_reader :attributes + + # The unique identifier of the teams ownership mapping. + attr_reader :id + + # The type of the resource. The value should always be teams_ownership_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamsOwnershipMappingResponseAttributes', + :'id' => :'String', + :'type' => :'TeamsOwnershipMappingType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mapping_type.rb b/lib/datadog_api_client/v2/models/teams_ownership_mapping_type.rb new file mode 100644 index 000000000000..cb254fcb4129 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mapping_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be teams_ownership_mappings. + class TeamsOwnershipMappingType + include BaseEnumModel + + TEAMS_OWNERSHIP_MAPPINGS = "teams_ownership_mappings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_mappings_response.rb b/lib/datadog_api_client/v2/models/teams_ownership_mappings_response.rb new file mode 100644 index 000000000000..60e4113c1bbd --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_mappings_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response body for a list of teams ownership mappings. + class TeamsOwnershipMappingsResponse + include BaseGenericModel + + # A list of teams ownership mappings. + attr_reader :data + + # Object describing meta attributes of response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ResponseMetaAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipMappingsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_match_type.rb b/lib/datadog_api_client/v2/models/teams_ownership_match_type.rb new file mode 100644 index 000000000000..670e5d0ab44e --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_match_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # How the `view_name` is matched against RUM view names. + class TeamsOwnershipMatchType + include BaseEnumModel + + EXACT = "exact".freeze + PREFIX = "prefix".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_rule_response_attributes.rb b/lib/datadog_api_client/v2/models/teams_ownership_rule_response_attributes.rb new file mode 100644 index 000000000000..a8ad56fc6c3a --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_rule_response_attributes.rb @@ -0,0 +1,211 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a teams ownership rule. + class TeamsOwnershipRuleResponseAttributes + include BaseGenericModel + + # The ID of the RUM application this mapping applies to. + # For browser applications, this is the real application UUID. + # For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + attr_reader :application_id + + # How the `view_name` is matched against RUM view names. + attr_reader :match_type + + # The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + attr_reader :service + + # The teams that own the matched views, each paired with the ID of its underlying mapping. + attr_reader :teams + + # The RUM view name to match, or its prefix when `match_type` is `prefix`. + attr_reader :view_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'application_id' => :'application_id', + :'match_type' => :'match_type', + :'service' => :'service', + :'teams' => :'teams', + :'view_name' => :'view_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'String', + :'match_type' => :'TeamsOwnershipMatchType', + :'service' => :'String', + :'teams' => :'Array', + :'view_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipRuleResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'teams') + if (value = attributes[:'teams']).is_a?(Array) + self.teams = value + end + end + + if attributes.key?(:'view_name') + self.view_name = attributes[:'view_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @application_id.nil? + return false if @match_type.nil? + return false if @service.nil? + return false if @teams.nil? + return false if @view_name.nil? + true + end + + # Custom attribute writer method with validation + # @param application_id [Object] Object to be assigned + # @!visibility private + def application_id=(application_id) + if application_id.nil? + fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.' + end + @application_id = application_id + end + + # Custom attribute writer method with validation + # @param match_type [Object] Object to be assigned + # @!visibility private + def match_type=(match_type) + if match_type.nil? + fail ArgumentError, 'invalid value for "match_type", match_type cannot be nil.' + end + @match_type = match_type + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param teams [Object] Object to be assigned + # @!visibility private + def teams=(teams) + if teams.nil? + fail ArgumentError, 'invalid value for "teams", teams cannot be nil.' + end + @teams = teams + end + + # Custom attribute writer method with validation + # @param view_name [Object] Object to be assigned + # @!visibility private + def view_name=(view_name) + if view_name.nil? + fail ArgumentError, 'invalid value for "view_name", view_name cannot be nil.' + end + @view_name = view_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + match_type == o.match_type && + service == o.service && + teams == o.teams && + view_name == o.view_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, match_type, service, teams, view_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_rule_response_data.rb b/lib/datadog_api_client/v2/models/teams_ownership_rule_response_data.rb new file mode 100644 index 000000000000..709c587e0dd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_rule_response_data.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data envelope for a teams ownership rule. + class TeamsOwnershipRuleResponseData + include BaseGenericModel + + # The attributes of a teams ownership rule. + attr_reader :attributes + + # A deterministic identifier derived from the rule's grouping key. + # This ID cannot be used to delete the rule directly; delete individual mappings + # using the `mapping_id` under `teams` instead. + attr_reader :id + + # The type of the resource. The value should always be teams_ownership_grouped_mappings. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamsOwnershipRuleResponseAttributes', + :'id' => :'String', + :'type' => :'TeamsOwnershipRuleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipRuleResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_rule_team_mapping.rb b/lib/datadog_api_client/v2/models/teams_ownership_rule_team_mapping.rb new file mode 100644 index 000000000000..5a5fb831cc26 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_rule_team_mapping.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual team's ownership entry within a teams ownership rule. + class TeamsOwnershipRuleTeamMapping + include BaseGenericModel + + # The ID of the underlying mapping, used to delete this team's ownership individually. + attr_reader :mapping_id + + # The handle of the owning team. + attr_reader :team_handle + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mapping_id' => :'mapping_id', + :'team_handle' => :'team_handle' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mapping_id' => :'String', + :'team_handle' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipRuleTeamMapping` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'mapping_id') + self.mapping_id = attributes[:'mapping_id'] + end + + if attributes.key?(:'team_handle') + self.team_handle = attributes[:'team_handle'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @mapping_id.nil? + return false if @team_handle.nil? + true + end + + # Custom attribute writer method with validation + # @param mapping_id [Object] Object to be assigned + # @!visibility private + def mapping_id=(mapping_id) + if mapping_id.nil? + fail ArgumentError, 'invalid value for "mapping_id", mapping_id cannot be nil.' + end + @mapping_id = mapping_id + end + + # Custom attribute writer method with validation + # @param team_handle [Object] Object to be assigned + # @!visibility private + def team_handle=(team_handle) + if team_handle.nil? + fail ArgumentError, 'invalid value for "team_handle", team_handle cannot be nil.' + end + @team_handle = team_handle + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mapping_id == o.mapping_id && + team_handle == o.team_handle && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mapping_id, team_handle, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_rule_type.rb b/lib/datadog_api_client/v2/models/teams_ownership_rule_type.rb new file mode 100644 index 000000000000..21319eb5ec81 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_rule_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be teams_ownership_grouped_mappings. + class TeamsOwnershipRuleType + include BaseEnumModel + + TEAMS_OWNERSHIP_GROUPED_MAPPINGS = "teams_ownership_grouped_mappings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/teams_ownership_rules_response.rb b/lib/datadog_api_client/v2/models/teams_ownership_rules_response.rb new file mode 100644 index 000000000000..10b18f03a81a --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_ownership_rules_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response body for a list of teams ownership rules. + class TeamsOwnershipRulesResponse + include BaseGenericModel + + # A list of teams ownership rules. + attr_reader :data + + # Object describing meta attributes of response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ResponseMetaAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsOwnershipRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end