diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 4b6dc560f..45e2c2e05 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -790,6 +790,14 @@ components:
required: true
schema:
type: string
+ MembershipSort:
+ description: >-
+ Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ in: query
+ name: sort
+ required: false
+ schema:
+ $ref: "#/components/schemas/OrgGroupMembershipSortOption"
MetricID:
description: The name of the log-based metric.
in: path
@@ -921,6 +929,148 @@ components:
example: "f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a"
format: uuid
type: string
+ OrgGroupId:
+ description: The ID of the org group.
+ in: path
+ name: org_group_id
+ required: true
+ schema:
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupInclude:
+ description: >-
+ List of related resources to include.
+ explode: false
+ in: query
+ name: include
+ required: false
+ schema:
+ example:
+ - memberships
+ items:
+ $ref: "#/components/schemas/OrgGroupIncludeOption"
+ type: array
+ style: form
+ OrgGroupMembershipFilterOrgGroupId:
+ description: Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.
+ in: query
+ name: filter[org_group_id]
+ required: false
+ schema:
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupMembershipFilterOrgUuid:
+ description: Filter memberships by org UUID. Returns a single-item list.
+ in: query
+ name: filter[org_uuid]
+ required: false
+ schema:
+ example: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ format: uuid
+ type: string
+ OrgGroupMembershipId:
+ description: The ID of the org group membership.
+ in: path
+ name: org_group_membership_id
+ required: true
+ schema:
+ example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ format: uuid
+ type: string
+ OrgGroupPageNumber:
+ description: The page number to return.
+ in: query
+ name: page[number]
+ required: false
+ schema:
+ default: 0
+ example: 0
+ format: int64
+ minimum: 0
+ type: integer
+ OrgGroupPageSize:
+ description: The number of items per page. Maximum is 1000.
+ in: query
+ name: page[size]
+ required: false
+ schema:
+ default: 50
+ example: 50
+ format: int64
+ maximum: 1000
+ minimum: 1
+ type: integer
+ OrgGroupPolicyFilterOrgGroupId:
+ description: Filter policies by org group ID.
+ in: query
+ name: filter[org_group_id]
+ required: true
+ schema:
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupPolicyFilterPolicyName:
+ description: Filter policies by policy name.
+ in: query
+ name: filter[policy_name]
+ required: false
+ schema:
+ example: monitor_timezone
+ type: string
+ OrgGroupPolicyId:
+ description: The ID of the org group policy.
+ in: path
+ name: org_group_policy_id
+ required: true
+ schema:
+ example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupPolicyOverrideFilterOrgGroupId:
+ description: Filter policy overrides by org group ID.
+ in: query
+ name: filter[org_group_id]
+ required: true
+ schema:
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupPolicyOverrideFilterPolicyId:
+ description: Filter policy overrides by policy ID.
+ in: query
+ name: filter[policy_id]
+ required: false
+ schema:
+ example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ OrgGroupPolicyOverrideId:
+ description: The ID of the org group policy override.
+ in: path
+ name: org_group_policy_override_id
+ required: true
+ schema:
+ example: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ format: uuid
+ type: string
+ OrgGroupSort:
+ description: >-
+ Field to sort org groups by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ in: query
+ name: sort
+ required: false
+ schema:
+ $ref: "#/components/schemas/OrgGroupSortOption"
+ OverrideSort:
+ description: >-
+ Field to sort overrides by. Supported values: `id`, `org_uuid`, `-id`, `-org_uuid`. Defaults to `id`.
+ in: query
+ name: sort
+ required: false
+ schema:
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideSortOption"
PageNumber:
description: Specific page number to return.
in: query
@@ -959,6 +1109,14 @@ components:
required: true
schema:
type: string
+ PolicySort:
+ description: >-
+ Field to sort policies by. Supported values: `id`, `name`, `-id`, `-name`. Defaults to `id`.
+ in: query
+ name: sort
+ required: false
+ schema:
+ $ref: "#/components/schemas/OrgGroupPolicySortOption"
ProductName:
description: Name of the product to be deleted, either `logs` or `rum`.
in: path
@@ -29692,6 +29850,22 @@ components:
type: string
x-enum-varnames:
- INCIDENTS_GLOBAL_SETTINGS
+ GlobalOrgIdentifier:
+ description: A unique identifier for an organization including its site.
+ properties:
+ org_site:
+ description: The site of the organization.
+ example: "datadoghq.com"
+ type: string
+ org_uuid:
+ description: The UUID of the organization.
+ example: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ format: uuid
+ type: string
+ required:
+ - org_uuid
+ - org_site
+ type: object
GlobalVariableData:
description: Synthetics global variable data. Wrapper around the global variable object.
properties:
@@ -46179,7 +46353,7 @@ components:
$ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRuleMatchRule"
type: array
source:
- description: The value of the source field in log events to be processed by the Grok rules.
+ description: The name of the field in the log event to apply the Grok rules to.
example: "message"
type: string
support_rules:
@@ -48893,851 +49067,1743 @@ components:
type: string
x-enum-varnames:
- USERS
- Organization:
- description: Organization object.
- properties:
- attributes:
- $ref: "#/components/schemas/OrganizationAttributes"
- id:
- description: ID of the organization.
- type: string
- type:
- $ref: "#/components/schemas/OrganizationsType"
- required:
- - type
- type: object
- OrganizationAttributes:
- description: Attributes of the organization.
+ OrgGroupAttributes:
+ description: Attributes of an org group.
properties:
created_at:
- description: Creation time of the organization.
+ description: Timestamp when the org group was created.
+ example: "2024-01-15T10:30:00Z"
format: date-time
type: string
- description:
- description: Description of the organization.
- type: string
- disabled:
- description: Whether or not the organization is disabled.
- type: boolean
modified_at:
- description: Time of last organization modification.
+ description: Timestamp when the org group was last modified.
+ example: "2024-01-15T10:30:00Z"
format: date-time
type: string
name:
- description: Name of the organization.
- type: string
- public_id:
- description: Public ID of the organization.
+ description: The name of the org group.
+ example: "My Org Group"
type: string
- sharing:
- description: Sharing type of the organization.
+ owner_org_site:
+ description: The site of the organization that owns this org group.
+ example: "datadoghq.com"
type: string
- url:
- description: URL of the site that this organization exists at.
+ owner_org_uuid:
+ description: The UUID of the organization that owns this org group.
+ example: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ format: uuid
type: string
+ required:
+ - name
+ - owner_org_uuid
+ - owner_org_site
+ - created_at
+ - modified_at
type: object
- OrganizationsType:
- default: orgs
- description: Organizations resource type.
- enum:
- - orgs
- example: orgs
- type: string
- x-enum-varnames:
- - ORGS
- OutboundEdge:
- description: The definition of `OutboundEdge` object.
+ OrgGroupCreateAttributes:
+ description: Attributes for creating an org group.
properties:
- branchName:
- description: The `OutboundEdge` `branchName`.
- example: ""
- type: string
- nextStepName:
- description: The `OutboundEdge` `nextStepName`.
- example: ""
+ name:
+ description: The name of the org group.
+ example: "My Org Group"
type: string
required:
- - nextStepName
- - branchName
+ - name
type: object
- OutcomeType:
- default: outcome
- description: The JSON:API type for an outcome.
- enum:
- - outcome
- example: outcome
- type: string
- x-enum-varnames:
- - OUTCOME
- OutcomesBatchAttributes:
- description: The JSON:API attributes for a batched set of scorecard outcomes.
+ OrgGroupCreateData:
+ description: Data for creating an org group.
properties:
- results:
- description: Set of scorecard outcomes to update.
- items:
- $ref: "#/components/schemas/OutcomesBatchRequestItem"
- type: array
+ attributes:
+ $ref: "#/components/schemas/OrgGroupCreateAttributes"
+ type:
+ $ref: "#/components/schemas/OrgGroupType"
+ required:
+ - type
+ - attributes
type: object
- OutcomesBatchRequest:
- description: Scorecard outcomes batch request.
+ OrgGroupCreateRequest:
+ description: Request to create an org group.
properties:
data:
- $ref: "#/components/schemas/OutcomesBatchRequestData"
+ $ref: "#/components/schemas/OrgGroupCreateData"
+ required:
+ - data
type: object
- OutcomesBatchRequestData:
- description: Scorecard outcomes batch request data.
+ OrgGroupData:
+ description: An org group resource.
properties:
attributes:
- $ref: "#/components/schemas/OutcomesBatchAttributes"
- type:
- $ref: "#/components/schemas/OutcomesBatchType"
- type: object
- OutcomesBatchRequestItem:
- description: Scorecard outcome for a specific rule, for a given service within a batched update.
- properties:
- remarks:
- description: >-
- Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks.
- example: 'See: Services'
- type: string
- rule_id:
- $ref: "#/components/schemas/RuleId"
- service_name:
- description: The unique name for a service in the catalog.
- example: my-service
+ $ref: "#/components/schemas/OrgGroupAttributes"
+ id:
+ description: The ID of the org group.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
type: string
- state:
- $ref: "#/components/schemas/State"
+ relationships:
+ $ref: "#/components/schemas/OrgGroupRelationships"
+ type:
+ $ref: "#/components/schemas/OrgGroupType"
required:
- - rule_id
- - service_name
- - state
+ - id
+ - type
+ - attributes
type: object
- OutcomesBatchResponse:
- description: Scorecard outcomes batch response.
+ OrgGroupIncludeOption:
+ description: Allowed include options for org group endpoints.
+ enum:
+ - memberships
+ type: string
+ x-enum-varnames:
+ - MEMBERSHIPS
+ OrgGroupListResponse:
+ description: Response containing a list of org groups.
properties:
data:
- $ref: "#/components/schemas/OutcomesBatchResponseData"
- example:
- - attributes:
- service_name: my-service
- state: pass
- id: "outcome-abc123"
- type: rule-outcome
+ description: An array of org groups.
+ items:
+ $ref: "#/components/schemas/OrgGroupData"
+ type: array
+ included:
+ description: Related resources included in the response when requested with the `include` parameter.
+ items:
+ $ref: "#/components/schemas/OrgGroupMembershipData"
+ type: array
meta:
- $ref: "#/components/schemas/OutcomesBatchResponseMeta"
+ $ref: "#/components/schemas/OrgGroupPaginationMeta"
required:
- data
- - meta
type: object
- OutcomesBatchResponseAttributes:
- description: The JSON:API attributes for an outcome.
+ OrgGroupMembershipAttributes:
+ description: Attributes of an org group membership.
properties:
created_at:
- description: Creation time of the rule outcome.
+ description: Timestamp when the membership was created.
+ example: "2024-01-15T10:30:00Z"
format: date-time
type: string
modified_at:
- description: Time of last rule outcome modification.
+ description: Timestamp when the membership was last modified.
+ example: "2024-01-15T10:30:00Z"
format: date-time
type: string
- remarks:
- description: >-
- Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks.
- example: 'See: Services'
+ org_name:
+ description: The name of the member organization.
+ example: "Acme Corp"
type: string
- service_name:
- description: The unique name for a service in the catalog.
- example: my-service
+ org_site:
+ description: The site of the member organization.
+ example: "datadoghq.com"
type: string
- state:
- $ref: "#/components/schemas/State"
+ org_uuid:
+ description: The UUID of the member organization.
+ example: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ format: uuid
+ type: string
+ required:
+ - org_name
+ - org_uuid
+ - org_site
+ - created_at
+ - modified_at
type: object
- OutcomesBatchResponseData:
- description: List of rule outcomes which were affected during the bulk operation.
- items:
- $ref: "#/components/schemas/OutcomesResponseDataItem"
- type: array
- OutcomesBatchResponseMeta:
- description: Metadata pertaining to the bulk operation.
+ OrgGroupMembershipBulkUpdateAttributes:
+ description: Attributes for bulk updating org group memberships.
properties:
- total_received:
- description: Total number of scorecard results received during the bulk operation.
- format: int64
- type: integer
- total_updated:
- description: Total number of scorecard results modified during the bulk operation.
- format: int64
- type: integer
+ orgs:
+ description: List of organizations to move. Maximum 100 per request.
+ items:
+ $ref: "#/components/schemas/GlobalOrgIdentifier"
+ type: array
+ required:
+ - orgs
type: object
- OutcomesBatchType:
- default: batched-outcome
- description: The JSON:API type for scorecard outcomes.
- enum: [batched-outcome]
- example: batched-outcome
- type: string
- x-enum-varnames: [BATCHED_OUTCOME]
- OutcomesResponse:
- description: Scorecard outcomes - the result of a rule for a service.
+ OrgGroupMembershipBulkUpdateData:
+ description: Data for bulk updating org group memberships.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OrgGroupMembershipBulkUpdateAttributes"
+ relationships:
+ $ref: "#/components/schemas/OrgGroupMembershipBulkUpdateRelationships"
+ type:
+ $ref: "#/components/schemas/OrgGroupMembershipBulkUpdateType"
+ required:
+ - type
+ - attributes
+ - relationships
+ type: object
+ OrgGroupMembershipBulkUpdateRelationships:
+ description: Relationships for bulk updating memberships.
+ properties:
+ source_org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ target_org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ required:
+ - source_org_group
+ - target_org_group
+ type: object
+ OrgGroupMembershipBulkUpdateRequest:
+ description: Request to bulk update org group memberships.
properties:
data:
- $ref: "#/components/schemas/OutcomesResponseData"
- included:
- $ref: "#/components/schemas/OutcomesResponseIncluded"
- links:
- $ref: "#/components/schemas/OutcomesResponseLinks"
+ $ref: "#/components/schemas/OrgGroupMembershipBulkUpdateData"
+ required:
+ - data
type: object
- OutcomesResponseData:
- description: List of rule outcomes.
- items:
- $ref: "#/components/schemas/OutcomesResponseDataItem"
- type: array
- OutcomesResponseDataItem:
- description: A single rule outcome.
+ OrgGroupMembershipBulkUpdateType:
+ description: Org group membership bulk update resource type.
+ enum:
+ - org_group_membership_bulk_updates
+ example: org_group_membership_bulk_updates
+ type: string
+ x-enum-varnames:
+ - ORG_GROUP_MEMBERSHIP_BULK_UPDATES
+ OrgGroupMembershipData:
+ description: An org group membership resource.
properties:
attributes:
- $ref: "#/components/schemas/OutcomesBatchResponseAttributes"
+ $ref: "#/components/schemas/OrgGroupMembershipAttributes"
id:
- description: The unique ID for a rule outcome.
+ description: The ID of the org group membership.
+ example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ format: uuid
type: string
relationships:
- $ref: "#/components/schemas/RuleOutcomeRelationships"
+ $ref: "#/components/schemas/OrgGroupMembershipRelationships"
type:
- $ref: "#/components/schemas/OutcomeType"
+ $ref: "#/components/schemas/OrgGroupMembershipType"
+ required:
+ - id
+ - type
+ - attributes
type: object
- OutcomesResponseIncluded:
- description: Array of rule details.
- items:
- $ref: "#/components/schemas/OutcomesResponseIncludedItem"
- type: array
- OutcomesResponseIncludedItem:
- description: Attributes of the included rule.
+ OrgGroupMembershipListResponse:
+ description: Response containing a list of org group memberships.
+ properties:
+ data:
+ description: An array of org group memberships.
+ items:
+ $ref: "#/components/schemas/OrgGroupMembershipData"
+ type: array
+ meta:
+ $ref: "#/components/schemas/OrgGroupPaginationMeta"
+ required:
+ - data
+ type: object
+ OrgGroupMembershipRelationshipData:
+ description: A reference to an org group membership.
properties:
- attributes:
- $ref: "#/components/schemas/OutcomesResponseIncludedRuleAttributes"
id:
- $ref: "#/components/schemas/RuleId"
+ description: The ID of the membership.
+ example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ format: uuid
+ type: string
type:
- $ref: "#/components/schemas/RuleType"
+ $ref: "#/components/schemas/OrgGroupMembershipType"
+ required:
+ - id
+ - type
type: object
- OutcomesResponseIncludedRuleAttributes:
- description: Details of a rule.
+ OrgGroupMembershipRelationships:
+ description: Relationships of an org group membership.
properties:
- name:
- description: Name of the rule.
- example: Team Defined
- type: string
- scorecard_name:
- description: The scorecard name to which this rule must belong.
- example: Observability Best Practices
- type: string
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
type: object
- OutcomesResponseLinks:
- description: Links attributes.
+ OrgGroupMembershipResponse:
+ description: Response containing a single org group membership.
properties:
- next:
- description: |-
- Link for the next set of results.
- example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=100"
+ data:
+ $ref: "#/components/schemas/OrgGroupMembershipData"
+ required:
+ - data
+ type: object
+ OrgGroupMembershipSortOption:
+ default: uuid
+ description: Field to sort memberships by.
+ enum:
+ - name
+ - -name
+ - uuid
+ - -uuid
+ example: uuid
+ type: string
+ x-enum-varnames:
+ - NAME
+ - MINUS_NAME
+ - UUID
+ - MINUS_UUID
+ OrgGroupMembershipType:
+ description: Org group memberships resource type.
+ enum:
+ - org_group_memberships
+ example: org_group_memberships
+ type: string
+ x-enum-varnames:
+ - ORG_GROUP_MEMBERSHIPS
+ OrgGroupMembershipUpdateData:
+ description: Data for updating an org group membership.
+ properties:
+ id:
+ description: The ID of the membership.
+ example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ format: uuid
type: string
+ relationships:
+ $ref: "#/components/schemas/OrgGroupMembershipUpdateRelationships"
+ type:
+ $ref: "#/components/schemas/OrgGroupMembershipType"
+ required:
+ - id
+ - type
+ - relationships
type: object
- OutputSchema:
- description: "A list of output parameters for the workflow."
+ OrgGroupMembershipUpdateRelationships:
+ description: Relationships for updating a membership.
properties:
- parameters:
- description: The `OutputSchema` `parameters`.
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ required:
+ - org_group
+ type: object
+ OrgGroupMembershipUpdateRequest:
+ description: Request to update an org group membership.
+ properties:
+ data:
+ $ref: "#/components/schemas/OrgGroupMembershipUpdateData"
+ required:
+ - data
+ type: object
+ OrgGroupMembershipsRelationship:
+ description: Relationship to org group memberships.
+ properties:
+ data:
+ description: An array of membership relationship references.
items:
- $ref: "#/components/schemas/OutputSchemaParameters"
+ $ref: "#/components/schemas/OrgGroupMembershipRelationshipData"
type: array
+ required:
+ - data
type: object
- OutputSchemaParameters:
- description: The definition of `OutputSchemaParameters` object.
+ OrgGroupPaginationMeta:
+ description: Pagination metadata.
properties:
- defaultValue:
- description: The `OutputSchemaParameters` `defaultValue`.
- description:
- description: The `OutputSchemaParameters` `description`.
+ page:
+ $ref: "#/components/schemas/OrgGroupPaginationMetaPage"
+ required:
+ - page
+ type: object
+ OrgGroupPaginationMetaPage:
+ description: Page-based pagination details.
+ properties:
+ total_count:
+ description: The total number of items.
+ example: 42
+ format: int64
+ type: integer
+ required:
+ - total_count
+ type: object
+ OrgGroupPolicyAttributes:
+ description: Attributes of an org group policy.
+ properties:
+ content:
+ additionalProperties: {}
+ description: The policy content as key-value pairs.
+ example:
+ value: "UTC"
+ type: object
+ enforced_at:
+ description: Timestamp when the policy was enforced.
+ example: "2024-01-15T10:30:00Z"
+ format: date-time
type: string
- label:
- description: The `OutputSchemaParameters` `label`.
+ modified_at:
+ description: Timestamp when the policy was last modified.
+ example: "2024-01-15T10:30:00Z"
+ format: date-time
+ type: string
+ policy_name:
+ description: The name of the policy.
+ example: "monitor_timezone"
+ type: string
+ required:
+ - policy_name
+ - enforced_at
+ - modified_at
+ type: object
+ OrgGroupPolicyConfigAttributes:
+ description: Attributes of an org group policy config.
+ properties:
+ allowed_values:
+ description: The allowed values for this config.
+ example: ["UTC", "US/Eastern", "US/Pacific"]
+ items:
+ description: An allowed value for this config.
+ type: string
+ type: array
+ default_value:
+ description: The default value for this config.
+ example: "UTC"
+ description:
+ description: The description of the policy config.
+ example: "The default timezone for monitors."
type: string
name:
- description: The `OutputSchemaParameters` `name`.
- example: ""
+ description: The name of the policy config.
+ example: "monitor_timezone"
+ type: string
+ value_type:
+ description: The type of the value for this config.
+ example: "string"
type: string
- type:
- $ref: "#/components/schemas/OutputSchemaParametersType"
- value:
- description: The `OutputSchemaParameters` `value`.
required:
- name
+ - description
+ - value_type
+ - allowed_values
+ - default_value
+ type: object
+ OrgGroupPolicyConfigData:
+ description: An org group policy config resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OrgGroupPolicyConfigAttributes"
+ id:
+ description: The identifier of the policy config (uses the config name).
+ example: "monitor_timezone"
+ type: string
+ type:
+ $ref: "#/components/schemas/OrgGroupPolicyConfigType"
+ required:
+ - id
- type
+ - attributes
type: object
- OutputSchemaParametersType:
- description: The definition of `OutputSchemaParametersType` object.
- enum:
- - STRING
- - NUMBER
- - BOOLEAN
- - OBJECT
- - ARRAY_STRING
- - ARRAY_NUMBER
- - ARRAY_BOOLEAN
- - ARRAY_OBJECT
- example: STRING
- type: string
- x-enum-varnames:
- - STRING
- - NUMBER
- - BOOLEAN
- - OBJECT
- - ARRAY_STRING
- - ARRAY_NUMBER
- - ARRAY_BOOLEAN
- - ARRAY_OBJECT
- OverwriteAllocationsRequest:
- description: Request to overwrite targeting rules (allocations) for a feature flag in an environment.
+ OrgGroupPolicyConfigListResponse:
+ description: Response containing a list of org group policy configs.
properties:
data:
- description: Targeting rules (allocations) to replace existing ones with.
+ description: An array of org group policy configs.
items:
- $ref: "#/components/schemas/AllocationDataRequest"
+ $ref: "#/components/schemas/OrgGroupPolicyConfigData"
type: array
required:
- data
type: object
- PageUrgency:
- default: high
- description: On-Call Page urgency level.
+ OrgGroupPolicyConfigType:
+ description: Org group policy configs resource type.
enum:
- - low
- - high
- example: high
+ - org_group_policy_configs
+ example: org_group_policy_configs
type: string
x-enum-varnames:
- - LOW
- - HIGH
- PaginatedResponseMeta:
- description: Metadata for scores response.
+ - ORG_GROUP_POLICY_CONFIGS
+ OrgGroupPolicyCreateAttributes:
+ description: Attributes for creating an org group policy.
properties:
- count:
- description: Number of entities in this response.
- example: 10
- format: int64
- type: integer
- limit:
- description: Pagination limit.
- example: 10
- format: int64
- type: integer
- offset:
- description: Pagination offset.
- example: 0
- format: int64
- type: integer
- total:
- description: Total number of entities available.
- example: 150
- format: int64
- type: integer
+ content:
+ additionalProperties: {}
+ description: The policy content as key-value pairs.
+ example:
+ value: "UTC"
+ type: object
+ policy_name:
+ description: The name of the policy.
+ example: "monitor_timezone"
+ type: string
required:
- - count
- - total
- - limit
- - offset
- type: object
- Pagination:
- description: Pagination object.
- properties:
- total_count:
- description: Total count.
- format: int64
- type: integer
- total_filtered_count:
- description: Total count of elements matched by the filter.
- format: int64
- type: integer
+ - policy_name
+ - content
type: object
- PaginationMeta:
- description: Response metadata.
+ OrgGroupPolicyCreateData:
+ description: Data for creating an org group policy.
properties:
- page:
- $ref: "#/components/schemas/PaginationMetaPage"
- readOnly: true
+ attributes:
+ $ref: "#/components/schemas/OrgGroupPolicyCreateAttributes"
+ relationships:
+ $ref: "#/components/schemas/OrgGroupPolicyCreateRelationships"
+ type:
+ $ref: "#/components/schemas/OrgGroupPolicyType"
+ required:
+ - type
+ - attributes
+ - relationships
type: object
- PaginationMetaPage:
- description: Offset-based pagination schema.
- example:
- first_offset: 0
- last_offset: 900
- limit: 100
- next_offset: 100
- offset: 0
- prev_offset: 100
- total: 1000
- type: offset_limit
+ OrgGroupPolicyCreateRelationships:
+ description: Relationships for creating a policy.
properties:
- first_offset:
- description: Integer representing the offset to fetch the first page of results.
- example: 0
- format: int64
- type: integer
- last_offset:
- description: Integer representing the offset to fetch the last page of results.
- example: 900
- format: int64
- nullable: true
- type: integer
- limit:
- description: Integer representing the number of elements to be returned in the results.
- example: 100
- format: int64
- type: integer
- next_offset:
- description: >-
- Integer representing the index of the first element in the next page of results. Equal to page size added to the current offset.
- example: 100
- format: int64
- nullable: true
- type: integer
- offset:
- description: Integer representing the index of the first element in the results.
- example: 0
- format: int64
- type: integer
- prev_offset:
- description: Integer representing the index of the first element in the previous page of results.
- example: 100
- format: int64
- nullable: true
- type: integer
- total:
- description: Integer representing the total number of elements available.
- example: 1000
- format: int64
- nullable: true
- type: integer
- type:
- $ref: "#/components/schemas/PaginationMetaPageType"
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ required:
+ - org_group
type: object
- PaginationMetaPageType:
- default: offset_limit
- description: The pagination type used for offset-based pagination.
- enum:
- - offset_limit
- example: offset_limit
- type: string
- x-enum-varnames:
- - OFFSET_LIMIT
- Parameter:
- description: The definition of `Parameter` object.
+ OrgGroupPolicyCreateRequest:
+ description: Request to create an org group policy.
properties:
- name:
- description: The `Parameter` `name`.
- example: ""
- type: string
- value:
- description: The `Parameter` `value`.
+ data:
+ $ref: "#/components/schemas/OrgGroupPolicyCreateData"
required:
- - name
- - value
+ - data
type: object
- PartialAPIKey:
- description: Partial Datadog API key.
+ OrgGroupPolicyData:
+ description: An org group policy resource.
properties:
attributes:
- $ref: "#/components/schemas/PartialAPIKeyAttributes"
+ $ref: "#/components/schemas/OrgGroupPolicyAttributes"
id:
- description: ID of the API key.
+ description: The ID of the org group policy.
+ example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ format: uuid
type: string
relationships:
- $ref: "#/components/schemas/APIKeyRelationships"
+ $ref: "#/components/schemas/OrgGroupPolicyRelationships"
type:
- $ref: "#/components/schemas/APIKeysType"
+ $ref: "#/components/schemas/OrgGroupPolicyType"
+ required:
+ - id
+ - type
+ - attributes
type: object
- PartialAPIKeyAttributes:
- description: Attributes of a partial API key.
+ OrgGroupPolicyListResponse:
+ description: Response containing a list of org group policies.
properties:
- category:
- description: The category of the API key.
- type: string
+ data:
+ description: An array of org group policies.
+ items:
+ $ref: "#/components/schemas/OrgGroupPolicyData"
+ type: array
+ meta:
+ $ref: "#/components/schemas/OrgGroupPaginationMeta"
+ required:
+ - data
+ type: object
+ OrgGroupPolicyOverrideAttributes:
+ description: Attributes of an org group policy override.
+ properties:
+ content:
+ additionalProperties: {}
+ description: The override content as key-value pairs.
+ type: object
created_at:
- description: Creation date of the API key.
- example: "2020-11-23T10:00:00.000Z"
- readOnly: true
+ description: Timestamp when the override was created.
+ example: "2024-01-15T10:30:00Z"
+ format: date-time
type: string
- date_last_used:
- description: Date the API Key was last used.
- example: "2020-11-27T10:00:00.000Z"
+ modified_at:
+ description: Timestamp when the override was last modified.
+ example: "2024-01-15T10:30:00Z"
format: date-time
- nullable: true
- readOnly: true
type: string
- last4:
- description: The last four characters of the API key.
- example: "abcd"
- maxLength: 4
- minLength: 4
- readOnly: true
+ org_site:
+ description: The site of the organization that has the override.
+ example: "datadoghq.com"
type: string
- modified_at:
- description: Date the API key was last modified.
- example: "2020-11-23T10:00:00.000Z"
- readOnly: true
+ org_uuid:
+ description: The UUID of the organization that has the override.
+ example: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ format: uuid
type: string
- name:
- description: Name of the API key.
- example: "API Key for submitting metrics"
+ required:
+ - org_uuid
+ - org_site
+ - created_at
+ - modified_at
+ type: object
+ OrgGroupPolicyOverrideCreateAttributes:
+ description: Attributes for creating a policy override.
+ properties:
+ org_site:
+ description: The site of the organization.
+ example: "datadoghq.com"
type: string
- remote_config_read_enabled:
- description: The remote config read enabled status.
- type: boolean
+ org_uuid:
+ description: The UUID of the organization to grant the override.
+ example: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ format: uuid
+ type: string
+ required:
+ - org_uuid
+ - org_site
type: object
- PartialApplicationKey:
- description: Partial Datadog application key.
+ OrgGroupPolicyOverrideCreateData:
+ description: Data for creating an org group policy override.
properties:
attributes:
- $ref: "#/components/schemas/PartialApplicationKeyAttributes"
- id:
- description: ID of the application key.
- type: string
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideCreateAttributes"
relationships:
- $ref: "#/components/schemas/ApplicationKeyRelationships"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideCreateRelationships"
type:
- $ref: "#/components/schemas/ApplicationKeysType"
- type: object
- PartialApplicationKeyAttributes:
- description: Attributes of a partial application key.
- properties:
- created_at:
- description: Creation date of the application key.
- example: "2020-11-23T10:00:00.000Z"
- readOnly: true
- type: string
- last4:
- description: The last four characters of the application key.
- example: "abcd"
- maxLength: 4
- minLength: 4
- readOnly: true
- type: string
- last_used_at:
- description: Last usage timestamp of the application key.
- example: "2020-12-20T10:00:00.000Z"
- nullable: true
- readOnly: true
- type: string
- name:
- description: Name of the application key.
- example: "Application Key for managing dashboards"
- type: string
- scopes:
- description: Array of scopes to grant the application key.
- example: ["dashboards_read", "dashboards_write", "dashboards_public_share"]
- items:
- description: Name of scope.
- type: string
- nullable: true
- type: array
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideType"
+ required:
+ - type
+ - attributes
+ - relationships
type: object
- PartialApplicationKeyResponse:
- description: Response for retrieving a partial application key.
+ OrgGroupPolicyOverrideCreateRelationships:
+ description: Relationships for creating a policy override.
properties:
- data:
- $ref: "#/components/schemas/PartialApplicationKey"
- included:
- description: Array of objects related to the application key.
- items:
- $ref: "#/components/schemas/ApplicationKeyResponseIncludedItem"
- type: array
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ org_group_policy:
+ $ref: "#/components/schemas/OrgGroupPolicyRelationshipToOne"
+ required:
+ - org_group
+ - org_group_policy
type: object
- PatchAttachmentRequest:
- description: Request to update an attachment.
+ OrgGroupPolicyOverrideCreateRequest:
+ description: Request to create an org group policy override.
properties:
data:
- $ref: "#/components/schemas/PatchAttachmentRequestData"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideCreateData"
+ required:
+ - data
type: object
- PatchAttachmentRequestData:
- description: Attachment data for an update request.
+ OrgGroupPolicyOverrideData:
+ description: An org group policy override resource.
properties:
attributes:
- $ref: "#/components/schemas/PatchAttachmentRequestDataAttributes"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideAttributes"
id:
- description: The unique identifier of the attachment.
- example: "00000000-abcd-0002-0000-000000000000"
+ description: The ID of the policy override.
+ example: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ format: uuid
type: string
+ relationships:
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideRelationships"
type:
- $ref: "#/components/schemas/IncidentAttachmentType"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideType"
required:
+ - id
- type
+ - attributes
type: object
- PatchAttachmentRequestDataAttributes:
- description: The attributes for updating an attachment.
+ OrgGroupPolicyOverrideListResponse:
+ description: Response containing a list of org group policy overrides.
properties:
- attachment:
- $ref: "#/components/schemas/PatchAttachmentRequestDataAttributesAttachment"
+ data:
+ description: An array of org group policy overrides.
+ items:
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideData"
+ type: array
+ meta:
+ $ref: "#/components/schemas/OrgGroupPaginationMeta"
+ required:
+ - data
type: object
- PatchAttachmentRequestDataAttributesAttachment:
- description: The updated attachment object.
+ OrgGroupPolicyOverrideRelationships:
+ description: Relationships of an org group policy override.
properties:
- documentUrl:
- description: The updated URL for the attachment.
- example: https://app.datadoghq.com/notebook/124/Postmortem-IR-124
- type: string
- title:
- description: The updated title for the attachment.
- example: Postmortem-IR-124
- type: string
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
+ org_group_policy:
+ $ref: "#/components/schemas/OrgGroupPolicyRelationshipToOne"
type: object
- PatchComponentRequest:
- description: Request object for updating a component.
- example:
- data:
- attributes:
- name: Metrics Intake Service
- position: 4
- id: 1234abcd-12ab-34cd-56ef-123456abcdef
- type: components
+ OrgGroupPolicyOverrideResponse:
+ description: Response containing a single org group policy override.
properties:
data:
- $ref: "#/components/schemas/PatchComponentRequestData"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideData"
+ required:
+ - data
type: object
- PatchComponentRequestData:
- description: The data object for updating a component.
+ OrgGroupPolicyOverrideSortOption:
+ default: id
+ description: Field to sort overrides by.
+ enum:
+ - id
+ - -id
+ - org_uuid
+ - -org_uuid
+ example: id
+ type: string
+ x-enum-varnames:
+ - ID
+ - MINUS_ID
+ - ORG_UUID
+ - MINUS_ORG_UUID
+ OrgGroupPolicyOverrideType:
+ description: Org group policy overrides resource type.
+ enum:
+ - org_group_policy_overrides
+ example: org_group_policy_overrides
+ type: string
+ x-enum-varnames:
+ - ORG_GROUP_POLICY_OVERRIDES
+ OrgGroupPolicyOverrideUpdateAttributes:
+ description: Attributes for updating a policy override.
+ properties:
+ org_site:
+ description: The site of the organization.
+ example: "datadoghq.com"
+ type: string
+ org_uuid:
+ description: The UUID of the organization.
+ example: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ format: uuid
+ type: string
+ required:
+ - org_uuid
+ - org_site
+ type: object
+ OrgGroupPolicyOverrideUpdateData:
+ description: Data for updating a policy override.
properties:
attributes:
- $ref: "#/components/schemas/PatchComponentRequestDataAttributes"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideUpdateAttributes"
id:
- description: The ID of the component.
- example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ description: The ID of the policy override.
+ example: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
format: uuid
type: string
type:
- $ref: "#/components/schemas/StatusPagesComponentGroupType"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideType"
required:
- - attributes
- id
- type
+ - attributes
type: object
- PatchComponentRequestDataAttributes:
- description: The supported attributes for updating a component.
+ OrgGroupPolicyOverrideUpdateRequest:
+ description: Request to update an org group policy override.
properties:
- name:
- description: The name of the component.
- example: Web App
- type: string
- position:
- description: The position of the component. If the component belongs to a group, the position is relative to the other components in the group.
- example: 1
- format: int64
- type: integer
- type: object
- PatchDegradationRequest:
- description: Request object for updating a degradation.
- example:
data:
- attributes:
- components_affected:
- - id: 1234abcd-12ab-34cd-56ef-123456abcdef
- status: operational
- description: We've deployed a fix and latency has returned to normal. This issue has been resolved.
- status: resolved
- id: 1234abcd-12ab-34cd-56ef-123456abcdef
- type: degradations
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideUpdateData"
+ required:
+ - data
+ type: object
+ OrgGroupPolicyRelationshipToOne:
+ description: Relationship to a single org group policy.
properties:
data:
- $ref: "#/components/schemas/PatchDegradationRequestData"
+ $ref: "#/components/schemas/OrgGroupPolicyRelationshipToOneData"
+ required:
+ - data
type: object
- PatchDegradationRequestData:
- description: The data object for updating a degradation.
+ OrgGroupPolicyRelationshipToOneData:
+ description: A reference to an org group policy.
properties:
- attributes:
- $ref: "#/components/schemas/PatchDegradationRequestDataAttributes"
id:
- description: The ID of the degradation.
- example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ description: The ID of the policy.
+ example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
format: uuid
type: string
type:
- $ref: "#/components/schemas/PatchDegradationRequestDataType"
+ $ref: "#/components/schemas/OrgGroupPolicyType"
required:
- - attributes
- id
- type
type: object
- PatchDegradationRequestDataAttributes:
- description: The supported attributes for updating a degradation.
+ OrgGroupPolicyRelationships:
+ description: Relationships of an org group policy.
properties:
- components_affected:
- description: The components affected by the degradation.
- example:
- - id: 1234abcd-12ab-34cd-56ef-123456abcdef
- status: operational
- items:
- $ref: "#/components/schemas/PatchDegradationRequestDataAttributesComponentsAffectedItems"
- type: array
- description:
- description: The description of the degradation.
- example: We've deployed a fix and latency has returned to normal. This issue has been resolved.
- type: string
- status:
- $ref: "#/components/schemas/PatchDegradationRequestDataAttributesStatus"
- example: resolved
- title:
- description: The title of the degradation.
- example: Elevated API Latency
- type: string
+ org_group:
+ $ref: "#/components/schemas/OrgGroupRelationshipToOne"
type: object
- PatchDegradationRequestDataAttributesComponentsAffectedItems:
- description: A component affected by a degradation.
+ OrgGroupPolicyResponse:
+ description: Response containing a single org group policy.
properties:
- id:
- description: The ID of the component. Must be a component of type `component`.
- example: "1234abcd-12ab-34cd-56ef-123456abcdef"
- format: uuid
- type: string
- name:
- description: The name of the component.
- readOnly: true
- type: string
- status:
- $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus"
+ data:
+ $ref: "#/components/schemas/OrgGroupPolicyData"
required:
- - id
- - status
+ - data
type: object
- PatchDegradationRequestDataAttributesStatus:
- description: The status of the degradation.
+ OrgGroupPolicySortOption:
+ default: id
+ description: Field to sort policies by.
enum:
- - investigating
- - identified
- - monitoring
- - resolved
+ - id
+ - -id
+ - name
+ - -name
+ example: id
type: string
x-enum-varnames:
- - INVESTIGATING
- - IDENTIFIED
- - MONITORING
- - RESOLVED
- PatchDegradationRequestDataType:
- default: degradations
- description: Degradations resource type.
+ - ID
+ - MINUS_ID
+ - NAME
+ - MINUS_NAME
+ OrgGroupPolicyType:
+ description: Org group policies resource type.
enum:
- - degradations
- example: degradations
+ - org_group_policies
+ example: org_group_policies
type: string
x-enum-varnames:
- - DEGRADATIONS
- PatchIncidentNotificationTemplateRequest:
- description: Update request for a notification template.
+ - ORG_GROUP_POLICIES
+ OrgGroupPolicyUpdateAttributes:
+ description: Attributes for updating an org group policy.
+ properties:
+ content:
+ additionalProperties: {}
+ description: The policy content as key-value pairs.
+ example:
+ value: "UTC"
+ type: object
+ type: object
+ OrgGroupPolicyUpdateData:
+ description: Data for updating an org group policy.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OrgGroupPolicyUpdateAttributes"
+ id:
+ description: The ID of the policy.
+ example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/OrgGroupPolicyType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ OrgGroupPolicyUpdateRequest:
+ description: Request to update an org group policy.
properties:
data:
- $ref: "#/components/schemas/IncidentNotificationTemplateUpdateData"
+ $ref: "#/components/schemas/OrgGroupPolicyUpdateData"
required:
- data
type: object
- PatchMaintenanceRequest:
- description: Request object for updating a maintenance.
- example:
- data:
- attributes:
- completed_date: "2026-02-18T20:01:13.332360075Z"
- in_progress_description: We are currently performing maintenance on the API to improve performance for 40 minutes.
- scheduled_description: We will be performing maintenance on the API to improve performance for 40 minutes.
- start_date: "2026-02-18T19:21:13.332360075Z"
- title: API Maintenance
- id: 1234abcd-12ab-34cd-56ef-123456abcdef
- type: maintenances
+ OrgGroupRelationshipToOne:
+ description: Relationship to a single org group.
properties:
data:
- $ref: "#/components/schemas/PatchMaintenanceRequestData"
+ $ref: "#/components/schemas/OrgGroupRelationshipToOneData"
+ required:
+ - data
type: object
- PatchMaintenanceRequestData:
- description: The data object for updating a maintenance.
+ OrgGroupRelationshipToOneData:
+ description: A reference to an org group.
properties:
- attributes:
- $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributes"
id:
- description: The ID of the maintenance.
- example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ description: The ID of the org group.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
format: uuid
type: string
type:
- $ref: "#/components/schemas/PatchMaintenanceRequestDataType"
+ $ref: "#/components/schemas/OrgGroupType"
required:
- - attributes
- - type
- id
+ - type
type: object
- PatchMaintenanceRequestDataAttributes:
- description: The supported attributes for updating a maintenance.
+ OrgGroupRelationships:
+ description: Relationships of an org group.
properties:
- completed_date:
- description: Timestamp of when the maintenance was completed.
- format: date-time
- type: string
- completed_description:
- description: The description shown when the maintenance is completed.
- type: string
- components_affected:
- description: The components affected by the maintenance.
- items:
- $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItems"
- type: array
- in_progress_description:
- description: The description shown while the maintenance is in progress.
- type: string
- scheduled_description:
- description: The description shown when the maintenance is scheduled.
- type: string
- start_date:
- description: Timestamp of when the maintenance is scheduled to start.
- format: date-time
- type: string
- status:
- $ref: "#/components/schemas/MaintenanceDataAttributesStatus"
- description: The status of the maintenance.
- title:
- description: The title of the maintenance.
- type: string
+ memberships:
+ $ref: "#/components/schemas/OrgGroupMembershipsRelationship"
type: object
- PatchMaintenanceRequestDataAttributesComponentsAffectedItems:
- description: A component affected by a maintenance.
+ OrgGroupResponse:
+ description: Response containing a single org group.
properties:
- id:
- description: The ID of the component. Must be a component of type `component`.
- example: "1234abcd-12ab-34cd-56ef-123456abcdef"
- format: uuid
- type: string
- name:
- description: The name of the component.
- readOnly: true
- type: string
- status:
- $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus"
+ data:
+ $ref: "#/components/schemas/OrgGroupData"
required:
- - id
- - status
+ - data
type: object
- PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus:
- description: The status of the component.
+ OrgGroupSortOption:
+ default: uuid
+ description: Field to sort org groups by.
enum:
- - operational
- - maintenance
- example: operational
+ - name
+ - -name
+ - uuid
+ - -uuid
+ example: name
type: string
x-enum-varnames:
- - OPERATIONAL
- - MAINTENANCE
- PatchMaintenanceRequestDataType:
- default: maintenances
- description: Maintenances resource type.
+ - NAME
+ - MINUS_NAME
+ - UUID
+ - MINUS_UUID
+ OrgGroupType:
+ description: Org groups resource type.
enum:
- - maintenances
- example: maintenances
+ - org_groups
+ example: org_groups
type: string
x-enum-varnames:
- - MAINTENANCES
+ - ORG_GROUPS
+ OrgGroupUpdateAttributes:
+ description: Attributes for updating an org group.
+ properties:
+ name:
+ description: The name of the org group.
+ example: "Updated Org Group Name"
+ type: string
+ required:
+ - name
+ type: object
+ OrgGroupUpdateData:
+ description: Data for updating an org group.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OrgGroupUpdateAttributes"
+ id:
+ description: The ID of the org group.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/OrgGroupType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ OrgGroupUpdateRequest:
+ description: Request to update an org group.
+ properties:
+ data:
+ $ref: "#/components/schemas/OrgGroupUpdateData"
+ required:
+ - data
+ type: object
+ Organization:
+ description: Organization object.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OrganizationAttributes"
+ id:
+ description: ID of the organization.
+ type: string
+ type:
+ $ref: "#/components/schemas/OrganizationsType"
+ required:
+ - type
+ type: object
+ OrganizationAttributes:
+ description: Attributes of the organization.
+ properties:
+ created_at:
+ description: Creation time of the organization.
+ format: date-time
+ type: string
+ description:
+ description: Description of the organization.
+ type: string
+ disabled:
+ description: Whether or not the organization is disabled.
+ type: boolean
+ modified_at:
+ description: Time of last organization modification.
+ format: date-time
+ type: string
+ name:
+ description: Name of the organization.
+ type: string
+ public_id:
+ description: Public ID of the organization.
+ type: string
+ sharing:
+ description: Sharing type of the organization.
+ type: string
+ url:
+ description: URL of the site that this organization exists at.
+ type: string
+ type: object
+ OrganizationsType:
+ default: orgs
+ description: Organizations resource type.
+ enum:
+ - orgs
+ example: orgs
+ type: string
+ x-enum-varnames:
+ - ORGS
+ OutboundEdge:
+ description: The definition of `OutboundEdge` object.
+ properties:
+ branchName:
+ description: The `OutboundEdge` `branchName`.
+ example: ""
+ type: string
+ nextStepName:
+ description: The `OutboundEdge` `nextStepName`.
+ example: ""
+ type: string
+ required:
+ - nextStepName
+ - branchName
+ type: object
+ OutcomeType:
+ default: outcome
+ description: The JSON:API type for an outcome.
+ enum:
+ - outcome
+ example: outcome
+ type: string
+ x-enum-varnames:
+ - OUTCOME
+ OutcomesBatchAttributes:
+ description: The JSON:API attributes for a batched set of scorecard outcomes.
+ properties:
+ results:
+ description: Set of scorecard outcomes to update.
+ items:
+ $ref: "#/components/schemas/OutcomesBatchRequestItem"
+ type: array
+ type: object
+ OutcomesBatchRequest:
+ description: Scorecard outcomes batch request.
+ properties:
+ data:
+ $ref: "#/components/schemas/OutcomesBatchRequestData"
+ type: object
+ OutcomesBatchRequestData:
+ description: Scorecard outcomes batch request data.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OutcomesBatchAttributes"
+ type:
+ $ref: "#/components/schemas/OutcomesBatchType"
+ type: object
+ OutcomesBatchRequestItem:
+ description: Scorecard outcome for a specific rule, for a given service within a batched update.
+ properties:
+ remarks:
+ description: >-
+ Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks.
+ example: 'See: Services'
+ type: string
+ rule_id:
+ $ref: "#/components/schemas/RuleId"
+ service_name:
+ description: The unique name for a service in the catalog.
+ example: my-service
+ type: string
+ state:
+ $ref: "#/components/schemas/State"
+ required:
+ - rule_id
+ - service_name
+ - state
+ type: object
+ OutcomesBatchResponse:
+ description: Scorecard outcomes batch response.
+ properties:
+ data:
+ $ref: "#/components/schemas/OutcomesBatchResponseData"
+ example:
+ - attributes:
+ service_name: my-service
+ state: pass
+ id: "outcome-abc123"
+ type: rule-outcome
+ meta:
+ $ref: "#/components/schemas/OutcomesBatchResponseMeta"
+ required:
+ - data
+ - meta
+ type: object
+ OutcomesBatchResponseAttributes:
+ description: The JSON:API attributes for an outcome.
+ properties:
+ created_at:
+ description: Creation time of the rule outcome.
+ format: date-time
+ type: string
+ modified_at:
+ description: Time of last rule outcome modification.
+ format: date-time
+ type: string
+ remarks:
+ description: >-
+ Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks.
+ example: 'See: Services'
+ type: string
+ service_name:
+ description: The unique name for a service in the catalog.
+ example: my-service
+ type: string
+ state:
+ $ref: "#/components/schemas/State"
+ type: object
+ OutcomesBatchResponseData:
+ description: List of rule outcomes which were affected during the bulk operation.
+ items:
+ $ref: "#/components/schemas/OutcomesResponseDataItem"
+ type: array
+ OutcomesBatchResponseMeta:
+ description: Metadata pertaining to the bulk operation.
+ properties:
+ total_received:
+ description: Total number of scorecard results received during the bulk operation.
+ format: int64
+ type: integer
+ total_updated:
+ description: Total number of scorecard results modified during the bulk operation.
+ format: int64
+ type: integer
+ type: object
+ OutcomesBatchType:
+ default: batched-outcome
+ description: The JSON:API type for scorecard outcomes.
+ enum: [batched-outcome]
+ example: batched-outcome
+ type: string
+ x-enum-varnames: [BATCHED_OUTCOME]
+ OutcomesResponse:
+ description: Scorecard outcomes - the result of a rule for a service.
+ properties:
+ data:
+ $ref: "#/components/schemas/OutcomesResponseData"
+ included:
+ $ref: "#/components/schemas/OutcomesResponseIncluded"
+ links:
+ $ref: "#/components/schemas/OutcomesResponseLinks"
+ type: object
+ OutcomesResponseData:
+ description: List of rule outcomes.
+ items:
+ $ref: "#/components/schemas/OutcomesResponseDataItem"
+ type: array
+ OutcomesResponseDataItem:
+ description: A single rule outcome.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OutcomesBatchResponseAttributes"
+ id:
+ description: The unique ID for a rule outcome.
+ type: string
+ relationships:
+ $ref: "#/components/schemas/RuleOutcomeRelationships"
+ type:
+ $ref: "#/components/schemas/OutcomeType"
+ type: object
+ OutcomesResponseIncluded:
+ description: Array of rule details.
+ items:
+ $ref: "#/components/schemas/OutcomesResponseIncludedItem"
+ type: array
+ OutcomesResponseIncludedItem:
+ description: Attributes of the included rule.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OutcomesResponseIncludedRuleAttributes"
+ id:
+ $ref: "#/components/schemas/RuleId"
+ type:
+ $ref: "#/components/schemas/RuleType"
+ type: object
+ OutcomesResponseIncludedRuleAttributes:
+ description: Details of a rule.
+ properties:
+ name:
+ description: Name of the rule.
+ example: Team Defined
+ type: string
+ scorecard_name:
+ description: The scorecard name to which this rule must belong.
+ example: Observability Best Practices
+ type: string
+ type: object
+ OutcomesResponseLinks:
+ description: Links attributes.
+ properties:
+ next:
+ description: |-
+ Link for the next set of results.
+ example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=100"
+ type: string
+ type: object
+ OutputSchema:
+ description: "A list of output parameters for the workflow."
+ properties:
+ parameters:
+ description: The `OutputSchema` `parameters`.
+ items:
+ $ref: "#/components/schemas/OutputSchemaParameters"
+ type: array
+ type: object
+ OutputSchemaParameters:
+ description: The definition of `OutputSchemaParameters` object.
+ properties:
+ defaultValue:
+ description: The `OutputSchemaParameters` `defaultValue`.
+ description:
+ description: The `OutputSchemaParameters` `description`.
+ type: string
+ label:
+ description: The `OutputSchemaParameters` `label`.
+ type: string
+ name:
+ description: The `OutputSchemaParameters` `name`.
+ example: ""
+ type: string
+ type:
+ $ref: "#/components/schemas/OutputSchemaParametersType"
+ value:
+ description: The `OutputSchemaParameters` `value`.
+ required:
+ - name
+ - type
+ type: object
+ OutputSchemaParametersType:
+ description: The definition of `OutputSchemaParametersType` object.
+ enum:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
+ example: STRING
+ type: string
+ x-enum-varnames:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
+ OverwriteAllocationsRequest:
+ description: Request to overwrite targeting rules (allocations) for a feature flag in an environment.
+ properties:
+ data:
+ description: Targeting rules (allocations) to replace existing ones with.
+ items:
+ $ref: "#/components/schemas/AllocationDataRequest"
+ type: array
+ required:
+ - data
+ type: object
+ PageUrgency:
+ default: high
+ description: On-Call Page urgency level.
+ enum:
+ - low
+ - high
+ example: high
+ type: string
+ x-enum-varnames:
+ - LOW
+ - HIGH
+ PaginatedResponseMeta:
+ description: Metadata for scores response.
+ properties:
+ count:
+ description: Number of entities in this response.
+ example: 10
+ format: int64
+ type: integer
+ limit:
+ description: Pagination limit.
+ example: 10
+ format: int64
+ type: integer
+ offset:
+ description: Pagination offset.
+ example: 0
+ format: int64
+ type: integer
+ total:
+ description: Total number of entities available.
+ example: 150
+ format: int64
+ type: integer
+ required:
+ - count
+ - total
+ - limit
+ - offset
+ type: object
+ Pagination:
+ description: Pagination object.
+ properties:
+ total_count:
+ description: Total count.
+ format: int64
+ type: integer
+ total_filtered_count:
+ description: Total count of elements matched by the filter.
+ format: int64
+ type: integer
+ type: object
+ PaginationMeta:
+ description: Response metadata.
+ properties:
+ page:
+ $ref: "#/components/schemas/PaginationMetaPage"
+ readOnly: true
+ type: object
+ PaginationMetaPage:
+ description: Offset-based pagination schema.
+ example:
+ first_offset: 0
+ last_offset: 900
+ limit: 100
+ next_offset: 100
+ offset: 0
+ prev_offset: 100
+ total: 1000
+ type: offset_limit
+ properties:
+ first_offset:
+ description: Integer representing the offset to fetch the first page of results.
+ example: 0
+ format: int64
+ type: integer
+ last_offset:
+ description: Integer representing the offset to fetch the last page of results.
+ example: 900
+ format: int64
+ nullable: true
+ type: integer
+ limit:
+ description: Integer representing the number of elements to be returned in the results.
+ example: 100
+ format: int64
+ type: integer
+ next_offset:
+ description: >-
+ Integer representing the index of the first element in the next page of results. Equal to page size added to the current offset.
+ example: 100
+ format: int64
+ nullable: true
+ type: integer
+ offset:
+ description: Integer representing the index of the first element in the results.
+ example: 0
+ format: int64
+ type: integer
+ prev_offset:
+ description: Integer representing the index of the first element in the previous page of results.
+ example: 100
+ format: int64
+ nullable: true
+ type: integer
+ total:
+ description: Integer representing the total number of elements available.
+ example: 1000
+ format: int64
+ nullable: true
+ type: integer
+ type:
+ $ref: "#/components/schemas/PaginationMetaPageType"
+ type: object
+ PaginationMetaPageType:
+ default: offset_limit
+ description: The pagination type used for offset-based pagination.
+ enum:
+ - offset_limit
+ example: offset_limit
+ type: string
+ x-enum-varnames:
+ - OFFSET_LIMIT
+ Parameter:
+ description: The definition of `Parameter` object.
+ properties:
+ name:
+ description: The `Parameter` `name`.
+ example: ""
+ type: string
+ value:
+ description: The `Parameter` `value`.
+ required:
+ - name
+ - value
+ type: object
+ PartialAPIKey:
+ description: Partial Datadog API key.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PartialAPIKeyAttributes"
+ id:
+ description: ID of the API key.
+ type: string
+ relationships:
+ $ref: "#/components/schemas/APIKeyRelationships"
+ type:
+ $ref: "#/components/schemas/APIKeysType"
+ type: object
+ PartialAPIKeyAttributes:
+ description: Attributes of a partial API key.
+ properties:
+ category:
+ description: The category of the API key.
+ type: string
+ created_at:
+ description: Creation date of the API key.
+ example: "2020-11-23T10:00:00.000Z"
+ readOnly: true
+ type: string
+ date_last_used:
+ description: Date the API Key was last used.
+ example: "2020-11-27T10:00:00.000Z"
+ format: date-time
+ nullable: true
+ readOnly: true
+ type: string
+ last4:
+ description: The last four characters of the API key.
+ example: "abcd"
+ maxLength: 4
+ minLength: 4
+ readOnly: true
+ type: string
+ modified_at:
+ description: Date the API key was last modified.
+ example: "2020-11-23T10:00:00.000Z"
+ readOnly: true
+ type: string
+ name:
+ description: Name of the API key.
+ example: "API Key for submitting metrics"
+ type: string
+ remote_config_read_enabled:
+ description: The remote config read enabled status.
+ type: boolean
+ type: object
+ PartialApplicationKey:
+ description: Partial Datadog application key.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PartialApplicationKeyAttributes"
+ id:
+ description: ID of the application key.
+ type: string
+ relationships:
+ $ref: "#/components/schemas/ApplicationKeyRelationships"
+ type:
+ $ref: "#/components/schemas/ApplicationKeysType"
+ type: object
+ PartialApplicationKeyAttributes:
+ description: Attributes of a partial application key.
+ properties:
+ created_at:
+ description: Creation date of the application key.
+ example: "2020-11-23T10:00:00.000Z"
+ readOnly: true
+ type: string
+ last4:
+ description: The last four characters of the application key.
+ example: "abcd"
+ maxLength: 4
+ minLength: 4
+ readOnly: true
+ type: string
+ last_used_at:
+ description: Last usage timestamp of the application key.
+ example: "2020-12-20T10:00:00.000Z"
+ nullable: true
+ readOnly: true
+ type: string
+ name:
+ description: Name of the application key.
+ example: "Application Key for managing dashboards"
+ type: string
+ scopes:
+ description: Array of scopes to grant the application key.
+ example: ["dashboards_read", "dashboards_write", "dashboards_public_share"]
+ items:
+ description: Name of scope.
+ type: string
+ nullable: true
+ type: array
+ type: object
+ PartialApplicationKeyResponse:
+ description: Response for retrieving a partial application key.
+ properties:
+ data:
+ $ref: "#/components/schemas/PartialApplicationKey"
+ included:
+ description: Array of objects related to the application key.
+ items:
+ $ref: "#/components/schemas/ApplicationKeyResponseIncludedItem"
+ type: array
+ type: object
+ PatchAttachmentRequest:
+ description: Request to update an attachment.
+ properties:
+ data:
+ $ref: "#/components/schemas/PatchAttachmentRequestData"
+ type: object
+ PatchAttachmentRequestData:
+ description: Attachment data for an update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PatchAttachmentRequestDataAttributes"
+ id:
+ description: The unique identifier of the attachment.
+ example: "00000000-abcd-0002-0000-000000000000"
+ type: string
+ type:
+ $ref: "#/components/schemas/IncidentAttachmentType"
+ required:
+ - type
+ type: object
+ PatchAttachmentRequestDataAttributes:
+ description: The attributes for updating an attachment.
+ properties:
+ attachment:
+ $ref: "#/components/schemas/PatchAttachmentRequestDataAttributesAttachment"
+ type: object
+ PatchAttachmentRequestDataAttributesAttachment:
+ description: The updated attachment object.
+ properties:
+ documentUrl:
+ description: The updated URL for the attachment.
+ example: https://app.datadoghq.com/notebook/124/Postmortem-IR-124
+ type: string
+ title:
+ description: The updated title for the attachment.
+ example: Postmortem-IR-124
+ type: string
+ type: object
+ PatchComponentRequest:
+ description: Request object for updating a component.
+ example:
+ data:
+ attributes:
+ name: Metrics Intake Service
+ position: 4
+ id: 1234abcd-12ab-34cd-56ef-123456abcdef
+ type: components
+ properties:
+ data:
+ $ref: "#/components/schemas/PatchComponentRequestData"
+ type: object
+ PatchComponentRequestData:
+ description: The data object for updating a component.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PatchComponentRequestDataAttributes"
+ id:
+ description: The ID of the component.
+ example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/StatusPagesComponentGroupType"
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ PatchComponentRequestDataAttributes:
+ description: The supported attributes for updating a component.
+ properties:
+ name:
+ description: The name of the component.
+ example: Web App
+ type: string
+ position:
+ description: The position of the component. If the component belongs to a group, the position is relative to the other components in the group.
+ example: 1
+ format: int64
+ type: integer
+ type: object
+ PatchDegradationRequest:
+ description: Request object for updating a degradation.
+ example:
+ data:
+ attributes:
+ components_affected:
+ - id: 1234abcd-12ab-34cd-56ef-123456abcdef
+ status: operational
+ description: We've deployed a fix and latency has returned to normal. This issue has been resolved.
+ status: resolved
+ id: 1234abcd-12ab-34cd-56ef-123456abcdef
+ type: degradations
+ properties:
+ data:
+ $ref: "#/components/schemas/PatchDegradationRequestData"
+ type: object
+ PatchDegradationRequestData:
+ description: The data object for updating a degradation.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PatchDegradationRequestDataAttributes"
+ id:
+ description: The ID of the degradation.
+ example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/PatchDegradationRequestDataType"
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ PatchDegradationRequestDataAttributes:
+ description: The supported attributes for updating a degradation.
+ properties:
+ components_affected:
+ description: The components affected by the degradation.
+ example:
+ - id: 1234abcd-12ab-34cd-56ef-123456abcdef
+ status: operational
+ items:
+ $ref: "#/components/schemas/PatchDegradationRequestDataAttributesComponentsAffectedItems"
+ type: array
+ description:
+ description: The description of the degradation.
+ example: We've deployed a fix and latency has returned to normal. This issue has been resolved.
+ type: string
+ status:
+ $ref: "#/components/schemas/PatchDegradationRequestDataAttributesStatus"
+ example: resolved
+ title:
+ description: The title of the degradation.
+ example: Elevated API Latency
+ type: string
+ type: object
+ PatchDegradationRequestDataAttributesComponentsAffectedItems:
+ description: A component affected by a degradation.
+ properties:
+ id:
+ description: The ID of the component. Must be a component of type `component`.
+ example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ format: uuid
+ type: string
+ name:
+ description: The name of the component.
+ readOnly: true
+ type: string
+ status:
+ $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus"
+ required:
+ - id
+ - status
+ type: object
+ PatchDegradationRequestDataAttributesStatus:
+ description: The status of the degradation.
+ enum:
+ - investigating
+ - identified
+ - monitoring
+ - resolved
+ type: string
+ x-enum-varnames:
+ - INVESTIGATING
+ - IDENTIFIED
+ - MONITORING
+ - RESOLVED
+ PatchDegradationRequestDataType:
+ default: degradations
+ description: Degradations resource type.
+ enum:
+ - degradations
+ example: degradations
+ type: string
+ x-enum-varnames:
+ - DEGRADATIONS
+ PatchIncidentNotificationTemplateRequest:
+ description: Update request for a notification template.
+ properties:
+ data:
+ $ref: "#/components/schemas/IncidentNotificationTemplateUpdateData"
+ required:
+ - data
+ type: object
+ PatchMaintenanceRequest:
+ description: Request object for updating a maintenance.
+ example:
+ data:
+ attributes:
+ completed_date: "2026-02-18T20:01:13.332360075Z"
+ in_progress_description: We are currently performing maintenance on the API to improve performance for 40 minutes.
+ scheduled_description: We will be performing maintenance on the API to improve performance for 40 minutes.
+ start_date: "2026-02-18T19:21:13.332360075Z"
+ title: API Maintenance
+ id: 1234abcd-12ab-34cd-56ef-123456abcdef
+ type: maintenances
+ properties:
+ data:
+ $ref: "#/components/schemas/PatchMaintenanceRequestData"
+ type: object
+ PatchMaintenanceRequestData:
+ description: The data object for updating a maintenance.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributes"
+ id:
+ description: The ID of the maintenance.
+ example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/PatchMaintenanceRequestDataType"
+ required:
+ - attributes
+ - type
+ - id
+ type: object
+ PatchMaintenanceRequestDataAttributes:
+ description: The supported attributes for updating a maintenance.
+ properties:
+ completed_date:
+ description: Timestamp of when the maintenance was completed.
+ format: date-time
+ type: string
+ completed_description:
+ description: The description shown when the maintenance is completed.
+ type: string
+ components_affected:
+ description: The components affected by the maintenance.
+ items:
+ $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItems"
+ type: array
+ in_progress_description:
+ description: The description shown while the maintenance is in progress.
+ type: string
+ scheduled_description:
+ description: The description shown when the maintenance is scheduled.
+ type: string
+ start_date:
+ description: Timestamp of when the maintenance is scheduled to start.
+ format: date-time
+ type: string
+ status:
+ $ref: "#/components/schemas/MaintenanceDataAttributesStatus"
+ description: The status of the maintenance.
+ title:
+ description: The title of the maintenance.
+ type: string
+ type: object
+ PatchMaintenanceRequestDataAttributesComponentsAffectedItems:
+ description: A component affected by a maintenance.
+ properties:
+ id:
+ description: The ID of the component. Must be a component of type `component`.
+ example: "1234abcd-12ab-34cd-56ef-123456abcdef"
+ format: uuid
+ type: string
+ name:
+ description: The name of the component.
+ readOnly: true
+ type: string
+ status:
+ $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus"
+ required:
+ - id
+ - status
+ type: object
+ PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus:
+ description: The status of the component.
+ enum:
+ - operational
+ - maintenance
+ example: operational
+ type: string
+ x-enum-varnames:
+ - OPERATIONAL
+ - MAINTENANCE
+ PatchMaintenanceRequestDataType:
+ default: maintenances
+ description: Maintenances resource type.
+ enum:
+ - maintenances
+ example: maintenances
+ type: string
+ x-enum-varnames:
+ - MAINTENANCES
PatchNotificationRuleParameters:
description: Body of the notification rule patch request.
properties:
@@ -97477,410 +98543,989 @@ paths:
content:
application/json:
schema:
- $ref: "#/components/schemas/ListInterfaceTagsResponse"
+ $ref: "#/components/schemas/ListInterfaceTagsResponse"
+ description: OK
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: List tags for an interface
+ tags:
+ - Network Device Monitoring
+ patch:
+ description: Updates the tags associated with the specified interface.
+ operationId: UpdateInterfaceUserTags
+ parameters:
+ - description: The ID of the interface for which to update tags.
+ example: example:1.2.3.4:1
+ in: path
+ name: interface_id
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ListInterfaceTagsResponse"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ListInterfaceTagsResponse"
+ description: OK
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Update the tags for an interface
+ tags:
+ - Network Device Monitoring
+ /api/v2/network/connections/aggregate:
+ get:
+ description: Get all aggregated connections.
+ operationId: GetAggregatedConnections
+ parameters:
+ - description: Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
+ in: query
+ name: from
+ schema:
+ format: int64
+ type: integer
+ - description: Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
+ in: query
+ name: to
+ schema:
+ format: int64
+ type: integer
+ - description: Comma-separated list of fields to group connections by. The maximum number of group_by(s) is 10.
+ in: query
+ name: group_by
+ schema:
+ type: string
+ - description: Comma-separated list of tags to filter connections by.
+ in: query
+ name: tags
+ schema:
+ type: string
+ - description: The number of connections to be returned. The maximum value is 7500. The default is 100.
+ in: query
+ name: limit
+ schema:
+ default: 100
+ format: int32
+ maximum: 7500
+ minimum: 1
+ type: integer
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SingleAggregatedConnectionResponseArray"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Get all aggregated connections
+ tags:
+ - Cloud Network Monitoring
+ /api/v2/network/dns/aggregate:
+ get:
+ description: Get all aggregated DNS traffic.
+ operationId: GetAggregatedDns
+ parameters:
+ - description: Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
+ in: query
+ name: from
+ schema:
+ format: int64
+ type: integer
+ - description: Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
+ in: query
+ name: to
+ schema:
+ format: int64
+ type: integer
+ - description: Comma-separated list of fields to group DNS traffic by. The server side defaults to `network.dns_query` if unspecified. `server_ungrouped` may be used if groups are not desired. The maximum number of group_by(s) is 10.
+ in: query
+ name: group_by
+ schema:
+ type: string
+ - description: Comma-separated list of tags to filter DNS traffic by.
+ in: query
+ name: tags
+ schema:
+ type: string
+ - description: The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
+ in: query
+ name: limit
+ schema:
+ default: 100
+ format: int32
+ maximum: 7500
+ minimum: 1
+ type: integer
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SingleAggregatedDnsResponseArray"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Get all aggregated DNS traffic
+ tags:
+ - Cloud Network Monitoring
+ /api/v2/obs-pipelines/pipelines:
+ get:
+ description: Retrieve a list of pipelines.
+ operationId: ListPipelines
+ parameters:
+ - $ref: "#/components/parameters/PageSize"
+ - $ref: "#/components/parameters/PageNumber"
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ListPipelinesResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/NotAuthorizedResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: List pipelines
+ tags:
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_read
+ post:
+ description: Create a new pipeline.
+ operationId: CreatePipeline
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipelineSpec"
+ required: true
+ responses:
+ "201":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipeline"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/NotAuthorizedResponse"
+ "409":
+ $ref: "#/components/responses/ConflictResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Create a new pipeline
+ tags:
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_deploy
+ /api/v2/obs-pipelines/pipelines/validate:
+ post:
+ description: |-
+ Validates a pipeline configuration without creating or updating any resources.
+ Returns a list of validation errors, if any.
+ operationId: ValidatePipeline
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipelineSpec"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ValidationResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/NotAuthorizedResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Validate an observability pipeline
+ tags:
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_read
+ /api/v2/obs-pipelines/pipelines/{pipeline_id}:
+ delete:
+ description: Delete a pipeline.
+ operationId: DeletePipeline
+ parameters:
+ - description: The ID of the pipeline to delete.
+ in: path
+ name: pipeline_id
+ required: true
+ schema:
+ type: string
+ responses:
+ "204":
+ description: OK
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Not Found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Conflict
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Delete a pipeline
+ tags:
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_delete
+ get:
+ description: Get a specific pipeline by its ID.
+ operationId: GetPipeline
+ parameters:
+ - description: The ID of the pipeline to retrieve.
+ in: path
+ name: pipeline_id
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipeline"
+ description: OK
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Get a specific pipeline
+ tags:
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_read
+ put:
+ description: Update a pipeline.
+ operationId: UpdatePipeline
+ parameters:
+ - description: The ID of the pipeline to update.
+ in: path
+ name: pipeline_id
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipeline"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservabilityPipeline"
description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ $ref: "#/components/responses/NotAuthorizedResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
+ "409":
+ $ref: "#/components/responses/ConflictResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: List tags for an interface
+ summary: Update a pipeline
tags:
- - Network Device Monitoring
- patch:
- description: Updates the tags associated with the specified interface.
- operationId: UpdateInterfaceUserTags
+ - Observability Pipelines
+ "x-permission":
+ operator: OR
+ permissions:
+ - observability_pipelines_deploy
+ /api/v2/on-call/escalation-policies:
+ post:
+ description: Create a new On-Call escalation policy
+ operationId: CreateOnCallEscalationPolicy
parameters:
- - description: The ID of the interface for which to update tags.
- example: example:1.2.3.4:1
- in: path
- name: interface_id
- required: true
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
+ in: query
+ name: include
schema:
type: string
requestBody:
content:
application/json:
schema:
- $ref: "#/components/schemas/ListInterfaceTagsResponse"
+ $ref: "#/components/schemas/EscalationPolicyCreateRequest"
required: true
responses:
- "200":
+ "201":
content:
application/json:
schema:
- $ref: "#/components/schemas/ListInterfaceTagsResponse"
- description: OK
+ $ref: "#/components/schemas/EscalationPolicy"
+ description: Created
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Update the tags for an interface
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Create On-Call escalation policy
tags:
- - Network Device Monitoring
- /api/v2/network/connections/aggregate:
- get:
- description: Get all aggregated connections.
- operationId: GetAggregatedConnections
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_write
+ /api/v2/on-call/escalation-policies/{policy_id}:
+ delete:
+ description: Delete an On-Call escalation policy
+ operationId: DeleteOnCallEscalationPolicy
parameters:
- - description: Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
- in: query
- name: from
- schema:
- format: int64
- type: integer
- - description: Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
- in: query
- name: to
- schema:
- format: int64
- type: integer
- - description: Comma-separated list of fields to group connections by. The maximum number of group_by(s) is 10.
- in: query
- name: group_by
- schema:
- type: string
- - description: Comma-separated list of tags to filter connections by.
- in: query
- name: tags
+ - description: The ID of the escalation policy
+ in: path
+ name: policy_id
+ required: true
schema:
+ example: a3000000-0000-0000-0000-000000000000
type: string
- - description: The number of connections to be returned. The maximum value is 7500. The default is 100.
- in: query
- name: limit
- schema:
- default: 100
- format: int32
- maximum: 7500
- minimum: 1
- type: integer
responses:
- "200":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SingleAggregatedConnectionResponseArray"
- description: OK
- "400":
- $ref: "#/components/responses/BadRequestResponse"
+ "204":
+ description: No Content
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Get all aggregated connections
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Delete On-Call escalation policy
tags:
- - Cloud Network Monitoring
- /api/v2/network/dns/aggregate:
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_write
get:
- description: Get all aggregated DNS traffic.
- operationId: GetAggregatedDns
+ description: Get an On-Call escalation policy
+ operationId: GetOnCallEscalationPolicy
parameters:
- - description: Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
- in: query
- name: from
- schema:
- format: int64
- type: integer
- - description: Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`.
- in: query
- name: to
- schema:
- format: int64
- type: integer
- - description: Comma-separated list of fields to group DNS traffic by. The server side defaults to `network.dns_query` if unspecified. `server_ungrouped` may be used if groups are not desired. The maximum number of group_by(s) is 10.
- in: query
- name: group_by
+ - description: The ID of the escalation policy
+ in: path
+ name: policy_id
+ required: true
schema:
+ example: a3000000-0000-0000-0000-000000000000
type: string
- - description: Comma-separated list of tags to filter DNS traffic by.
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
in: query
- name: tags
+ name: include
schema:
type: string
- - description: The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
- in: query
- name: limit
- schema:
- default: 100
- format: int32
- maximum: 7500
- minimum: 1
- type: integer
responses:
"200":
content:
application/json:
schema:
- $ref: "#/components/schemas/SingleAggregatedDnsResponseArray"
+ $ref: "#/components/schemas/EscalationPolicy"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Get all aggregated DNS traffic
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get On-Call escalation policy
tags:
- - Cloud Network Monitoring
- /api/v2/obs-pipelines/pipelines:
- get:
- description: Retrieve a list of pipelines.
- operationId: ListPipelines
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_read
+ put:
+ description: Update an On-Call escalation policy
+ operationId: UpdateOnCallEscalationPolicy
parameters:
- - $ref: "#/components/parameters/PageSize"
- - $ref: "#/components/parameters/PageNumber"
+ - description: The ID of the escalation policy
+ in: path
+ name: policy_id
+ required: true
+ schema:
+ example: a3000000-0000-0000-0000-000000000000
+ type: string
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
+ in: query
+ name: include
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/EscalationPolicyUpdateRequest"
+ required: true
responses:
"200":
content:
application/json:
schema:
- $ref: "#/components/schemas/ListPipelinesResponse"
+ $ref: "#/components/schemas/EscalationPolicy"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
- $ref: "#/components/responses/NotAuthorizedResponse"
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: List pipelines
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update On-Call escalation policy
tags:
- - Observability Pipelines
+ - On-Call
"x-permission":
- operator: OR
+ operator: AND
permissions:
- - observability_pipelines_read
+ - on_call_write
+ /api/v2/on-call/pages:
post:
- description: Create a new pipeline.
- operationId: CreatePipeline
+ description: |-
+ Trigger a new On-Call Page.
+ operationId: CreateOnCallPage
requestBody:
content:
application/json:
schema:
- $ref: "#/components/schemas/ObservabilityPipelineSpec"
+ $ref: "#/components/schemas/CreatePageRequest"
required: true
responses:
- "201":
+ "200":
content:
application/json:
schema:
- $ref: "#/components/schemas/ObservabilityPipeline"
- description: OK
- "400":
- $ref: "#/components/responses/BadRequestResponse"
- "403":
- $ref: "#/components/responses/NotAuthorizedResponse"
- "409":
- $ref: "#/components/responses/ConflictResponse"
+ $ref: "#/components/schemas/CreatePageResponse"
+ description: OK.
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Create a new pipeline
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ servers:
+ - url: https://{site}
+ variables:
+ site:
+ default: navy.oncall.datadoghq.com
+ description: The globally available endpoint for On-Call.
+ enum:
+ - lava.oncall.datadoghq.com
+ - saffron.oncall.datadoghq.com
+ - navy.oncall.datadoghq.com
+ - coral.oncall.datadoghq.com
+ - teal.oncall.datadoghq.com
+ - beige.oncall.datadoghq.eu
+ - url: "{protocol}://{name}"
+ variables:
+ name:
+ default: api.datadoghq.com
+ description: Full site DNS name.
+ protocol:
+ default: https
+ description: The protocol for accessing the API.
+ - url: https://{subdomain}.{site}
+ variables:
+ site:
+ default: datadoghq.com
+ description: Any Datadog deployment.
+ subdomain:
+ default: api
+ description: The subdomain where the API is deployed.
+ summary: Create On-Call Page
tags:
- - Observability Pipelines
- "x-permission":
- operator: OR
- permissions:
- - observability_pipelines_deploy
- /api/v2/obs-pipelines/pipelines/validate:
+ - On-Call Paging
+ /api/v2/on-call/pages/{page_id}/acknowledge:
post:
description: |-
- Validates a pipeline configuration without creating or updating any resources.
- Returns a list of validation errors, if any.
- operationId: ValidatePipeline
+ Acknowledges an On-Call Page.
+ operationId: AcknowledgeOnCallPage
+ parameters:
+ - description: The page ID.
+ in: path
+ name: page_id
+ required: true
+ schema:
+ example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
+ format: uuid
+ type: string
+ responses:
+ "202":
+ description: Accepted.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ servers:
+ - url: https://{site}
+ variables:
+ site:
+ default: navy.oncall.datadoghq.com
+ description: The globally available endpoint for On-Call.
+ enum:
+ - lava.oncall.datadoghq.com
+ - saffron.oncall.datadoghq.com
+ - navy.oncall.datadoghq.com
+ - coral.oncall.datadoghq.com
+ - teal.oncall.datadoghq.com
+ - beige.oncall.datadoghq.eu
+ - url: "{protocol}://{name}"
+ variables:
+ name:
+ default: api.datadoghq.com
+ description: Full site DNS name.
+ protocol:
+ default: https
+ description: The protocol for accessing the API.
+ - url: https://{subdomain}.{site}
+ variables:
+ site:
+ default: datadoghq.com
+ description: Any Datadog deployment.
+ subdomain:
+ default: api
+ description: The subdomain where the API is deployed.
+ summary: Acknowledge On-Call Page
+ tags:
+ - On-Call Paging
+ /api/v2/on-call/pages/{page_id}/escalate:
+ post:
+ description: |-
+ Escalates an On-Call Page.
+ operationId: EscalateOnCallPage
+ parameters:
+ - description: The page ID.
+ in: path
+ name: page_id
+ required: true
+ schema:
+ example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
+ format: uuid
+ type: string
+ responses:
+ "202":
+ description: Accepted.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ servers:
+ - url: https://{site}
+ variables:
+ site:
+ default: navy.oncall.datadoghq.com
+ description: The globally available endpoint for On-Call.
+ enum:
+ - lava.oncall.datadoghq.com
+ - saffron.oncall.datadoghq.com
+ - navy.oncall.datadoghq.com
+ - coral.oncall.datadoghq.com
+ - teal.oncall.datadoghq.com
+ - beige.oncall.datadoghq.eu
+ - url: "{protocol}://{name}"
+ variables:
+ name:
+ default: api.datadoghq.com
+ description: Full site DNS name.
+ protocol:
+ default: https
+ description: The protocol for accessing the API.
+ - url: https://{subdomain}.{site}
+ variables:
+ site:
+ default: datadoghq.com
+ description: Any Datadog deployment.
+ subdomain:
+ default: api
+ description: The subdomain where the API is deployed.
+ summary: Escalate On-Call Page
+ tags:
+ - On-Call Paging
+ /api/v2/on-call/pages/{page_id}/resolve:
+ post:
+ description: |-
+ Resolves an On-Call Page.
+ operationId: ResolveOnCallPage
+ parameters:
+ - description: The page ID.
+ in: path
+ name: page_id
+ required: true
+ schema:
+ example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
+ format: uuid
+ type: string
+ responses:
+ "202":
+ description: Accepted.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ servers:
+ - url: https://{site}
+ variables:
+ site:
+ default: navy.oncall.datadoghq.com
+ description: The globally available endpoint for On-Call.
+ enum:
+ - lava.oncall.datadoghq.com
+ - saffron.oncall.datadoghq.com
+ - navy.oncall.datadoghq.com
+ - coral.oncall.datadoghq.com
+ - teal.oncall.datadoghq.com
+ - beige.oncall.datadoghq.eu
+ - url: "{protocol}://{name}"
+ variables:
+ name:
+ default: api.datadoghq.com
+ description: Full site DNS name.
+ protocol:
+ default: https
+ description: The protocol for accessing the API.
+ - url: https://{subdomain}.{site}
+ variables:
+ site:
+ default: datadoghq.com
+ description: Any Datadog deployment.
+ subdomain:
+ default: api
+ description: The subdomain where the API is deployed.
+ summary: Resolve On-Call Page
+ tags:
+ - On-Call Paging
+ /api/v2/on-call/schedules:
+ post:
+ description: Create a new On-Call schedule
+ operationId: CreateOnCallSchedule
+ parameters:
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
+ in: query
+ name: include
+ schema:
+ type: string
requestBody:
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/ObservabilityPipelineSpec"
+ $ref: "#/components/schemas/ScheduleCreateRequest"
required: true
responses:
- "200":
+ "201":
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/ValidationResponse"
- description: OK
+ $ref: "#/components/schemas/Schedule"
+ description: Created
"400":
$ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
- $ref: "#/components/responses/NotAuthorizedResponse"
+ $ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Validate an observability pipeline
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Create On-Call schedule
tags:
- - Observability Pipelines
+ - On-Call
"x-permission":
- operator: OR
+ operator: AND
permissions:
- - observability_pipelines_read
- /api/v2/obs-pipelines/pipelines/{pipeline_id}:
+ - on_call_write
+ /api/v2/on-call/schedules/{schedule_id}:
delete:
- description: Delete a pipeline.
- operationId: DeletePipeline
+ description: Delete an On-Call schedule
+ operationId: DeleteOnCallSchedule
parameters:
- - description: The ID of the pipeline to delete.
+ - description: The ID of the schedule
in: path
- name: pipeline_id
+ name: schedule_id
required: true
schema:
+ example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
responses:
"204":
- description: OK
+ description: No Content
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/APIErrorResponse"
- description: Forbidden
+ $ref: "#/components/responses/ForbiddenResponse"
"404":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/APIErrorResponse"
- description: Not Found
- "409":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/APIErrorResponse"
- description: Conflict
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Delete a pipeline
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Delete On-Call schedule
tags:
- - Observability Pipelines
+ - On-Call
"x-permission":
- operator: OR
+ operator: AND
permissions:
- - observability_pipelines_delete
+ - on_call_write
get:
- description: Get a specific pipeline by its ID.
- operationId: GetPipeline
+ description: Get an On-Call schedule
+ operationId: GetOnCallSchedule
parameters:
- - description: The ID of the pipeline to retrieve.
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
+ in: query
+ name: include
+ schema:
+ type: string
+ - description: The ID of the schedule
in: path
- name: pipeline_id
+ name: schedule_id
required: true
schema:
+ example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
responses:
"200":
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/ObservabilityPipeline"
+ $ref: "#/components/schemas/Schedule"
description: OK
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/APIErrorResponse"
- description: Forbidden
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Get a specific pipeline
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get On-Call schedule
tags:
- - Observability Pipelines
+ - On-Call
"x-permission":
- operator: OR
+ operator: AND
permissions:
- - observability_pipelines_read
+ - on_call_read
put:
- description: Update a pipeline.
- operationId: UpdatePipeline
+ description: Update a new On-Call schedule
+ operationId: UpdateOnCallSchedule
parameters:
- - description: The ID of the pipeline to update.
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
+ in: query
+ name: include
+ schema:
+ type: string
+ - description: The ID of the schedule
in: path
- name: pipeline_id
+ name: schedule_id
required: true
schema:
+ example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
requestBody:
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/ObservabilityPipeline"
+ $ref: "#/components/schemas/ScheduleUpdateRequest"
required: true
responses:
"200":
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/ObservabilityPipeline"
+ $ref: "#/components/schemas/Schedule"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
"403":
- $ref: "#/components/responses/NotAuthorizedResponse"
+ $ref: "#/components/responses/ForbiddenResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
- "409":
- $ref: "#/components/responses/ConflictResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Update a pipeline
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update On-Call schedule
tags:
- - Observability Pipelines
+ - On-Call
"x-permission":
- operator: OR
+ operator: AND
permissions:
- - observability_pipelines_deploy
- /api/v2/on-call/escalation-policies:
- post:
- description: Create a new On-Call escalation policy
- operationId: CreateOnCallEscalationPolicy
+ - on_call_write
+ /api/v2/on-call/schedules/{schedule_id}/on-call:
+ get:
+ description: "Retrieves the user who is on-call for the specified schedule at a given time."
+ operationId: GetScheduleOnCallUser
parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
+ - description: "Specifies related resources to include in the response as a comma-separated list. Allowed value: `user`."
in: query
name: include
schema:
type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/EscalationPolicyCreateRequest"
- required: true
+ - description: The ID of the schedule.
+ in: path
+ name: schedule_id
+ required: true
+ schema:
+ example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
+ type: string
+ - description: Retrieves the on-call user at the given timestamp in RFC3339 format (for example, `2025-05-07T02:53:01Z` or `2025-05-07T02:53:01+00:00`). When using timezone offsets with `+` or `-`, ensure proper URL encoding (`+` should be encoded as `%2B`). Defaults to the current time if omitted.
+ in: query
+ name: filter[at_ts]
+ schema:
+ example: "2025-05-07T02:53:01Z"
+ type: string
responses:
- "201":
+ "200":
content:
application/json:
schema:
- $ref: "#/components/schemas/EscalationPolicy"
- description: Created
+ $ref: "#/components/schemas/Shift"
+ description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Create On-Call escalation policy
+ summary: Get scheduled on-call user
tags:
- On-Call
"x-permission":
operator: AND
permissions:
- - on_call_write
- /api/v2/on-call/escalation-policies/{policy_id}:
- delete:
- description: Delete an On-Call escalation policy
- operationId: DeleteOnCallEscalationPolicy
+ - on_call_read
+ /api/v2/on-call/teams/{team_id}/on-call:
+ get:
+ description: Get a team's on-call users at a given time
+ operationId: GetTeamOnCallUsers
parameters:
- - description: The ID of the escalation policy
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `responders`, `escalations`, `escalations.responders`."
+ in: query
+ name: include
+ schema:
+ type: string
+ - description: The team ID
in: path
- name: policy_id
+ name: team_id
required: true
schema:
- example: a3000000-0000-0000-0000-000000000000
+ example: 27590dae-47be-4a7d-9abf-8f4e45124020
type: string
responses:
- "204":
- description: No Content
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/TeamOnCallResponders"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
@@ -97893,25 +99538,26 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Delete On-Call escalation policy
+ summary: Get team on-call users
tags:
- On-Call
"x-permission":
operator: AND
permissions:
- - on_call_write
+ - on_call_read
+ /api/v2/on-call/teams/{team_id}/routing-rules:
get:
- description: Get an On-Call escalation policy
- operationId: GetOnCallEscalationPolicy
+ description: Get a team's On-Call routing rules
+ operationId: GetOnCallTeamRoutingRules
parameters:
- - description: The ID of the escalation policy
+ - description: The team ID
in: path
- name: policy_id
+ name: team_id
required: true
schema:
- example: a3000000-0000-0000-0000-000000000000
+ example: 27590dae-47be-4a7d-9abf-8f4e45124020
type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`."
in: query
name: include
schema:
@@ -97921,23 +99567,15 @@ paths:
content:
application/json:
schema:
- $ref: "#/components/schemas/EscalationPolicy"
+ $ref: "#/components/schemas/TeamRoutingRules"
description: OK
- "400":
- $ref: "#/components/responses/BadRequestResponse"
- "401":
- $ref: "#/components/responses/UnauthorizedResponse"
- "403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Get On-Call escalation policy
+ summary: Get On-Call team routing rules
tags:
- On-Call
"x-permission":
@@ -97945,17 +99583,17 @@ paths:
permissions:
- on_call_read
put:
- description: Update an On-Call escalation policy
- operationId: UpdateOnCallEscalationPolicy
+ description: Set a team's On-Call routing rules
+ operationId: SetOnCallTeamRoutingRules
parameters:
- - description: The ID of the escalation policy
+ - description: The team ID
in: path
- name: policy_id
+ name: team_id
required: true
schema:
- example: a3000000-0000-0000-0000-000000000000
+ example: 27590dae-47be-4a7d-9abf-8f4e45124020
type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`."
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`."
in: query
name: include
schema:
@@ -97964,14 +99602,46 @@ paths:
content:
application/json:
schema:
- $ref: "#/components/schemas/EscalationPolicyUpdateRequest"
+ $ref: "#/components/schemas/TeamRoutingRulesRequest"
required: true
responses:
"200":
content:
application/json:
schema:
- $ref: "#/components/schemas/EscalationPolicy"
+ $ref: "#/components/schemas/TeamRoutingRules"
+ description: OK
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Set On-Call team routing rules
+ tags:
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_write
+ /api/v2/on-call/users/{user_id}/notification-channels:
+ get:
+ description: List the notification channels for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: ListUserNotificationChannels
+ parameters:
+ - description: The user ID
+ in: path
+ name: user_id
+ required: true
+ schema:
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ responses:
+ "200":
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/ListNotificationChannelsResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
@@ -97987,256 +99657,215 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Update On-Call escalation policy
+ summary: List On-Call notification channels for a user
tags:
- On-Call
"x-permission":
operator: AND
permissions:
- - on_call_write
- /api/v2/on-call/pages:
+ - on_call_read
post:
- description: |-
- Trigger a new On-Call Page.
- operationId: CreateOnCallPage
+ description: Create a new notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: CreateUserNotificationChannel
+ parameters:
+ - description: The user ID
+ in: path
+ name: user_id
+ required: true
+ schema:
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
requestBody:
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/CreatePageRequest"
+ $ref: "#/components/schemas/CreateUserNotificationChannelRequest"
required: true
responses:
- "200":
+ "201":
content:
- application/json:
+ "application/json":
schema:
- $ref: "#/components/schemas/CreatePageResponse"
- description: OK.
+ $ref: "#/components/schemas/NotificationChannel"
+ description: Created
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- servers:
- - url: https://{site}
- variables:
- site:
- default: navy.oncall.datadoghq.com
- description: The globally available endpoint for On-Call.
- enum:
- - lava.oncall.datadoghq.com
- - saffron.oncall.datadoghq.com
- - navy.oncall.datadoghq.com
- - coral.oncall.datadoghq.com
- - teal.oncall.datadoghq.com
- - beige.oncall.datadoghq.eu
- - url: "{protocol}://{name}"
- variables:
- name:
- default: api.datadoghq.com
- description: Full site DNS name.
- protocol:
- default: https
- description: The protocol for accessing the API.
- - url: https://{subdomain}.{site}
- variables:
- site:
- default: datadoghq.com
- description: Any Datadog deployment.
- subdomain:
- default: api
- description: The subdomain where the API is deployed.
- summary: Create On-Call Page
+ summary: Create an On-Call notification channel for a user
tags:
- - On-Call Paging
- /api/v2/on-call/pages/{page_id}/acknowledge:
- post:
- description: |-
- Acknowledges an On-Call Page.
- operationId: AcknowledgeOnCallPage
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_respond
+ /api/v2/on-call/users/{user_id}/notification-channels/{channel_id}:
+ delete:
+ description: Delete a notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: DeleteUserNotificationChannel
parameters:
- - description: The page ID.
+ - description: The user ID
in: path
- name: page_id
+ name: user_id
required: true
schema:
- example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
- format: uuid
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ - description: The channel ID
+ in: path
+ name: channel_id
+ required: true
+ schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
responses:
- "202":
- description: Accepted.
+ "204":
+ description: No Content
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- servers:
- - url: https://{site}
- variables:
- site:
- default: navy.oncall.datadoghq.com
- description: The globally available endpoint for On-Call.
- enum:
- - lava.oncall.datadoghq.com
- - saffron.oncall.datadoghq.com
- - navy.oncall.datadoghq.com
- - coral.oncall.datadoghq.com
- - teal.oncall.datadoghq.com
- - beige.oncall.datadoghq.eu
- - url: "{protocol}://{name}"
- variables:
- name:
- default: api.datadoghq.com
- description: Full site DNS name.
- protocol:
- default: https
- description: The protocol for accessing the API.
- - url: https://{subdomain}.{site}
- variables:
- site:
- default: datadoghq.com
- description: Any Datadog deployment.
- subdomain:
- default: api
- description: The subdomain where the API is deployed.
- summary: Acknowledge On-Call Page
+ summary: Delete an On-Call notification channel for a user
tags:
- - On-Call Paging
- /api/v2/on-call/pages/{page_id}/escalate:
- post:
- description: |-
- Escalates an On-Call Page.
- operationId: EscalateOnCallPage
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_respond
+ get:
+ description: Get a notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: GetUserNotificationChannel
parameters:
- - description: The page ID.
+ - description: The user ID
in: path
- name: page_id
+ name: user_id
required: true
schema:
- example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
- format: uuid
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ - description: The channel ID
+ in: path
+ name: channel_id
+ required: true
+ schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
responses:
- "202":
- description: Accepted.
+ "200":
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/NotificationChannel"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- servers:
- - url: https://{site}
- variables:
- site:
- default: navy.oncall.datadoghq.com
- description: The globally available endpoint for On-Call.
- enum:
- - lava.oncall.datadoghq.com
- - saffron.oncall.datadoghq.com
- - navy.oncall.datadoghq.com
- - coral.oncall.datadoghq.com
- - teal.oncall.datadoghq.com
- - beige.oncall.datadoghq.eu
- - url: "{protocol}://{name}"
- variables:
- name:
- default: api.datadoghq.com
- description: Full site DNS name.
- protocol:
- default: https
- description: The protocol for accessing the API.
- - url: https://{subdomain}.{site}
- variables:
- site:
- default: datadoghq.com
- description: Any Datadog deployment.
- subdomain:
- default: api
- description: The subdomain where the API is deployed.
- summary: Escalate On-Call Page
+ summary: Get an On-Call notification channel for a user
tags:
- - On-Call Paging
- /api/v2/on-call/pages/{page_id}/resolve:
- post:
- description: |-
- Resolves an On-Call Page.
- operationId: ResolveOnCallPage
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_read
+ /api/v2/on-call/users/{user_id}/notification-rules:
+ get:
+ description: List the notification rules for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: ListUserNotificationRules
parameters:
- - description: The page ID.
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
+ in: query
+ name: include
+ schema:
+ type: string
+ - description: The user ID
in: path
- name: page_id
+ name: user_id
required: true
schema:
- example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
- format: uuid
+ example: 00000000-0000-0000-0000-000000000000
type: string
responses:
- "202":
- description: Accepted.
+ "200":
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/ListOnCallNotificationRulesResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- servers:
- - url: https://{site}
- variables:
- site:
- default: navy.oncall.datadoghq.com
- description: The globally available endpoint for On-Call.
- enum:
- - lava.oncall.datadoghq.com
- - saffron.oncall.datadoghq.com
- - navy.oncall.datadoghq.com
- - coral.oncall.datadoghq.com
- - teal.oncall.datadoghq.com
- - beige.oncall.datadoghq.eu
- - url: "{protocol}://{name}"
- variables:
- name:
- default: api.datadoghq.com
- description: Full site DNS name.
- protocol:
- default: https
- description: The protocol for accessing the API.
- - url: https://{subdomain}.{site}
- variables:
- site:
- default: datadoghq.com
- description: Any Datadog deployment.
- subdomain:
- default: api
- description: The subdomain where the API is deployed.
- summary: Resolve On-Call Page
+ summary: List On-Call notification rules for a user
tags:
- - On-Call Paging
- /api/v2/on-call/schedules:
+ - On-Call
+ "x-permission":
+ operator: AND
+ permissions:
+ - on_call_read
post:
- description: Create a new On-Call schedule
- operationId: CreateOnCallSchedule
+ description: Create a new notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: CreateUserNotificationRule
parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
- in: query
- name: include
+ - description: The user ID
+ in: path
+ name: user_id
+ required: true
schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
requestBody:
content:
"application/json":
schema:
- $ref: "#/components/schemas/ScheduleCreateRequest"
+ $ref: "#/components/schemas/CreateOnCallNotificationRuleRequest"
required: true
responses:
"201":
content:
"application/json":
schema:
- $ref: "#/components/schemas/Schedule"
+ $ref: "#/components/schemas/OnCallNotificationRule"
description: Created
"400":
$ref: "#/components/responses/BadRequestResponse"
@@ -98244,34 +99873,45 @@ paths:
$ref: "#/components/responses/UnauthorizedResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Create On-Call schedule
+ summary: Create an On-Call notification rule for a user
tags:
- On-Call
"x-permission":
operator: AND
permissions:
- - on_call_write
- /api/v2/on-call/schedules/{schedule_id}:
+ - on_call_respond
+ /api/v2/on-call/users/{user_id}/notification-rules/{rule_id}:
delete:
- description: Delete an On-Call schedule
- operationId: DeleteOnCallSchedule
+ description: Delete a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: DeleteUserNotificationRule
parameters:
- - description: The ID of the schedule
+ - description: The user ID
in: path
- name: schedule_id
+ name: user_id
required: true
schema:
- example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ - description: The rule ID
+ in: path
+ name: rule_id
+ required: true
+ schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
responses:
"204":
description: No Content
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
@@ -98284,36 +99924,45 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Delete On-Call schedule
+ summary: Delete an On-Call notification rule for a user
tags:
- On-Call
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_write
+ - on_call_respond
get:
- description: Get an On-Call schedule
- operationId: GetOnCallSchedule
+ description: Get a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: GetUserNotificationRule
parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
- in: query
- name: include
+ - description: The user ID
+ in: path
+ name: user_id
+ required: true
schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
- - description: The ID of the schedule
+ - description: The rule ID
in: path
- name: schedule_id
+ name: rule_id
required: true
schema:
- example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
+ in: query
+ name: include
+ schema:
type: string
responses:
"200":
content:
"application/json":
schema:
- $ref: "#/components/schemas/Schedule"
+ $ref: "#/components/schemas/OnCallNotificationRule"
description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
@@ -98326,41 +99975,48 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Get On-Call schedule
+ summary: Get an On-Call notification rule for a user
tags:
- On-Call
"x-permission":
- operator: AND
+ operator: OR
permissions:
- on_call_read
put:
- description: Update a new On-Call schedule
- operationId: UpdateOnCallSchedule
+ description: Update a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
+ operationId: UpdateUserNotificationRule
parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`."
- in: query
- name: include
+ - description: The user ID
+ in: path
+ name: user_id
+ required: true
schema:
+ example: 00000000-0000-0000-0000-000000000000
type: string
- - description: The ID of the schedule
+ - description: The rule ID
in: path
- name: schedule_id
+ name: rule_id
required: true
schema:
- example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
+ in: query
+ name: include
+ schema:
type: string
requestBody:
content:
"application/json":
schema:
- $ref: "#/components/schemas/ScheduleUpdateRequest"
+ $ref: "#/components/schemas/UpdateOnCallNotificationRuleRequest"
required: true
responses:
"200":
content:
"application/json":
schema:
- $ref: "#/components/schemas/Schedule"
+ $ref: "#/components/schemas/OnCallNotificationRule"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
@@ -98376,42 +100032,153 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
- summary: Update On-Call schedule
+ summary: Update an On-Call notification rule for a user
tags:
- On-Call
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_write
- /api/v2/on-call/schedules/{schedule_id}/on-call:
+ - on_call_read
+ /api/v2/org_configs:
get:
- description: "Retrieves the user who is on-call for the specified schedule at a given time."
- operationId: GetScheduleOnCallUser
+ description: Returns all Org Configs (name, description, and value).
+ operationId: ListOrgConfigs
+ responses:
+ "200":
+ content:
+ application/json:
+ schema: {$ref: "#/components/schemas/OrgConfigListResponse"}
+ description: OK
+ "400": {$ref: "#/components/responses/BadRequestResponse"}
+ "401": {$ref: "#/components/responses/UnauthorizedResponse"}
+ "403": {$ref: "#/components/responses/ForbiddenResponse"}
+ "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
+ summary: List Org Configs
+ tags: [Organizations]
+ "x-permission":
+ operator: OPEN
+ permissions: []
+ /api/v2/org_configs/{org_config_name}:
+ get:
+ description: Return the name, description, and value of a specific Org Config.
+ operationId: GetOrgConfig
+ parameters: [$ref: "#/components/parameters/OrgConfigName"]
+ responses:
+ "200":
+ content:
+ application/json:
+ schema: {$ref: "#/components/schemas/OrgConfigGetResponse"}
+ description: OK
+ "400": {$ref: "#/components/responses/BadRequestResponse"}
+ "401": {$ref: "#/components/responses/UnauthorizedResponse"}
+ "403": {$ref: "#/components/responses/ForbiddenResponse"}
+ "404": {$ref: "#/components/responses/NotFoundResponse"}
+ "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
+ summary: Get a specific Org Config value
+ tags: [Organizations]
+ "x-permission":
+ operator: OPEN
+ permissions: []
+ patch:
+ description: Update the value of a specific Org Config.
+ operationId: UpdateOrgConfig
+ parameters: [$ref: "#/components/parameters/OrgConfigName"]
+ requestBody:
+ content:
+ application/json:
+ schema: {$ref: "#/components/schemas/OrgConfigWriteRequest"}
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema: {$ref: "#/components/schemas/OrgConfigGetResponse"}
+ description: OK
+ "400": {$ref: "#/components/responses/BadRequestResponse"}
+ "401": {$ref: "#/components/responses/UnauthorizedResponse"}
+ "403": {$ref: "#/components/responses/ForbiddenResponse"}
+ "404": {$ref: "#/components/responses/NotFoundResponse"}
+ "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
+ summary: Update a specific Org Config
+ tags: [Organizations]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_management
+ /api/v2/org_connections:
+ get:
+ description: Returns a list of org connections.
+ operationId: ListOrgConnections
parameters:
- - description: "Specifies related resources to include in the response as a comma-separated list. Allowed value: `user`."
+ - description: The Org ID of the sink org.
+ example: "0879ce27-29a1-481f-a12e-bc2a48ec9ae1"
in: query
- name: include
+ name: sink_org_id
+ required: false
schema:
type: string
- - description: The ID of the schedule.
- in: path
- name: schedule_id
- required: true
+ - description: The Org ID of the source org.
+ example: "0879ce27-29a1-481f-a12e-bc2a48ec9ae1"
+ in: query
+ name: source_org_id
+ required: false
schema:
- example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
- - description: Retrieves the on-call user at the given timestamp in RFC3339 format (for example, `2025-05-07T02:53:01Z` or `2025-05-07T02:53:01+00:00`). When using timezone offsets with `+` or `-`, ensure proper URL encoding (`+` should be encoded as `%2B`). Defaults to the current time if omitted.
+ - description: The limit of number of entries you want to return. Default is 1000.
+ example: 1000
in: query
- name: filter[at_ts]
+ name: limit
+ required: false
schema:
- example: "2025-05-07T02:53:01Z"
- type: string
+ format: int64
+ type: integer
+ - description: The pagination offset which you want to query from. Default is 0.
+ example: 0
+ in: query
+ name: offset
+ required: false
+ schema:
+ format: int64
+ type: integer
responses:
"200":
content:
application/json:
schema:
- $ref: "#/components/schemas/Shift"
+ $ref: "#/components/schemas/OrgConnectionListResponse"
+ description: OK
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - org_connections_read
+ summary: List Org Connections
+ tags: ["Org Connections"]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_connections_read
+ post:
+ description: Create a new org connection between the current org and a target org.
+ operationId: CreateOrgConnections
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OrgConnectionCreateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OrgConnectionResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
@@ -98421,42 +100188,69 @@ paths:
$ref: "#/components/responses/ForbiddenResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
+ "409":
+ $ref: "#/components/responses/ConflictResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- - AuthZ: []
- summary: Get scheduled on-call user
- tags:
- - On-Call
+ - AuthZ:
+ - org_connections_write
+ summary: Create Org Connection
+ tags: ["Org Connections"]
+ x-codegen-request-body-name: body
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_read
- /api/v2/on-call/teams/{team_id}/on-call:
- get:
- description: Get a team's on-call users at a given time
- operationId: GetTeamOnCallUsers
+ - org_connections_write
+ /api/v2/org_connections/{connection_id}:
+ delete:
+ description: Delete an existing org connection.
+ operationId: DeleteOrgConnections
parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `responders`, `escalations`, `escalations.responders`."
- in: query
- name: include
- schema:
- type: string
- - description: The team ID
- in: path
- name: team_id
- required: true
- schema:
- example: 27590dae-47be-4a7d-9abf-8f4e45124020
- type: string
+ - $ref: "#/components/parameters/OrgConnectionId"
+ responses:
+ "200":
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "401":
+ $ref: "#/components/responses/UnauthorizedResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - org_connections_write
+ summary: Delete Org Connection
+ tags: ["Org Connections"]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_connections_write
+ patch:
+ description: Update an existing org connection.
+ operationId: UpdateOrgConnections
+ parameters:
+ - $ref: "#/components/parameters/OrgConnectionId"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OrgConnectionUpdateRequest"
+ required: true
responses:
"200":
content:
application/json:
schema:
- $ref: "#/components/schemas/TeamOnCallResponders"
+ $ref: "#/components/schemas/OrgConnectionResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
@@ -98471,742 +100265,1222 @@ paths:
security:
- apiKeyAuth: []
appKeyAuth: []
- - AuthZ: []
- summary: Get team on-call users
- tags:
- - On-Call
+ - AuthZ:
+ - org_connections_write
+ summary: Update Org Connection
+ tags: ["Org Connections"]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_read
- /api/v2/on-call/teams/{team_id}/routing-rules:
+ - org_connections_write
+ /api/v2/org_group_memberships:
get:
- description: Get a team's On-Call routing rules
- operationId: GetOnCallTeamRoutingRules
+ description: >-
+ List organization group memberships. Filter by org group ID or org UUID. At least one of `filter[org_group_id]` or `filter[org_uuid]` must be provided. When filtering by org UUID, returns a single-item list with the membership for that org.
+ operationId: ListOrgGroupMemberships
parameters:
- - description: The team ID
- in: path
- name: team_id
- required: true
- schema:
- example: 27590dae-47be-4a7d-9abf-8f4e45124020
- type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`."
- in: query
- name: include
- schema:
- type: string
+ - $ref: "#/components/parameters/OrgGroupMembershipFilterOrgGroupId"
+ - $ref: "#/components/parameters/OrgGroupMembershipFilterOrgUuid"
+ - $ref: "#/components/parameters/OrgGroupPageNumber"
+ - $ref: "#/components/parameters/OrgGroupPageSize"
+ - $ref: "#/components/parameters/MembershipSort"
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ org_name: "Acme Corp"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_memberships
+ meta:
+ page:
+ total_count: 1
+ schema:
+ $ref: "#/components/schemas/OrgGroupMembershipListResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: List org group memberships
+ tags: [Org Groups]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_group_read
+ 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/org_group_memberships/bulk:
+ patch:
+ description: >-
+ Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request.
+ operationId: BulkUpdateOrgGroupMemberships
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ orgs:
+ - org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ relationships:
+ source_org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ target_org_group:
+ data:
+ id: "d4e5f6a7-b890-1234-cdef-567890abcdef"
+ type: org_groups
+ type: org_group_membership_bulk_updates
+ schema:
+ $ref: "#/components/schemas/OrgGroupMembershipBulkUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-16T14:00:00Z"
+ org_name: "Acme Corp"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ relationships:
+ org_group:
+ data:
+ id: "d4e5f6a7-b890-1234-cdef-567890abcdef"
+ type: org_groups
+ type: org_group_memberships
+ schema:
+ $ref: "#/components/schemas/OrgGroupMembershipListResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Bulk update org group memberships
+ tags: [Org Groups]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_group_write
+ 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/org_group_memberships/{org_group_membership_id}:
+ get:
+ description: Get a specific organization group membership by its ID.
+ operationId: GetOrgGroupMembership
+ parameters:
+ - $ref: "#/components/parameters/OrgGroupMembershipId"
responses:
"200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ org_name: "Acme Corp"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_memberships
+ schema:
+ $ref: "#/components/schemas/OrgGroupMembershipResponse"
+ description: OK
+ "400":
content:
application/json:
schema:
- $ref: "#/components/schemas/TeamRoutingRules"
- description: OK
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Get On-Call team routing rules
- tags:
- - On-Call
+ summary: Get an org group membership
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_read
- put:
- description: Set a team's On-Call routing rules
- operationId: SetOnCallTeamRoutingRules
+ - org_group_read
+ 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/).
+ patch:
+ description: Move an organization to a different org group by updating its membership.
+ operationId: UpdateOrgGroupMembership
parameters:
- - description: The team ID
- in: path
- name: team_id
- required: true
- schema:
- example: 27590dae-47be-4a7d-9abf-8f4e45124020
- type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`."
- in: query
- name: include
- schema:
- type: string
+ - $ref: "#/components/parameters/OrgGroupMembershipId"
requestBody:
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_memberships
schema:
- $ref: "#/components/schemas/TeamRoutingRulesRequest"
+ $ref: "#/components/schemas/OrgGroupMembershipUpdateRequest"
required: true
responses:
"200":
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-16T14:00:00Z"
+ org_name: "Acme Corp"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_memberships
schema:
- $ref: "#/components/schemas/TeamRoutingRules"
+ $ref: "#/components/schemas/OrgGroupMembershipResponse"
description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Set On-Call team routing rules
- tags:
- - On-Call
+ summary: Update an org group membership
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_write
- /api/v2/on-call/users/{user_id}/notification-channels:
+ - org_group_write
+ 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/org_group_policies:
get:
- description: List the notification channels for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: ListUserNotificationChannels
+ description: List policies for an organization group. Requires a filter on org group ID.
+ operationId: ListOrgGroupPolicies
parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
+ - $ref: "#/components/parameters/OrgGroupPolicyFilterOrgGroupId"
+ - $ref: "#/components/parameters/OrgGroupPolicyFilterPolicyName"
+ - $ref: "#/components/parameters/OrgGroupPageNumber"
+ - $ref: "#/components/parameters/OrgGroupPageSize"
+ - $ref: "#/components/parameters/PolicySort"
responses:
"200":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ content:
+ value: "UTC"
+ enforced_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ policy_name: "monitor_timezone"
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_policies
+ meta:
+ page:
+ total_count: 1
schema:
- $ref: "#/components/schemas/ListNotificationChannelsResponse"
+ $ref: "#/components/schemas/OrgGroupPolicyListResponse"
description: OK
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: List On-Call notification channels for a user
- tags:
- - On-Call
+ summary: List org group policies
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_read
+ - org_group_read
+ 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 new notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: CreateUserNotificationChannel
- parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
+ description: Create a new policy for an organization group.
+ operationId: CreateOrgGroupPolicy
requestBody:
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ content:
+ value: "UTC"
+ policy_name: "monitor_timezone"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_policies
schema:
- $ref: "#/components/schemas/CreateUserNotificationChannelRequest"
+ $ref: "#/components/schemas/OrgGroupPolicyCreateRequest"
required: true
responses:
"201":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ content:
+ value: "UTC"
+ enforced_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ policy_name: "monitor_timezone"
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_policies
schema:
- $ref: "#/components/schemas/NotificationChannel"
+ $ref: "#/components/schemas/OrgGroupPolicyResponse"
description: Created
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Create an On-Call notification channel for a user
- tags:
- - On-Call
+ summary: Create an org group policy
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_respond
- /api/v2/on-call/users/{user_id}/notification-channels/{channel_id}:
+ - org_group_write
+ 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/org_group_policies/{org_group_policy_id}:
delete:
- description: Delete a notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: DeleteUserNotificationChannel
+ description: Delete an organization group policy by its ID.
+ operationId: DeleteOrgGroupPolicy
parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: The channel ID
- in: path
- name: channel_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
+ - $ref: "#/components/parameters/OrgGroupPolicyId"
responses:
"204":
description: No Content
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Delete an On-Call notification channel for a user
- tags:
- - On-Call
+ summary: Delete an org group policy
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_respond
- get:
- description: Get a notification channel for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: GetUserNotificationChannel
+ - org_group_write
+ 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/).
+ patch:
+ description: Update the content of an existing organization group policy.
+ operationId: UpdateOrgGroupPolicy
parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: The channel ID
- in: path
- name: channel_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
+ - $ref: "#/components/parameters/OrgGroupPolicyId"
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ content:
+ value: "US/Eastern"
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ type: org_group_policies
+ schema:
+ $ref: "#/components/schemas/OrgGroupPolicyUpdateRequest"
+ required: true
responses:
"200":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ content:
+ value: "US/Eastern"
+ enforced_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-16T14:00:00Z"
+ policy_name: "monitor_timezone"
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ type: org_group_policies
schema:
- $ref: "#/components/schemas/NotificationChannel"
+ $ref: "#/components/schemas/OrgGroupPolicyResponse"
description: OK
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Get an On-Call notification channel for a user
- tags:
- - On-Call
+ summary: Update an org group policy
+ tags: [Org Groups]
"x-permission":
- operator: AND
+ operator: OR
permissions:
- - on_call_read
- /api/v2/on-call/users/{user_id}/notification-rules:
+ - org_group_write
+ 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/org_group_policy_configs:
get:
- description: List the notification rules for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: ListUserNotificationRules
- parameters:
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
- in: query
- name: include
- schema:
- type: string
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
+ description: List all org configs that are eligible to be used as organization group policies.
+ operationId: ListOrgGroupPolicyConfigs
responses:
"200":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ allowed_values: ["UTC", "US/Eastern", "US/Pacific"]
+ default_value: "UTC"
+ description: "The default timezone for monitors."
+ name: "monitor_timezone"
+ value_type: "string"
+ id: "monitor_timezone"
+ type: org_group_policy_configs
schema:
- $ref: "#/components/schemas/ListOnCallNotificationRulesResponse"
+ $ref: "#/components/schemas/OrgGroupPolicyConfigListResponse"
description: OK
- "400":
- $ref: "#/components/responses/BadRequestResponse"
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
- "403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
- "429":
- $ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: List On-Call notification rules for a user
- tags:
- - On-Call
- "x-permission":
- operator: AND
- permissions:
- - on_call_read
- post:
- description: Create a new notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: CreateUserNotificationRule
- parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- requestBody:
- content:
- "application/json":
- schema:
- $ref: "#/components/schemas/CreateOnCallNotificationRuleRequest"
- required: true
- responses:
- "201":
content:
- "application/json":
+ application/json:
schema:
- $ref: "#/components/schemas/OnCallNotificationRule"
- description: Created
- "400":
- $ref: "#/components/responses/BadRequestResponse"
- "401":
- $ref: "#/components/responses/UnauthorizedResponse"
- "403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
- "429":
- $ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Create an On-Call notification rule for a user
- tags:
- - On-Call
- "x-permission":
- operator: AND
- permissions:
- - on_call_respond
- /api/v2/on-call/users/{user_id}/notification-rules/{rule_id}:
- delete:
- description: Delete a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: DeleteUserNotificationRule
- parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: The rule ID
- in: path
- name: rule_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- responses:
- "204":
- description: No Content
- "400":
- $ref: "#/components/responses/BadRequestResponse"
- "401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Delete an On-Call notification rule for a user
- tags:
- - On-Call
+ summary: List org group policy configs
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - on_call_respond
+ - org_group_read
+ 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/org_group_policy_overrides:
get:
- description: Get a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: GetUserNotificationRule
- parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: The rule ID
- in: path
- name: rule_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
- in: query
- name: include
- schema:
- type: string
+ description: >-
+ List policy overrides for an organization group. Requires a filter on org group ID. Optionally filter by policy ID.
+ operationId: ListOrgGroupPolicyOverrides
+ parameters:
+ - $ref: "#/components/parameters/OrgGroupPolicyOverrideFilterOrgGroupId"
+ - $ref: "#/components/parameters/OrgGroupPolicyOverrideFilterPolicyId"
+ - $ref: "#/components/parameters/OrgGroupPageNumber"
+ - $ref: "#/components/parameters/OrgGroupPageSize"
+ - $ref: "#/components/parameters/OverrideSort"
responses:
"200":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ org_group_policy:
+ data:
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ type: org_group_policies
+ type: org_group_policy_overrides
+ meta:
+ page:
+ total_count: 1
schema:
- $ref: "#/components/schemas/OnCallNotificationRule"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideListResponse"
description: OK
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Get an On-Call notification rule for a user
- tags:
- - On-Call
+ summary: List org group policy overrides
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - on_call_read
- put:
- description: Update a notification rule for a user. The authenticated user must be the target user or have the `on_call_admin` permission
- operationId: UpdateUserNotificationRule
- parameters:
- - description: The user ID
- in: path
- name: user_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: The rule ID
- in: path
- name: rule_id
- required: true
- schema:
- example: 00000000-0000-0000-0000-000000000000
- type: string
- - description: "Comma-separated list of included relationships to be returned. Allowed values: `channel`."
- in: query
- name: include
- schema:
- type: string
+ - org_group_read
+ 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 new policy override for an organization within an org group.
+ operationId: CreateOrgGroupPolicyOverride
requestBody:
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ org_group_policy:
+ data:
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ type: org_group_policies
+ type: org_group_policy_overrides
schema:
- $ref: "#/components/schemas/UpdateOnCallNotificationRuleRequest"
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideCreateRequest"
required: true
responses:
- "200":
+ "201":
content:
- "application/json":
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ org_group_policy:
+ data:
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ type: org_group_policies
+ type: org_group_policy_overrides
schema:
- $ref: "#/components/schemas/OnCallNotificationRule"
- description: OK
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideResponse"
+ description: Created
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ: []
- summary: Update an On-Call notification rule for a user
- tags:
- - On-Call
+ summary: Create an org group policy override
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - on_call_read
- /api/v2/org_configs:
- get:
- description: Returns all Org Configs (name, description, and value).
- operationId: ListOrgConfigs
+ - org_group_write
+ 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/org_group_policy_overrides/{org_group_policy_override_id}:
+ delete:
+ description: Delete an organization group policy override by its ID.
+ operationId: DeleteOrgGroupPolicyOverride
+ parameters:
+ - $ref: "#/components/parameters/OrgGroupPolicyOverrideId"
responses:
- "200":
+ "204":
+ description: No Content
+ "400":
content:
application/json:
- schema: {$ref: "#/components/schemas/OrgConfigListResponse"}
- description: OK
- "400": {$ref: "#/components/responses/BadRequestResponse"}
- "401": {$ref: "#/components/responses/UnauthorizedResponse"}
- "403": {$ref: "#/components/responses/ForbiddenResponse"}
- "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
- summary: List Org Configs
- tags: [Organizations]
- "x-permission":
- operator: OPEN
- permissions: []
- /api/v2/org_configs/{org_config_name}:
- get:
- description: Return the name, description, and value of a specific Org Config.
- operationId: GetOrgConfig
- parameters: [$ref: "#/components/parameters/OrgConfigName"]
- responses:
- "200":
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
content:
application/json:
- schema: {$ref: "#/components/schemas/OrgConfigGetResponse"}
- description: OK
- "400": {$ref: "#/components/responses/BadRequestResponse"}
- "401": {$ref: "#/components/responses/UnauthorizedResponse"}
- "403": {$ref: "#/components/responses/ForbiddenResponse"}
- "404": {$ref: "#/components/responses/NotFoundResponse"}
- "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
- summary: Get a specific Org Config value
- tags: [Organizations]
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Delete an org group policy override
+ tags: [Org Groups]
"x-permission":
- operator: OPEN
- permissions: []
+ operator: OR
+ permissions:
+ - org_group_write
+ 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/).
patch:
- description: Update the value of a specific Org Config.
- operationId: UpdateOrgConfig
- parameters: [$ref: "#/components/parameters/OrgConfigName"]
+ description: Update an existing organization group policy override.
+ operationId: UpdateOrgGroupPolicyOverride
+ parameters:
+ - $ref: "#/components/parameters/OrgGroupPolicyOverrideId"
requestBody:
content:
application/json:
- schema: {$ref: "#/components/schemas/OrgConfigWriteRequest"}
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ type: org_group_policy_overrides
+ schema:
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideUpdateRequest"
required: true
responses:
"200":
content:
application/json:
- schema: {$ref: "#/components/schemas/OrgConfigGetResponse"}
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-16T14:00:00Z"
+ org_site: "datadoghq.com"
+ org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
+ id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321"
+ relationships:
+ org_group:
+ data:
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ org_group_policy:
+ data:
+ id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
+ type: org_group_policies
+ type: org_group_policy_overrides
+ schema:
+ $ref: "#/components/schemas/OrgGroupPolicyOverrideResponse"
description: OK
- "400": {$ref: "#/components/responses/BadRequestResponse"}
- "401": {$ref: "#/components/responses/UnauthorizedResponse"}
- "403": {$ref: "#/components/responses/ForbiddenResponse"}
- "404": {$ref: "#/components/responses/NotFoundResponse"}
- "429": {$ref: "#/components/responses/TooManyRequestsResponse"}
- summary: Update a specific Org Config
- tags: [Organizations]
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Update an org group policy override
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - org_management
- /api/v2/org_connections:
+ - org_group_write
+ 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/org_groups:
get:
- description: Returns a list of org connections.
- operationId: ListOrgConnections
+ description: List all organization groups that the requesting organization has access to.
+ operationId: ListOrgGroups
parameters:
- - description: The Org ID of the sink org.
- example: "0879ce27-29a1-481f-a12e-bc2a48ec9ae1"
- in: query
- name: sink_org_id
- required: false
- schema:
- type: string
- - description: The Org ID of the source org.
- example: "0879ce27-29a1-481f-a12e-bc2a48ec9ae1"
- in: query
- name: source_org_id
- required: false
- schema:
- type: string
- - description: The limit of number of entries you want to return. Default is 1000.
- example: 1000
- in: query
- name: limit
- required: false
- schema:
- format: int64
- type: integer
- - description: The pagination offset which you want to query from. Default is 0.
- example: 0
- in: query
- name: offset
- required: false
- schema:
- format: int64
- type: integer
+ - $ref: "#/components/parameters/OrgGroupPageNumber"
+ - $ref: "#/components/parameters/OrgGroupPageSize"
+ - $ref: "#/components/parameters/OrgGroupSort"
+ - $ref: "#/components/parameters/OrgGroupInclude"
responses:
"200":
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ name: "My Org Group"
+ owner_org_site: "datadoghq.com"
+ owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ meta:
+ page:
+ total_count: 1
schema:
- $ref: "#/components/schemas/OrgConnectionListResponse"
+ $ref: "#/components/schemas/OrgGroupListResponse"
description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ:
- - org_connections_read
- summary: List Org Connections
- tags: ["Org Connections"]
+ summary: List org groups
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - org_connections_read
+ - org_group_read
+ 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 new org connection between the current org and a target org.
- operationId: CreateOrgConnections
+ description: Create a new organization group.
+ operationId: CreateOrgGroup
requestBody:
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ name: "My Org Group"
+ type: org_groups
schema:
- $ref: "#/components/schemas/OrgConnectionCreateRequest"
+ $ref: "#/components/schemas/OrgGroupCreateRequest"
required: true
responses:
- "200":
+ "201":
content:
application/json:
- schema:
- $ref: "#/components/schemas/OrgConnectionResponse"
- description: OK
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ name: "My Org Group"
+ owner_org_site: "datadoghq.com"
+ owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ schema:
+ $ref: "#/components/schemas/OrgGroupResponse"
+ description: Created
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
- "404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"409":
- $ref: "#/components/responses/ConflictResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ:
- - org_connections_write
- summary: Create Org Connection
- tags: ["Org Connections"]
- x-codegen-request-body-name: body
+ summary: Create an org group
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - org_connections_write
- /api/v2/org_connections/{connection_id}:
+ - org_group_write
+ 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/org_groups/{org_group_id}:
delete:
- description: Delete an existing org connection.
- operationId: DeleteOrgConnections
+ description: Delete an organization group by its ID.
+ operationId: DeleteOrgGroup
parameters:
- - $ref: "#/components/parameters/OrgConnectionId"
+ - $ref: "#/components/parameters/OrgGroupId"
+ responses:
+ "204":
+ description: No Content
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Delete an org group
+ tags: [Org Groups]
+ "x-permission":
+ operator: OR
+ permissions:
+ - org_group_write
+ 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 organization group by its ID.
+ operationId: GetOrgGroup
+ parameters:
+ - $ref: "#/components/parameters/OrgGroupId"
responses:
"200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-15T10:30:00Z"
+ name: "My Org Group"
+ owner_org_site: "datadoghq.com"
+ owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
+ schema:
+ $ref: "#/components/schemas/OrgGroupResponse"
description: OK
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ:
- - org_connections_write
- summary: Delete Org Connection
- tags: ["Org Connections"]
+ summary: Get an org group
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - org_connections_write
+ - org_group_read
+ 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/).
patch:
- description: Update an existing org connection.
- operationId: UpdateOrgConnections
+ description: Update the name of an existing organization group.
+ operationId: UpdateOrgGroup
parameters:
- - $ref: "#/components/parameters/OrgConnectionId"
+ - $ref: "#/components/parameters/OrgGroupId"
requestBody:
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ name: "Updated Org Group Name"
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
schema:
- $ref: "#/components/schemas/OrgConnectionUpdateRequest"
+ $ref: "#/components/schemas/OrgGroupUpdateRequest"
required: true
responses:
"200":
content:
application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2024-01-15T10:30:00Z"
+ modified_at: "2024-01-16T14:00:00Z"
+ name: "Updated Org Group Name"
+ owner_org_site: "datadoghq.com"
+ owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890"
+ id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
+ type: org_groups
schema:
- $ref: "#/components/schemas/OrgConnectionResponse"
+ $ref: "#/components/schemas/OrgGroupResponse"
description: OK
"400":
- $ref: "#/components/responses/BadRequestResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
"401":
- $ref: "#/components/responses/UnauthorizedResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
"403":
- $ref: "#/components/responses/ForbiddenResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"404":
- $ref: "#/components/responses/NotFoundResponse"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- security:
- - apiKeyAuth: []
- appKeyAuth: []
- - AuthZ:
- - org_connections_write
- summary: Update Org Connection
- tags: ["Org Connections"]
+ summary: Update an org group
+ tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- - org_connections_write
+ - org_group_write
+ 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/permissions:
get:
description: |-
@@ -116683,6 +118957,9 @@ tags:
- description: |-
Manage connections between organizations. Org connections allow for controlled sharing of data between different Datadog organizations. See the [Cross-Organization Visibiltiy](https://docs.datadoghq.com/account_management/org_settings/cross_org_visibility/) page for more information.
name: Org Connections
+ - description: >-
+ Manage organization groups, memberships, policies, policy overrides, and policy configurations.
+ name: Org Groups
- description: Create, edit, and manage your organizations. Read more about [multi-org accounts](https://docs.datadoghq.com/account_management/multi_organization).
externalDocs:
description: Find out more at
diff --git a/examples/v2_org-groups_BulkUpdateOrgGroupMemberships.rs b/examples/v2_org-groups_BulkUpdateOrgGroupMemberships.rs
new file mode 100644
index 000000000..469d8a464
--- /dev/null
+++ b/examples/v2_org-groups_BulkUpdateOrgGroupMemberships.rs
@@ -0,0 +1,43 @@
+// Bulk update org group memberships returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::GlobalOrgIdentifier;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateData;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateRelationships;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateRequest;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateType;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupMembershipBulkUpdateRequest::new(OrgGroupMembershipBulkUpdateData::new(
+ OrgGroupMembershipBulkUpdateAttributes::new(vec![GlobalOrgIdentifier::new(
+ "datadoghq.com".to_string(),
+ Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
+ )]),
+ OrgGroupMembershipBulkUpdateRelationships::new(
+ OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ )),
+ OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ )),
+ ),
+ OrgGroupMembershipBulkUpdateType::ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.BulkUpdateOrgGroupMemberships", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api.bulk_update_org_group_memberships(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_CreateOrgGroup.rs b/examples/v2_org-groups_CreateOrgGroup.rs
new file mode 100644
index 000000000..18fc17987
--- /dev/null
+++ b/examples/v2_org-groups_CreateOrgGroup.rs
@@ -0,0 +1,24 @@
+// Create an org group returns "Created" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupCreateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupCreateData;
+use datadog_api_client::datadogV2::model::OrgGroupCreateRequest;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupCreateRequest::new(OrgGroupCreateData::new(
+ OrgGroupCreateAttributes::new("My Org Group".to_string()),
+ OrgGroupType::ORG_GROUPS,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.CreateOrgGroup", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api.create_org_group(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_CreateOrgGroupPolicy.rs b/examples/v2_org-groups_CreateOrgGroupPolicy.rs
new file mode 100644
index 000000000..6f1e80b6f
--- /dev/null
+++ b/examples/v2_org-groups_CreateOrgGroupPolicy.rs
@@ -0,0 +1,40 @@
+// Create an org group policy returns "Created" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateData;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateRelationships;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateRequest;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+use serde_json::Value;
+use std::collections::BTreeMap;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupPolicyCreateRequest::new(OrgGroupPolicyCreateData::new(
+ OrgGroupPolicyCreateAttributes::new(
+ BTreeMap::from([("value".to_string(), Value::from("UTC"))]),
+ "monitor_timezone".to_string(),
+ ),
+ OrgGroupPolicyCreateRelationships::new(OrgGroupRelationshipToOne::new(
+ OrgGroupRelationshipToOneData::new(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ ),
+ )),
+ OrgGroupPolicyType::ORG_GROUP_POLICIES,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.CreateOrgGroupPolicy", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api.create_org_group_policy(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_CreateOrgGroupPolicyOverride.rs b/examples/v2_org-groups_CreateOrgGroupPolicyOverride.rs
new file mode 100644
index 000000000..310d6dfc1
--- /dev/null
+++ b/examples/v2_org-groups_CreateOrgGroupPolicyOverride.rs
@@ -0,0 +1,45 @@
+// Create an org group policy override returns "Created" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateData;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateRelationships;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateRequest;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideType;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyRelationshipToOne;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyRelationshipToOneData;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupPolicyOverrideCreateRequest::new(OrgGroupPolicyOverrideCreateData::new(
+ OrgGroupPolicyOverrideCreateAttributes::new(
+ "datadoghq.com".to_string(),
+ Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
+ ),
+ OrgGroupPolicyOverrideCreateRelationships::new(
+ OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ )),
+ OrgGroupPolicyRelationshipToOne::new(OrgGroupPolicyRelationshipToOneData::new(
+ Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupPolicyType::ORG_GROUP_POLICIES,
+ )),
+ ),
+ OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.CreateOrgGroupPolicyOverride", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api.create_org_group_policy_override(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_DeleteOrgGroup.rs b/examples/v2_org-groups_DeleteOrgGroup.rs
new file mode 100644
index 000000000..bf1938a96
--- /dev/null
+++ b/examples/v2_org-groups_DeleteOrgGroup.rs
@@ -0,0 +1,21 @@
+// Delete an org group returns "No Content" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.DeleteOrgGroup", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .delete_org_group(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_DeleteOrgGroupPolicy.rs b/examples/v2_org-groups_DeleteOrgGroupPolicy.rs
new file mode 100644
index 000000000..922e951ed
--- /dev/null
+++ b/examples/v2_org-groups_DeleteOrgGroupPolicy.rs
@@ -0,0 +1,21 @@
+// Delete an org group policy returns "No Content" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.DeleteOrgGroupPolicy", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .delete_org_group_policy(
+ Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_DeleteOrgGroupPolicyOverride.rs b/examples/v2_org-groups_DeleteOrgGroupPolicyOverride.rs
new file mode 100644
index 000000000..6ba0dd8bb
--- /dev/null
+++ b/examples/v2_org-groups_DeleteOrgGroupPolicyOverride.rs
@@ -0,0 +1,21 @@
+// Delete an org group policy override returns "No Content" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.DeleteOrgGroupPolicyOverride", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .delete_org_group_policy_override(
+ Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_GetOrgGroup.rs b/examples/v2_org-groups_GetOrgGroup.rs
new file mode 100644
index 000000000..837f458a7
--- /dev/null
+++ b/examples/v2_org-groups_GetOrgGroup.rs
@@ -0,0 +1,21 @@
+// Get an org group returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.GetOrgGroup", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .get_org_group(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_GetOrgGroupMembership.rs b/examples/v2_org-groups_GetOrgGroupMembership.rs
new file mode 100644
index 000000000..e489e6337
--- /dev/null
+++ b/examples/v2_org-groups_GetOrgGroupMembership.rs
@@ -0,0 +1,21 @@
+// Get an org group membership returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.GetOrgGroupMembership", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .get_org_group_membership(
+ Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").expect("invalid UUID"),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_ListOrgGroupMemberships.rs b/examples/v2_org-groups_ListOrgGroupMemberships.rs
new file mode 100644
index 000000000..107b1fc82
--- /dev/null
+++ b/examples/v2_org-groups_ListOrgGroupMemberships.rs
@@ -0,0 +1,19 @@
+// List org group memberships returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupMembershipsOptionalParams;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.ListOrgGroupMemberships", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .list_org_group_memberships(ListOrgGroupMembershipsOptionalParams::default())
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_ListOrgGroupPolicies.rs b/examples/v2_org-groups_ListOrgGroupPolicies.rs
new file mode 100644
index 000000000..db6860406
--- /dev/null
+++ b/examples/v2_org-groups_ListOrgGroupPolicies.rs
@@ -0,0 +1,23 @@
+// List org group policies returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupPoliciesOptionalParams;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicies", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .list_org_group_policies(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ ListOrgGroupPoliciesOptionalParams::default(),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_ListOrgGroupPolicyConfigs.rs b/examples/v2_org-groups_ListOrgGroupPolicyConfigs.rs
new file mode 100644
index 000000000..98d8dd8dc
--- /dev/null
+++ b/examples/v2_org-groups_ListOrgGroupPolicyConfigs.rs
@@ -0,0 +1,16 @@
+// List org group policy configs returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicyConfigs", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api.list_org_group_policy_configs().await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_ListOrgGroupPolicyOverrides.rs b/examples/v2_org-groups_ListOrgGroupPolicyOverrides.rs
new file mode 100644
index 000000000..07bbf5a4e
--- /dev/null
+++ b/examples/v2_org-groups_ListOrgGroupPolicyOverrides.rs
@@ -0,0 +1,23 @@
+// List org group policy overrides returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupPolicyOverridesOptionalParams;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicyOverrides", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .list_org_group_policy_overrides(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ ListOrgGroupPolicyOverridesOptionalParams::default(),
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_ListOrgGroups.rs b/examples/v2_org-groups_ListOrgGroups.rs
new file mode 100644
index 000000000..0a778d17a
--- /dev/null
+++ b/examples/v2_org-groups_ListOrgGroups.rs
@@ -0,0 +1,19 @@
+// List org groups returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupsOptionalParams;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+
+#[tokio::main]
+async fn main() {
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.ListOrgGroups", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .list_org_groups(ListOrgGroupsOptionalParams::default())
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_UpdateOrgGroup.rs b/examples/v2_org-groups_UpdateOrgGroup.rs
new file mode 100644
index 000000000..ccdf239da
--- /dev/null
+++ b/examples/v2_org-groups_UpdateOrgGroup.rs
@@ -0,0 +1,31 @@
+// Update an org group returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+use datadog_api_client::datadogV2::model::OrgGroupUpdateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupUpdateData;
+use datadog_api_client::datadogV2::model::OrgGroupUpdateRequest;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupUpdateRequest::new(OrgGroupUpdateData::new(
+ OrgGroupUpdateAttributes::new("Updated Org Group Name".to_string()),
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.UpdateOrgGroup", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .update_org_group(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ body,
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_UpdateOrgGroupMembership.rs b/examples/v2_org-groups_UpdateOrgGroupMembership.rs
new file mode 100644
index 000000000..6972aa4b7
--- /dev/null
+++ b/examples/v2_org-groups_UpdateOrgGroupMembership.rs
@@ -0,0 +1,39 @@
+// Update an org group membership returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipType;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateData;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateRelationships;
+use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateRequest;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
+use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
+use datadog_api_client::datadogV2::model::OrgGroupType;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupMembershipUpdateRequest::new(OrgGroupMembershipUpdateData::new(
+ Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").expect("invalid UUID"),
+ OrgGroupMembershipUpdateRelationships::new(OrgGroupRelationshipToOne::new(
+ OrgGroupRelationshipToOneData::new(
+ Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupType::ORG_GROUPS,
+ ),
+ )),
+ OrgGroupMembershipType::ORG_GROUP_MEMBERSHIPS,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupMembership", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .update_org_group_membership(
+ Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").expect("invalid UUID"),
+ body,
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_UpdateOrgGroupPolicy.rs b/examples/v2_org-groups_UpdateOrgGroupPolicy.rs
new file mode 100644
index 000000000..8514ee566
--- /dev/null
+++ b/examples/v2_org-groups_UpdateOrgGroupPolicy.rs
@@ -0,0 +1,34 @@
+// Update an org group policy returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateData;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateRequest;
+use serde_json::Value;
+use std::collections::BTreeMap;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupPolicyUpdateRequest::new(OrgGroupPolicyUpdateData::new(
+ OrgGroupPolicyUpdateAttributes::new()
+ .content(BTreeMap::from([("value".to_string(), Value::from("UTC"))])),
+ Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
+ OrgGroupPolicyType::ORG_GROUP_POLICIES,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupPolicy", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .update_org_group_policy(
+ Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
+ body,
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_org-groups_UpdateOrgGroupPolicyOverride.rs b/examples/v2_org-groups_UpdateOrgGroupPolicyOverride.rs
new file mode 100644
index 000000000..ef64026f7
--- /dev/null
+++ b/examples/v2_org-groups_UpdateOrgGroupPolicyOverride.rs
@@ -0,0 +1,34 @@
+// Update an org group policy override returns "OK" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideType;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateAttributes;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateData;
+use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateRequest;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = OrgGroupPolicyOverrideUpdateRequest::new(OrgGroupPolicyOverrideUpdateData::new(
+ OrgGroupPolicyOverrideUpdateAttributes::new(
+ "datadoghq.com".to_string(),
+ Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
+ ),
+ Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
+ OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
+ ));
+ let mut configuration = datadog::Configuration::new();
+ configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupPolicyOverride", true);
+ let api = OrgGroupsAPI::with_config(configuration);
+ let resp = api
+ .update_org_group_policy_override(
+ Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
+ body,
+ )
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/src/datadog/configuration.rs b/src/datadog/configuration.rs
index f07df95ec..b1495eb75 100644
--- a/src/datadog/configuration.rs
+++ b/src/datadog/configuration.rs
@@ -344,6 +344,24 @@ impl Default for Configuration {
false,
),
("v2.validate_monitor_user_template".to_owned(), false),
+ ("v2.bulk_update_org_group_memberships".to_owned(), false),
+ ("v2.create_org_group".to_owned(), false),
+ ("v2.create_org_group_policy".to_owned(), false),
+ ("v2.create_org_group_policy_override".to_owned(), false),
+ ("v2.delete_org_group".to_owned(), false),
+ ("v2.delete_org_group_policy".to_owned(), false),
+ ("v2.delete_org_group_policy_override".to_owned(), false),
+ ("v2.get_org_group".to_owned(), false),
+ ("v2.get_org_group_membership".to_owned(), false),
+ ("v2.list_org_group_memberships".to_owned(), false),
+ ("v2.list_org_group_policies".to_owned(), false),
+ ("v2.list_org_group_policy_configs".to_owned(), false),
+ ("v2.list_org_group_policy_overrides".to_owned(), false),
+ ("v2.list_org_groups".to_owned(), false),
+ ("v2.update_org_group".to_owned(), false),
+ ("v2.update_org_group_membership".to_owned(), false),
+ ("v2.update_org_group_policy".to_owned(), false),
+ ("v2.update_org_group_policy_override".to_owned(), false),
("v2.list_role_templates".to_owned(), false),
("v2.create_connection".to_owned(), false),
("v2.delete_connection".to_owned(), false),
diff --git a/src/datadogV2/api/api_org_groups.rs b/src/datadogV2/api/api_org_groups.rs
new file mode 100644
index 000000000..e3612ba8a
--- /dev/null
+++ b/src/datadogV2/api/api_org_groups.rs
@@ -0,0 +1,2958 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use crate::datadog;
+use flate2::{
+ write::{GzEncoder, ZlibEncoder},
+ Compression,
+};
+use log::warn;
+use reqwest::header::{HeaderMap, HeaderValue};
+use serde::{Deserialize, Serialize};
+use std::io::Write;
+
+/// ListOrgGroupMembershipsOptionalParams is a struct for passing parameters to the method [`OrgGroupsAPI::list_org_group_memberships`]
+#[non_exhaustive]
+#[derive(Clone, Default, Debug)]
+pub struct ListOrgGroupMembershipsOptionalParams {
+ /// Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.
+ pub filter_org_group_id: Option,
+ /// Filter memberships by org UUID. Returns a single-item list.
+ pub filter_org_uuid: Option,
+ /// The page number to return.
+ pub page_number: Option,
+ /// The number of items per page. Maximum is 1000.
+ pub page_size: Option,
+ /// Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ pub sort: Option,
+}
+
+impl ListOrgGroupMembershipsOptionalParams {
+ /// Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.
+ pub fn filter_org_group_id(mut self, value: uuid::Uuid) -> Self {
+ self.filter_org_group_id = Some(value);
+ self
+ }
+ /// Filter memberships by org UUID. Returns a single-item list.
+ pub fn filter_org_uuid(mut self, value: uuid::Uuid) -> Self {
+ self.filter_org_uuid = Some(value);
+ self
+ }
+ /// The page number to return.
+ pub fn page_number(mut self, value: i64) -> Self {
+ self.page_number = Some(value);
+ self
+ }
+ /// The number of items per page. Maximum is 1000.
+ pub fn page_size(mut self, value: i64) -> Self {
+ self.page_size = Some(value);
+ self
+ }
+ /// Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ pub fn sort(mut self, value: crate::datadogV2::model::OrgGroupMembershipSortOption) -> Self {
+ self.sort = Some(value);
+ self
+ }
+}
+
+/// ListOrgGroupPoliciesOptionalParams is a struct for passing parameters to the method [`OrgGroupsAPI::list_org_group_policies`]
+#[non_exhaustive]
+#[derive(Clone, Default, Debug)]
+pub struct ListOrgGroupPoliciesOptionalParams {
+ /// Filter policies by policy name.
+ pub filter_policy_name: Option,
+ /// The page number to return.
+ pub page_number: Option,
+ /// The number of items per page. Maximum is 1000.
+ pub page_size: Option,
+ /// Field to sort policies by. Supported values: `id`, `name`, `-id`, `-name`. Defaults to `id`.
+ pub sort: Option,
+}
+
+impl ListOrgGroupPoliciesOptionalParams {
+ /// Filter policies by policy name.
+ pub fn filter_policy_name(mut self, value: String) -> Self {
+ self.filter_policy_name = Some(value);
+ self
+ }
+ /// The page number to return.
+ pub fn page_number(mut self, value: i64) -> Self {
+ self.page_number = Some(value);
+ self
+ }
+ /// The number of items per page. Maximum is 1000.
+ pub fn page_size(mut self, value: i64) -> Self {
+ self.page_size = Some(value);
+ self
+ }
+ /// Field to sort policies by. Supported values: `id`, `name`, `-id`, `-name`. Defaults to `id`.
+ pub fn sort(mut self, value: crate::datadogV2::model::OrgGroupPolicySortOption) -> Self {
+ self.sort = Some(value);
+ self
+ }
+}
+
+/// ListOrgGroupPolicyOverridesOptionalParams is a struct for passing parameters to the method [`OrgGroupsAPI::list_org_group_policy_overrides`]
+#[non_exhaustive]
+#[derive(Clone, Default, Debug)]
+pub struct ListOrgGroupPolicyOverridesOptionalParams {
+ /// Filter policy overrides by policy ID.
+ pub filter_policy_id: Option,
+ /// The page number to return.
+ pub page_number: Option,
+ /// The number of items per page. Maximum is 1000.
+ pub page_size: Option,
+ /// Field to sort overrides by. Supported values: `id`, `org_uuid`, `-id`, `-org_uuid`. Defaults to `id`.
+ pub sort: Option,
+}
+
+impl ListOrgGroupPolicyOverridesOptionalParams {
+ /// Filter policy overrides by policy ID.
+ pub fn filter_policy_id(mut self, value: uuid::Uuid) -> Self {
+ self.filter_policy_id = Some(value);
+ self
+ }
+ /// The page number to return.
+ pub fn page_number(mut self, value: i64) -> Self {
+ self.page_number = Some(value);
+ self
+ }
+ /// The number of items per page. Maximum is 1000.
+ pub fn page_size(mut self, value: i64) -> Self {
+ self.page_size = Some(value);
+ self
+ }
+ /// Field to sort overrides by. Supported values: `id`, `org_uuid`, `-id`, `-org_uuid`. Defaults to `id`.
+ pub fn sort(
+ mut self,
+ value: crate::datadogV2::model::OrgGroupPolicyOverrideSortOption,
+ ) -> Self {
+ self.sort = Some(value);
+ self
+ }
+}
+
+/// ListOrgGroupsOptionalParams is a struct for passing parameters to the method [`OrgGroupsAPI::list_org_groups`]
+#[non_exhaustive]
+#[derive(Clone, Default, Debug)]
+pub struct ListOrgGroupsOptionalParams {
+ /// The page number to return.
+ pub page_number: Option,
+ /// The number of items per page. Maximum is 1000.
+ pub page_size: Option,
+ /// Field to sort org groups by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ pub sort: Option,
+ /// List of related resources to include.
+ pub include: Option>,
+}
+
+impl ListOrgGroupsOptionalParams {
+ /// The page number to return.
+ pub fn page_number(mut self, value: i64) -> Self {
+ self.page_number = Some(value);
+ self
+ }
+ /// The number of items per page. Maximum is 1000.
+ pub fn page_size(mut self, value: i64) -> Self {
+ self.page_size = Some(value);
+ self
+ }
+ /// Field to sort org groups by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`.
+ pub fn sort(mut self, value: crate::datadogV2::model::OrgGroupSortOption) -> Self {
+ self.sort = Some(value);
+ self
+ }
+ /// List of related resources to include.
+ pub fn include(mut self, value: Vec) -> Self {
+ self.include = Some(value);
+ self
+ }
+}
+
+/// BulkUpdateOrgGroupMembershipsError is a struct for typed errors of method [`OrgGroupsAPI::bulk_update_org_group_memberships`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum BulkUpdateOrgGroupMembershipsError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// CreateOrgGroupError is a struct for typed errors of method [`OrgGroupsAPI::create_org_group`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateOrgGroupError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// CreateOrgGroupPolicyError is a struct for typed errors of method [`OrgGroupsAPI::create_org_group_policy`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateOrgGroupPolicyError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// CreateOrgGroupPolicyOverrideError is a struct for typed errors of method [`OrgGroupsAPI::create_org_group_policy_override`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateOrgGroupPolicyOverrideError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// DeleteOrgGroupError is a struct for typed errors of method [`OrgGroupsAPI::delete_org_group`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteOrgGroupError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// DeleteOrgGroupPolicyError is a struct for typed errors of method [`OrgGroupsAPI::delete_org_group_policy`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteOrgGroupPolicyError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// DeleteOrgGroupPolicyOverrideError is a struct for typed errors of method [`OrgGroupsAPI::delete_org_group_policy_override`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteOrgGroupPolicyOverrideError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetOrgGroupError is a struct for typed errors of method [`OrgGroupsAPI::get_org_group`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetOrgGroupError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetOrgGroupMembershipError is a struct for typed errors of method [`OrgGroupsAPI::get_org_group_membership`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetOrgGroupMembershipError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ListOrgGroupMembershipsError is a struct for typed errors of method [`OrgGroupsAPI::list_org_group_memberships`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ListOrgGroupMembershipsError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ListOrgGroupPoliciesError is a struct for typed errors of method [`OrgGroupsAPI::list_org_group_policies`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ListOrgGroupPoliciesError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ListOrgGroupPolicyConfigsError is a struct for typed errors of method [`OrgGroupsAPI::list_org_group_policy_configs`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ListOrgGroupPolicyConfigsError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ListOrgGroupPolicyOverridesError is a struct for typed errors of method [`OrgGroupsAPI::list_org_group_policy_overrides`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ListOrgGroupPolicyOverridesError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ListOrgGroupsError is a struct for typed errors of method [`OrgGroupsAPI::list_org_groups`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ListOrgGroupsError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// UpdateOrgGroupError is a struct for typed errors of method [`OrgGroupsAPI::update_org_group`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateOrgGroupError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// UpdateOrgGroupMembershipError is a struct for typed errors of method [`OrgGroupsAPI::update_org_group_membership`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateOrgGroupMembershipError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// UpdateOrgGroupPolicyError is a struct for typed errors of method [`OrgGroupsAPI::update_org_group_policy`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateOrgGroupPolicyError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// UpdateOrgGroupPolicyOverrideError is a struct for typed errors of method [`OrgGroupsAPI::update_org_group_policy_override`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateOrgGroupPolicyOverrideError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// Manage organization groups, memberships, policies, policy overrides, and policy configurations.
+#[derive(Debug, Clone)]
+pub struct OrgGroupsAPI {
+ config: datadog::Configuration,
+ client: reqwest_middleware::ClientWithMiddleware,
+}
+
+impl Default for OrgGroupsAPI {
+ fn default() -> Self {
+ Self::with_config(datadog::Configuration::default())
+ }
+}
+
+impl OrgGroupsAPI {
+ pub fn new() -> Self {
+ Self::default()
+ }
+ pub fn with_config(config: datadog::Configuration) -> Self {
+ let reqwest_client_builder = {
+ let builder = reqwest::Client::builder();
+ #[cfg(not(target_arch = "wasm32"))]
+ let builder = if let Some(proxy_url) = &config.proxy_url {
+ builder.proxy(reqwest::Proxy::all(proxy_url).expect("Failed to parse proxy URL"))
+ } else {
+ builder
+ };
+ builder
+ };
+
+ let middleware_client_builder = {
+ let builder =
+ reqwest_middleware::ClientBuilder::new(reqwest_client_builder.build().unwrap());
+ #[cfg(feature = "retry")]
+ let builder = if config.enable_retry {
+ struct RetryableStatus;
+ impl reqwest_retry::RetryableStrategy for RetryableStatus {
+ fn handle(
+ &self,
+ res: &Result,
+ ) -> Option {
+ match res {
+ Ok(success) => reqwest_retry::default_on_request_success(success),
+ Err(_) => None,
+ }
+ }
+ }
+ let backoff_policy = reqwest_retry::policies::ExponentialBackoff::builder()
+ .build_with_max_retries(config.max_retries);
+
+ let retry_middleware =
+ reqwest_retry::RetryTransientMiddleware::new_with_policy_and_strategy(
+ backoff_policy,
+ RetryableStatus,
+ );
+
+ builder.with(retry_middleware)
+ } else {
+ builder
+ };
+ builder
+ };
+
+ let client = middleware_client_builder.build();
+
+ Self { config, client }
+ }
+
+ pub fn with_client_and_config(
+ config: datadog::Configuration,
+ client: reqwest_middleware::ClientWithMiddleware,
+ ) -> Self {
+ Self { config, client }
+ }
+
+ /// Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request.
+ pub async fn bulk_update_org_group_memberships(
+ &self,
+ body: crate::datadogV2::model::OrgGroupMembershipBulkUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupMembershipListResponse,
+ datadog::Error,
+ > {
+ match self
+ .bulk_update_org_group_memberships_with_http_info(body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request.
+ pub async fn bulk_update_org_group_memberships_with_http_info(
+ &self,
+ body: crate::datadogV2::model::OrgGroupMembershipBulkUpdateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.bulk_update_org_group_memberships";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.bulk_update_org_group_memberships' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_memberships/bulk",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Create a new organization group.
+ pub async fn create_org_group(
+ &self,
+ body: crate::datadogV2::model::OrgGroupCreateRequest,
+ ) -> Result>
+ {
+ match self.create_org_group_with_http_info(body).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Create a new organization group.
+ pub async fn create_org_group_with_http_info(
+ &self,
+ body: crate::datadogV2::model::OrgGroupCreateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.create_org_group";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.create_org_group' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_groups",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(&local_content)
+ {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Create a new policy for an organization group.
+ pub async fn create_org_group_policy(
+ &self,
+ body: crate::datadogV2::model::OrgGroupPolicyCreateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyResponse,
+ datadog::Error,
+ > {
+ match self.create_org_group_policy_with_http_info(body).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Create a new policy for an organization group.
+ pub async fn create_org_group_policy_with_http_info(
+ &self,
+ body: crate::datadogV2::model::OrgGroupPolicyCreateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.create_org_group_policy";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.create_org_group_policy' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policies",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Create a new policy override for an organization within an org group.
+ pub async fn create_org_group_policy_override(
+ &self,
+ body: crate::datadogV2::model::OrgGroupPolicyOverrideCreateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyOverrideResponse,
+ datadog::Error,
+ > {
+ match self
+ .create_org_group_policy_override_with_http_info(body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Create a new policy override for an organization within an org group.
+ pub async fn create_org_group_policy_override_with_http_info(
+ &self,
+ body: crate::datadogV2::model::OrgGroupPolicyOverrideCreateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.create_org_group_policy_override";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.create_org_group_policy_override' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policy_overrides",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Delete an organization group by its ID.
+ pub async fn delete_org_group(
+ &self,
+ org_group_id: uuid::Uuid,
+ ) -> Result<(), datadog::Error> {
+ match self.delete_org_group_with_http_info(org_group_id).await {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Delete an organization group by its ID.
+ pub async fn delete_org_group_with_http_info(
+ &self,
+ org_group_id: uuid::Uuid,
+ ) -> Result, datadog::Error> {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_org_group";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.delete_org_group' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_groups/{org_group_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_id = datadog::urlencode(org_group_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Delete an organization group policy by its ID.
+ pub async fn delete_org_group_policy(
+ &self,
+ org_group_policy_id: uuid::Uuid,
+ ) -> Result<(), datadog::Error> {
+ match self
+ .delete_org_group_policy_with_http_info(org_group_policy_id)
+ .await
+ {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Delete an organization group policy by its ID.
+ pub async fn delete_org_group_policy_with_http_info(
+ &self,
+ org_group_policy_id: uuid::Uuid,
+ ) -> Result, datadog::Error> {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_org_group_policy";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.delete_org_group_policy' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policies/{org_group_policy_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_policy_id = datadog::urlencode(org_group_policy_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Delete an organization group policy override by its ID.
+ pub async fn delete_org_group_policy_override(
+ &self,
+ org_group_policy_override_id: uuid::Uuid,
+ ) -> Result<(), datadog::Error> {
+ match self
+ .delete_org_group_policy_override_with_http_info(org_group_policy_override_id)
+ .await
+ {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Delete an organization group policy override by its ID.
+ pub async fn delete_org_group_policy_override_with_http_info(
+ &self,
+ org_group_policy_override_id: uuid::Uuid,
+ ) -> Result, datadog::Error>
+ {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_org_group_policy_override";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.delete_org_group_policy_override' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policy_overrides/{org_group_policy_override_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_policy_override_id =
+ datadog::urlencode(org_group_policy_override_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Get a specific organization group by its ID.
+ pub async fn get_org_group(
+ &self,
+ org_group_id: uuid::Uuid,
+ ) -> Result> {
+ match self.get_org_group_with_http_info(org_group_id).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Get a specific organization group by its ID.
+ pub async fn get_org_group_with_http_info(
+ &self,
+ org_group_id: uuid::Uuid,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.get_org_group";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.get_org_group' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_groups/{org_group_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_id = datadog::urlencode(org_group_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(&local_content)
+ {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Get a specific organization group membership by its ID.
+ pub async fn get_org_group_membership(
+ &self,
+ org_group_membership_id: uuid::Uuid,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupMembershipResponse,
+ datadog::Error,
+ > {
+ match self
+ .get_org_group_membership_with_http_info(org_group_membership_id)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Get a specific organization group membership by its ID.
+ pub async fn get_org_group_membership_with_http_info(
+ &self,
+ org_group_membership_id: uuid::Uuid,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.get_org_group_membership";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.get_org_group_membership' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_memberships/{org_group_membership_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_membership_id = datadog::urlencode(org_group_membership_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// List organization group memberships. Filter by org group ID or org UUID. At least one of `filter[org_group_id]` or `filter[org_uuid]` must be provided. When filtering by org UUID, returns a single-item list with the membership for that org.
+ pub async fn list_org_group_memberships(
+ &self,
+ params: ListOrgGroupMembershipsOptionalParams,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupMembershipListResponse,
+ datadog::Error,
+ > {
+ match self.list_org_group_memberships_with_http_info(params).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// List organization group memberships. Filter by org group ID or org UUID. At least one of `filter[org_group_id]` or `filter[org_uuid]` must be provided. When filtering by org UUID, returns a single-item list with the membership for that org.
+ pub async fn list_org_group_memberships_with_http_info(
+ &self,
+ params: ListOrgGroupMembershipsOptionalParams,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.list_org_group_memberships";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.list_org_group_memberships' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ // unbox and build optional parameters
+ let filter_org_group_id = params.filter_org_group_id;
+ let filter_org_uuid = params.filter_org_uuid;
+ let page_number = params.page_number;
+ let page_size = params.page_size;
+ let sort = params.sort;
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_memberships",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ if let Some(ref local_query_param) = filter_org_group_id {
+ local_req_builder = local_req_builder
+ .query(&[("filter[org_group_id]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = filter_org_uuid {
+ local_req_builder =
+ local_req_builder.query(&[("filter[org_uuid]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_number {
+ local_req_builder =
+ local_req_builder.query(&[("page[number]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_size {
+ local_req_builder =
+ local_req_builder.query(&[("page[size]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = sort {
+ local_req_builder =
+ local_req_builder.query(&[("sort", &local_query_param.to_string())]);
+ };
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// List policies for an organization group. Requires a filter on org group ID.
+ pub async fn list_org_group_policies(
+ &self,
+ filter_org_group_id: uuid::Uuid,
+ params: ListOrgGroupPoliciesOptionalParams,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyListResponse,
+ datadog::Error,
+ > {
+ match self
+ .list_org_group_policies_with_http_info(filter_org_group_id, params)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// List policies for an organization group. Requires a filter on org group ID.
+ pub async fn list_org_group_policies_with_http_info(
+ &self,
+ filter_org_group_id: uuid::Uuid,
+ params: ListOrgGroupPoliciesOptionalParams,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.list_org_group_policies";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.list_org_group_policies' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ // unbox and build optional parameters
+ let filter_policy_name = params.filter_policy_name;
+ let page_number = params.page_number;
+ let page_size = params.page_size;
+ let sort = params.sort;
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policies",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ local_req_builder =
+ local_req_builder.query(&[("filter[org_group_id]", &filter_org_group_id.to_string())]);
+ if let Some(ref local_query_param) = filter_policy_name {
+ local_req_builder =
+ local_req_builder.query(&[("filter[policy_name]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_number {
+ local_req_builder =
+ local_req_builder.query(&[("page[number]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_size {
+ local_req_builder =
+ local_req_builder.query(&[("page[size]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = sort {
+ local_req_builder =
+ local_req_builder.query(&[("sort", &local_query_param.to_string())]);
+ };
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// List all org configs that are eligible to be used as organization group policies.
+ pub async fn list_org_group_policy_configs(
+ &self,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyConfigListResponse,
+ datadog::Error,
+ > {
+ match self.list_org_group_policy_configs_with_http_info().await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// List all org configs that are eligible to be used as organization group policies.
+ pub async fn list_org_group_policy_configs_with_http_info(
+ &self,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.list_org_group_policy_configs";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.list_org_group_policy_configs' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policy_configs",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// List policy overrides for an organization group. Requires a filter on org group ID. Optionally filter by policy ID.
+ pub async fn list_org_group_policy_overrides(
+ &self,
+ filter_org_group_id: uuid::Uuid,
+ params: ListOrgGroupPolicyOverridesOptionalParams,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyOverrideListResponse,
+ datadog::Error,
+ > {
+ match self
+ .list_org_group_policy_overrides_with_http_info(filter_org_group_id, params)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// List policy overrides for an organization group. Requires a filter on org group ID. Optionally filter by policy ID.
+ pub async fn list_org_group_policy_overrides_with_http_info(
+ &self,
+ filter_org_group_id: uuid::Uuid,
+ params: ListOrgGroupPolicyOverridesOptionalParams,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.list_org_group_policy_overrides";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.list_org_group_policy_overrides' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ // unbox and build optional parameters
+ let filter_policy_id = params.filter_policy_id;
+ let page_number = params.page_number;
+ let page_size = params.page_size;
+ let sort = params.sort;
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policy_overrides",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ local_req_builder =
+ local_req_builder.query(&[("filter[org_group_id]", &filter_org_group_id.to_string())]);
+ if let Some(ref local_query_param) = filter_policy_id {
+ local_req_builder =
+ local_req_builder.query(&[("filter[policy_id]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_number {
+ local_req_builder =
+ local_req_builder.query(&[("page[number]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_size {
+ local_req_builder =
+ local_req_builder.query(&[("page[size]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = sort {
+ local_req_builder =
+ local_req_builder.query(&[("sort", &local_query_param.to_string())]);
+ };
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// List all organization groups that the requesting organization has access to.
+ pub async fn list_org_groups(
+ &self,
+ params: ListOrgGroupsOptionalParams,
+ ) -> Result>
+ {
+ match self.list_org_groups_with_http_info(params).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// List all organization groups that the requesting organization has access to.
+ pub async fn list_org_groups_with_http_info(
+ &self,
+ params: ListOrgGroupsOptionalParams,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.list_org_groups";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.list_org_groups' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ // unbox and build optional parameters
+ let page_number = params.page_number;
+ let page_size = params.page_size;
+ let sort = params.sort;
+ let include = params.include;
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_groups",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ if let Some(ref local_query_param) = page_number {
+ local_req_builder =
+ local_req_builder.query(&[("page[number]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = page_size {
+ local_req_builder =
+ local_req_builder.query(&[("page[size]", &local_query_param.to_string())]);
+ };
+ if let Some(ref local_query_param) = sort {
+ local_req_builder =
+ local_req_builder.query(&[("sort", &local_query_param.to_string())]);
+ };
+ if let Some(ref local) = include {
+ local_req_builder = local_req_builder.query(&[(
+ "include",
+ &local
+ .iter()
+ .map(|p| p.to_string())
+ .collect::>()
+ .join(",")
+ .to_string(),
+ )]);
+ };
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Update the name of an existing organization group.
+ pub async fn update_org_group(
+ &self,
+ org_group_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupUpdateRequest,
+ ) -> Result>
+ {
+ match self
+ .update_org_group_with_http_info(org_group_id, body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Update the name of an existing organization group.
+ pub async fn update_org_group_with_http_info(
+ &self,
+ org_group_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupUpdateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.update_org_group";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.update_org_group' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_groups/{org_group_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_id = datadog::urlencode(org_group_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(&local_content)
+ {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Move an organization to a different org group by updating its membership.
+ pub async fn update_org_group_membership(
+ &self,
+ org_group_membership_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupMembershipUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupMembershipResponse,
+ datadog::Error,
+ > {
+ match self
+ .update_org_group_membership_with_http_info(org_group_membership_id, body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Move an organization to a different org group by updating its membership.
+ pub async fn update_org_group_membership_with_http_info(
+ &self,
+ org_group_membership_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupMembershipUpdateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.update_org_group_membership";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.update_org_group_membership' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_memberships/{org_group_membership_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_membership_id = datadog::urlencode(org_group_membership_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Update the content of an existing organization group policy.
+ pub async fn update_org_group_policy(
+ &self,
+ org_group_policy_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupPolicyUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyResponse,
+ datadog::Error,
+ > {
+ match self
+ .update_org_group_policy_with_http_info(org_group_policy_id, body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Update the content of an existing organization group policy.
+ pub async fn update_org_group_policy_with_http_info(
+ &self,
+ org_group_policy_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupPolicyUpdateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.update_org_group_policy";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.update_org_group_policy' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policies/{org_group_policy_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_policy_id = datadog::urlencode(org_group_policy_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Update an existing organization group policy override.
+ pub async fn update_org_group_policy_override(
+ &self,
+ org_group_policy_override_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupPolicyOverrideUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::OrgGroupPolicyOverrideResponse,
+ datadog::Error,
+ > {
+ match self
+ .update_org_group_policy_override_with_http_info(org_group_policy_override_id, body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Update an existing organization group policy override.
+ pub async fn update_org_group_policy_override_with_http_info(
+ &self,
+ org_group_policy_override_id: uuid::Uuid,
+ body: crate::datadogV2::model::OrgGroupPolicyOverrideUpdateRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.update_org_group_policy_override";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.update_org_group_policy_override' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/org_group_policy_overrides/{org_group_policy_override_id}",
+ local_configuration.get_operation_host(operation_id),
+ org_group_policy_override_id =
+ datadog::urlencode(org_group_policy_override_id.to_string())
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ #[cfg(feature = "zstd")]
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+}
diff --git a/src/datadogV2/api/mod.rs b/src/datadogV2/api/mod.rs
index 49198038b..223a515ff 100644
--- a/src/datadogV2/api/mod.rs
+++ b/src/datadogV2/api/mod.rs
@@ -71,6 +71,7 @@ pub mod api_on_call;
pub mod api_on_call_paging;
pub mod api_opsgenie_integration;
pub mod api_org_connections;
+pub mod api_org_groups;
pub mod api_organizations;
pub mod api_powerpack;
pub mod api_processes;
diff --git a/src/datadogV2/mod.rs b/src/datadogV2/mod.rs
index 38f44618a..afd3cfcae 100644
--- a/src/datadogV2/mod.rs
+++ b/src/datadogV2/mod.rs
@@ -72,6 +72,7 @@ pub use self::api::api_on_call;
pub use self::api::api_on_call_paging;
pub use self::api::api_opsgenie_integration;
pub use self::api::api_org_connections;
+pub use self::api::api_org_groups;
pub use self::api::api_organizations;
pub use self::api::api_powerpack;
pub use self::api::api_processes;
diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs
index 08629f955..a7c8ede24 100644
--- a/src/datadogV2/model/mod.rs
+++ b/src/datadogV2/model/mod.rs
@@ -6074,6 +6074,146 @@ pub mod model_org_connection_update;
pub use self::model_org_connection_update::OrgConnectionUpdate;
pub mod model_org_connection_update_attributes;
pub use self::model_org_connection_update_attributes::OrgConnectionUpdateAttributes;
+pub mod model_org_group_membership_sort_option;
+pub use self::model_org_group_membership_sort_option::OrgGroupMembershipSortOption;
+pub mod model_org_group_membership_list_response;
+pub use self::model_org_group_membership_list_response::OrgGroupMembershipListResponse;
+pub mod model_org_group_membership_data;
+pub use self::model_org_group_membership_data::OrgGroupMembershipData;
+pub mod model_org_group_membership_attributes;
+pub use self::model_org_group_membership_attributes::OrgGroupMembershipAttributes;
+pub mod model_org_group_membership_relationships;
+pub use self::model_org_group_membership_relationships::OrgGroupMembershipRelationships;
+pub mod model_org_group_relationship_to_one;
+pub use self::model_org_group_relationship_to_one::OrgGroupRelationshipToOne;
+pub mod model_org_group_relationship_to_one_data;
+pub use self::model_org_group_relationship_to_one_data::OrgGroupRelationshipToOneData;
+pub mod model_org_group_type;
+pub use self::model_org_group_type::OrgGroupType;
+pub mod model_org_group_membership_type;
+pub use self::model_org_group_membership_type::OrgGroupMembershipType;
+pub mod model_org_group_pagination_meta;
+pub use self::model_org_group_pagination_meta::OrgGroupPaginationMeta;
+pub mod model_org_group_pagination_meta_page;
+pub use self::model_org_group_pagination_meta_page::OrgGroupPaginationMetaPage;
+pub mod model_org_group_membership_bulk_update_request;
+pub use self::model_org_group_membership_bulk_update_request::OrgGroupMembershipBulkUpdateRequest;
+pub mod model_org_group_membership_bulk_update_data;
+pub use self::model_org_group_membership_bulk_update_data::OrgGroupMembershipBulkUpdateData;
+pub mod model_org_group_membership_bulk_update_attributes;
+pub use self::model_org_group_membership_bulk_update_attributes::OrgGroupMembershipBulkUpdateAttributes;
+pub mod model_global_org_identifier;
+pub use self::model_global_org_identifier::GlobalOrgIdentifier;
+pub mod model_org_group_membership_bulk_update_relationships;
+pub use self::model_org_group_membership_bulk_update_relationships::OrgGroupMembershipBulkUpdateRelationships;
+pub mod model_org_group_membership_bulk_update_type;
+pub use self::model_org_group_membership_bulk_update_type::OrgGroupMembershipBulkUpdateType;
+pub mod model_org_group_membership_response;
+pub use self::model_org_group_membership_response::OrgGroupMembershipResponse;
+pub mod model_org_group_membership_update_request;
+pub use self::model_org_group_membership_update_request::OrgGroupMembershipUpdateRequest;
+pub mod model_org_group_membership_update_data;
+pub use self::model_org_group_membership_update_data::OrgGroupMembershipUpdateData;
+pub mod model_org_group_membership_update_relationships;
+pub use self::model_org_group_membership_update_relationships::OrgGroupMembershipUpdateRelationships;
+pub mod model_org_group_policy_sort_option;
+pub use self::model_org_group_policy_sort_option::OrgGroupPolicySortOption;
+pub mod model_org_group_policy_list_response;
+pub use self::model_org_group_policy_list_response::OrgGroupPolicyListResponse;
+pub mod model_org_group_policy_data;
+pub use self::model_org_group_policy_data::OrgGroupPolicyData;
+pub mod model_org_group_policy_attributes;
+pub use self::model_org_group_policy_attributes::OrgGroupPolicyAttributes;
+pub mod model_org_group_policy_relationships;
+pub use self::model_org_group_policy_relationships::OrgGroupPolicyRelationships;
+pub mod model_org_group_policy_type;
+pub use self::model_org_group_policy_type::OrgGroupPolicyType;
+pub mod model_org_group_policy_create_request;
+pub use self::model_org_group_policy_create_request::OrgGroupPolicyCreateRequest;
+pub mod model_org_group_policy_create_data;
+pub use self::model_org_group_policy_create_data::OrgGroupPolicyCreateData;
+pub mod model_org_group_policy_create_attributes;
+pub use self::model_org_group_policy_create_attributes::OrgGroupPolicyCreateAttributes;
+pub mod model_org_group_policy_create_relationships;
+pub use self::model_org_group_policy_create_relationships::OrgGroupPolicyCreateRelationships;
+pub mod model_org_group_policy_response;
+pub use self::model_org_group_policy_response::OrgGroupPolicyResponse;
+pub mod model_org_group_policy_update_request;
+pub use self::model_org_group_policy_update_request::OrgGroupPolicyUpdateRequest;
+pub mod model_org_group_policy_update_data;
+pub use self::model_org_group_policy_update_data::OrgGroupPolicyUpdateData;
+pub mod model_org_group_policy_update_attributes;
+pub use self::model_org_group_policy_update_attributes::OrgGroupPolicyUpdateAttributes;
+pub mod model_org_group_policy_config_list_response;
+pub use self::model_org_group_policy_config_list_response::OrgGroupPolicyConfigListResponse;
+pub mod model_org_group_policy_config_data;
+pub use self::model_org_group_policy_config_data::OrgGroupPolicyConfigData;
+pub mod model_org_group_policy_config_attributes;
+pub use self::model_org_group_policy_config_attributes::OrgGroupPolicyConfigAttributes;
+pub mod model_org_group_policy_config_type;
+pub use self::model_org_group_policy_config_type::OrgGroupPolicyConfigType;
+pub mod model_org_group_policy_override_sort_option;
+pub use self::model_org_group_policy_override_sort_option::OrgGroupPolicyOverrideSortOption;
+pub mod model_org_group_policy_override_list_response;
+pub use self::model_org_group_policy_override_list_response::OrgGroupPolicyOverrideListResponse;
+pub mod model_org_group_policy_override_data;
+pub use self::model_org_group_policy_override_data::OrgGroupPolicyOverrideData;
+pub mod model_org_group_policy_override_attributes;
+pub use self::model_org_group_policy_override_attributes::OrgGroupPolicyOverrideAttributes;
+pub mod model_org_group_policy_override_relationships;
+pub use self::model_org_group_policy_override_relationships::OrgGroupPolicyOverrideRelationships;
+pub mod model_org_group_policy_relationship_to_one;
+pub use self::model_org_group_policy_relationship_to_one::OrgGroupPolicyRelationshipToOne;
+pub mod model_org_group_policy_relationship_to_one_data;
+pub use self::model_org_group_policy_relationship_to_one_data::OrgGroupPolicyRelationshipToOneData;
+pub mod model_org_group_policy_override_type;
+pub use self::model_org_group_policy_override_type::OrgGroupPolicyOverrideType;
+pub mod model_org_group_policy_override_create_request;
+pub use self::model_org_group_policy_override_create_request::OrgGroupPolicyOverrideCreateRequest;
+pub mod model_org_group_policy_override_create_data;
+pub use self::model_org_group_policy_override_create_data::OrgGroupPolicyOverrideCreateData;
+pub mod model_org_group_policy_override_create_attributes;
+pub use self::model_org_group_policy_override_create_attributes::OrgGroupPolicyOverrideCreateAttributes;
+pub mod model_org_group_policy_override_create_relationships;
+pub use self::model_org_group_policy_override_create_relationships::OrgGroupPolicyOverrideCreateRelationships;
+pub mod model_org_group_policy_override_response;
+pub use self::model_org_group_policy_override_response::OrgGroupPolicyOverrideResponse;
+pub mod model_org_group_policy_override_update_request;
+pub use self::model_org_group_policy_override_update_request::OrgGroupPolicyOverrideUpdateRequest;
+pub mod model_org_group_policy_override_update_data;
+pub use self::model_org_group_policy_override_update_data::OrgGroupPolicyOverrideUpdateData;
+pub mod model_org_group_policy_override_update_attributes;
+pub use self::model_org_group_policy_override_update_attributes::OrgGroupPolicyOverrideUpdateAttributes;
+pub mod model_org_group_sort_option;
+pub use self::model_org_group_sort_option::OrgGroupSortOption;
+pub mod model_org_group_include_option;
+pub use self::model_org_group_include_option::OrgGroupIncludeOption;
+pub mod model_org_group_list_response;
+pub use self::model_org_group_list_response::OrgGroupListResponse;
+pub mod model_org_group_data;
+pub use self::model_org_group_data::OrgGroupData;
+pub mod model_org_group_attributes;
+pub use self::model_org_group_attributes::OrgGroupAttributes;
+pub mod model_org_group_relationships;
+pub use self::model_org_group_relationships::OrgGroupRelationships;
+pub mod model_org_group_memberships_relationship;
+pub use self::model_org_group_memberships_relationship::OrgGroupMembershipsRelationship;
+pub mod model_org_group_membership_relationship_data;
+pub use self::model_org_group_membership_relationship_data::OrgGroupMembershipRelationshipData;
+pub mod model_org_group_create_request;
+pub use self::model_org_group_create_request::OrgGroupCreateRequest;
+pub mod model_org_group_create_data;
+pub use self::model_org_group_create_data::OrgGroupCreateData;
+pub mod model_org_group_create_attributes;
+pub use self::model_org_group_create_attributes::OrgGroupCreateAttributes;
+pub mod model_org_group_response;
+pub use self::model_org_group_response::OrgGroupResponse;
+pub mod model_org_group_update_request;
+pub use self::model_org_group_update_request::OrgGroupUpdateRequest;
+pub mod model_org_group_update_data;
+pub use self::model_org_group_update_data::OrgGroupUpdateData;
+pub mod model_org_group_update_attributes;
+pub use self::model_org_group_update_attributes::OrgGroupUpdateAttributes;
pub mod model_permissions_response;
pub use self::model_permissions_response::PermissionsResponse;
pub mod model_permission;
diff --git a/src/datadogV2/model/model_global_org_identifier.rs b/src/datadogV2/model/model_global_org_identifier.rs
new file mode 100644
index 000000000..63b4f2629
--- /dev/null
+++ b/src/datadogV2/model/model_global_org_identifier.rs
@@ -0,0 +1,102 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// A unique identifier for an organization including its site.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct GlobalOrgIdentifier {
+ /// The site of the organization.
+ #[serde(rename = "org_site")]
+ pub org_site: String,
+ /// The UUID of the organization.
+ #[serde(rename = "org_uuid")]
+ pub org_uuid: uuid::Uuid,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl GlobalOrgIdentifier {
+ pub fn new(org_site: String, org_uuid: uuid::Uuid) -> GlobalOrgIdentifier {
+ GlobalOrgIdentifier {
+ org_site,
+ org_uuid,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for GlobalOrgIdentifier {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct GlobalOrgIdentifierVisitor;
+ impl<'a> Visitor<'a> for GlobalOrgIdentifierVisitor {
+ type Value = GlobalOrgIdentifier;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut org_site: Option = None;
+ let mut org_uuid: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "org_site" => {
+ org_site = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "org_uuid" => {
+ org_uuid = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let org_site = org_site.ok_or_else(|| M::Error::missing_field("org_site"))?;
+ let org_uuid = org_uuid.ok_or_else(|| M::Error::missing_field("org_uuid"))?;
+
+ let content = GlobalOrgIdentifier {
+ org_site,
+ org_uuid,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(GlobalOrgIdentifierVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_observability_pipeline_parse_grok_processor_rule.rs b/src/datadogV2/model/model_observability_pipeline_parse_grok_processor_rule.rs
index 4f9e9164f..4560ad802 100644
--- a/src/datadogV2/model/model_observability_pipeline_parse_grok_processor_rule.rs
+++ b/src/datadogV2/model/model_observability_pipeline_parse_grok_processor_rule.rs
@@ -17,7 +17,7 @@ pub struct ObservabilityPipelineParseGrokProcessorRule {
#[serde(rename = "match_rules")]
pub match_rules:
Vec,
- /// The value of the source field in log events to be processed by the Grok rules.
+ /// The name of the field in the log event to apply the Grok rules to.
#[serde(rename = "source")]
pub source: String,
/// A list of Grok helper rules that can be referenced by the parsing rules.
diff --git a/src/datadogV2/model/model_org_group_attributes.rs b/src/datadogV2/model/model_org_group_attributes.rs
new file mode 100644
index 000000000..b4ba66558
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_attributes.rs
@@ -0,0 +1,144 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Attributes of an org group.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupAttributes {
+ /// Timestamp when the org group was created.
+ #[serde(rename = "created_at")]
+ pub created_at: chrono::DateTime,
+ /// Timestamp when the org group was last modified.
+ #[serde(rename = "modified_at")]
+ pub modified_at: chrono::DateTime,
+ /// The name of the org group.
+ #[serde(rename = "name")]
+ pub name: String,
+ /// The site of the organization that owns this org group.
+ #[serde(rename = "owner_org_site")]
+ pub owner_org_site: String,
+ /// The UUID of the organization that owns this org group.
+ #[serde(rename = "owner_org_uuid")]
+ pub owner_org_uuid: uuid::Uuid,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupAttributes {
+ pub fn new(
+ created_at: chrono::DateTime,
+ modified_at: chrono::DateTime,
+ name: String,
+ owner_org_site: String,
+ owner_org_uuid: uuid::Uuid,
+ ) -> OrgGroupAttributes {
+ OrgGroupAttributes {
+ created_at,
+ modified_at,
+ name,
+ owner_org_site,
+ owner_org_uuid,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupAttributes {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupAttributesVisitor;
+ impl<'a> Visitor<'a> for OrgGroupAttributesVisitor {
+ type Value = OrgGroupAttributes;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut created_at: Option> = None;
+ let mut modified_at: Option> = None;
+ let mut name: Option = None;
+ let mut owner_org_site: Option = None;
+ let mut owner_org_uuid: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "created_at" => {
+ created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "modified_at" => {
+ modified_at =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "name" => {
+ name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "owner_org_site" => {
+ owner_org_site =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "owner_org_uuid" => {
+ owner_org_uuid =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?;
+ let modified_at =
+ modified_at.ok_or_else(|| M::Error::missing_field("modified_at"))?;
+ let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
+ let owner_org_site =
+ owner_org_site.ok_or_else(|| M::Error::missing_field("owner_org_site"))?;
+ let owner_org_uuid =
+ owner_org_uuid.ok_or_else(|| M::Error::missing_field("owner_org_uuid"))?;
+
+ let content = OrgGroupAttributes {
+ created_at,
+ modified_at,
+ name,
+ owner_org_site,
+ owner_org_uuid,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupAttributesVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_create_attributes.rs b/src/datadogV2/model/model_org_group_create_attributes.rs
new file mode 100644
index 000000000..53e0c0efd
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_create_attributes.rs
@@ -0,0 +1,92 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Attributes for creating an org group.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupCreateAttributes {
+ /// The name of the org group.
+ #[serde(rename = "name")]
+ pub name: String,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupCreateAttributes {
+ pub fn new(name: String) -> OrgGroupCreateAttributes {
+ OrgGroupCreateAttributes {
+ name,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupCreateAttributes {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupCreateAttributesVisitor;
+ impl<'a> Visitor<'a> for OrgGroupCreateAttributesVisitor {
+ type Value = OrgGroupCreateAttributes;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut name: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "name" => {
+ name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
+
+ let content = OrgGroupCreateAttributes {
+ name,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupCreateAttributesVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_create_data.rs b/src/datadogV2/model/model_org_group_create_data.rs
new file mode 100644
index 000000000..6621976c9
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_create_data.rs
@@ -0,0 +1,116 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Data for creating an org group.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupCreateData {
+ /// Attributes for creating an org group.
+ #[serde(rename = "attributes")]
+ pub attributes: crate::datadogV2::model::OrgGroupCreateAttributes,
+ /// Org groups resource type.
+ #[serde(rename = "type")]
+ pub type_: crate::datadogV2::model::OrgGroupType,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupCreateData {
+ pub fn new(
+ attributes: crate::datadogV2::model::OrgGroupCreateAttributes,
+ type_: crate::datadogV2::model::OrgGroupType,
+ ) -> OrgGroupCreateData {
+ OrgGroupCreateData {
+ attributes,
+ type_,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupCreateData {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupCreateDataVisitor;
+ impl<'a> Visitor<'a> for OrgGroupCreateDataVisitor {
+ type Value = OrgGroupCreateData;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut attributes: Option =
+ None;
+ let mut type_: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "attributes" => {
+ attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "type" => {
+ type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _type_) = type_ {
+ match _type_ {
+ crate::datadogV2::model::OrgGroupType::UnparsedObject(
+ _type_,
+ ) => {
+ _unparsed = true;
+ }
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?;
+ let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
+
+ let content = OrgGroupCreateData {
+ attributes,
+ type_,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupCreateDataVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_create_request.rs b/src/datadogV2/model/model_org_group_create_request.rs
new file mode 100644
index 000000000..fe6cc9bc3
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_create_request.rs
@@ -0,0 +1,92 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Request to create an org group.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupCreateRequest {
+ /// Data for creating an org group.
+ #[serde(rename = "data")]
+ pub data: crate::datadogV2::model::OrgGroupCreateData,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupCreateRequest {
+ pub fn new(data: crate::datadogV2::model::OrgGroupCreateData) -> OrgGroupCreateRequest {
+ OrgGroupCreateRequest {
+ data,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupCreateRequest {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupCreateRequestVisitor;
+ impl<'a> Visitor<'a> for OrgGroupCreateRequestVisitor {
+ type Value = OrgGroupCreateRequest;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
+
+ let content = OrgGroupCreateRequest {
+ data,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupCreateRequestVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_data.rs b/src/datadogV2/model/model_org_group_data.rs
new file mode 100644
index 000000000..fe94ef125
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_data.rs
@@ -0,0 +1,145 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// An org group resource.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupData {
+ /// Attributes of an org group.
+ #[serde(rename = "attributes")]
+ pub attributes: crate::datadogV2::model::OrgGroupAttributes,
+ /// The ID of the org group.
+ #[serde(rename = "id")]
+ pub id: uuid::Uuid,
+ /// Relationships of an org group.
+ #[serde(rename = "relationships")]
+ pub relationships: Option,
+ /// Org groups resource type.
+ #[serde(rename = "type")]
+ pub type_: crate::datadogV2::model::OrgGroupType,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupData {
+ pub fn new(
+ attributes: crate::datadogV2::model::OrgGroupAttributes,
+ id: uuid::Uuid,
+ type_: crate::datadogV2::model::OrgGroupType,
+ ) -> OrgGroupData {
+ OrgGroupData {
+ attributes,
+ id,
+ relationships: None,
+ type_,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn relationships(mut self, value: crate::datadogV2::model::OrgGroupRelationships) -> Self {
+ self.relationships = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupData {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupDataVisitor;
+ impl<'a> Visitor<'a> for OrgGroupDataVisitor {
+ type Value = OrgGroupData;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut attributes: Option = None;
+ let mut id: Option = None;
+ let mut relationships: Option =
+ None;
+ let mut type_: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "attributes" => {
+ attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "id" => {
+ id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "relationships" => {
+ if v.is_null() {
+ continue;
+ }
+ relationships =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "type" => {
+ type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _type_) = type_ {
+ match _type_ {
+ crate::datadogV2::model::OrgGroupType::UnparsedObject(
+ _type_,
+ ) => {
+ _unparsed = true;
+ }
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?;
+ let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
+ let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
+
+ let content = OrgGroupData {
+ attributes,
+ id,
+ relationships,
+ type_,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupDataVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_include_option.rs b/src/datadogV2/model/model_org_group_include_option.rs
new file mode 100644
index 000000000..7f49ae401
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_include_option.rs
@@ -0,0 +1,48 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+
+#[non_exhaustive]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum OrgGroupIncludeOption {
+ MEMBERSHIPS,
+ UnparsedObject(crate::datadog::UnparsedObject),
+}
+
+impl ToString for OrgGroupIncludeOption {
+ fn to_string(&self) -> String {
+ match self {
+ Self::MEMBERSHIPS => String::from("memberships"),
+ Self::UnparsedObject(v) => v.value.to_string(),
+ }
+ }
+}
+
+impl Serialize for OrgGroupIncludeOption {
+ fn serialize(&self, serializer: S) -> Result
+ where
+ S: Serializer,
+ {
+ match self {
+ Self::UnparsedObject(v) => v.serialize(serializer),
+ _ => serializer.serialize_str(self.to_string().as_str()),
+ }
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupIncludeOption {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ let s: String = String::deserialize(deserializer)?;
+ Ok(match s.as_str() {
+ "memberships" => Self::MEMBERSHIPS,
+ _ => Self::UnparsedObject(crate::datadog::UnparsedObject {
+ value: serde_json::Value::String(s.into()),
+ }),
+ })
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_list_response.rs b/src/datadogV2/model/model_org_group_list_response.rs
new file mode 100644
index 000000000..d28e24592
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_list_response.rs
@@ -0,0 +1,127 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Response containing a list of org groups.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupListResponse {
+ /// An array of org groups.
+ #[serde(rename = "data")]
+ pub data: Vec,
+ /// Related resources included in the response when requested with the `include` parameter.
+ #[serde(rename = "included")]
+ pub included: Option>,
+ /// Pagination metadata.
+ #[serde(rename = "meta")]
+ pub meta: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupListResponse {
+ pub fn new(data: Vec) -> OrgGroupListResponse {
+ OrgGroupListResponse {
+ data,
+ included: None,
+ meta: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn included(mut self, value: Vec) -> Self {
+ self.included = Some(value);
+ self
+ }
+
+ pub fn meta(mut self, value: crate::datadogV2::model::OrgGroupPaginationMeta) -> Self {
+ self.meta = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupListResponse {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupListResponseVisitor;
+ impl<'a> Visitor<'a> for OrgGroupListResponseVisitor {
+ type Value = OrgGroupListResponse;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option> = None;
+ let mut included: Option> =
+ None;
+ let mut meta: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "included" => {
+ if v.is_null() {
+ continue;
+ }
+ included = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "meta" => {
+ if v.is_null() {
+ continue;
+ }
+ meta = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
+
+ let content = OrgGroupListResponse {
+ data,
+ included,
+ meta,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupListResponseVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_attributes.rs b/src/datadogV2/model/model_org_group_membership_attributes.rs
new file mode 100644
index 000000000..60140b64c
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_attributes.rs
@@ -0,0 +1,140 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Attributes of an org group membership.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipAttributes {
+ /// Timestamp when the membership was created.
+ #[serde(rename = "created_at")]
+ pub created_at: chrono::DateTime,
+ /// Timestamp when the membership was last modified.
+ #[serde(rename = "modified_at")]
+ pub modified_at: chrono::DateTime,
+ /// The name of the member organization.
+ #[serde(rename = "org_name")]
+ pub org_name: String,
+ /// The site of the member organization.
+ #[serde(rename = "org_site")]
+ pub org_site: String,
+ /// The UUID of the member organization.
+ #[serde(rename = "org_uuid")]
+ pub org_uuid: uuid::Uuid,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipAttributes {
+ pub fn new(
+ created_at: chrono::DateTime,
+ modified_at: chrono::DateTime,
+ org_name: String,
+ org_site: String,
+ org_uuid: uuid::Uuid,
+ ) -> OrgGroupMembershipAttributes {
+ OrgGroupMembershipAttributes {
+ created_at,
+ modified_at,
+ org_name,
+ org_site,
+ org_uuid,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipAttributes {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipAttributesVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipAttributesVisitor {
+ type Value = OrgGroupMembershipAttributes;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut created_at: Option> = None;
+ let mut modified_at: Option> = None;
+ let mut org_name: Option = None;
+ let mut org_site: Option = None;
+ let mut org_uuid: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "created_at" => {
+ created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "modified_at" => {
+ modified_at =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "org_name" => {
+ org_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "org_site" => {
+ org_site = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "org_uuid" => {
+ org_uuid = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?;
+ let modified_at =
+ modified_at.ok_or_else(|| M::Error::missing_field("modified_at"))?;
+ let org_name = org_name.ok_or_else(|| M::Error::missing_field("org_name"))?;
+ let org_site = org_site.ok_or_else(|| M::Error::missing_field("org_site"))?;
+ let org_uuid = org_uuid.ok_or_else(|| M::Error::missing_field("org_uuid"))?;
+
+ let content = OrgGroupMembershipAttributes {
+ created_at,
+ modified_at,
+ org_name,
+ org_site,
+ org_uuid,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipAttributesVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_bulk_update_attributes.rs b/src/datadogV2/model/model_org_group_membership_bulk_update_attributes.rs
new file mode 100644
index 000000000..5340c77c2
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_bulk_update_attributes.rs
@@ -0,0 +1,94 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Attributes for bulk updating org group memberships.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipBulkUpdateAttributes {
+ /// List of organizations to move. Maximum 100 per request.
+ #[serde(rename = "orgs")]
+ pub orgs: Vec,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipBulkUpdateAttributes {
+ pub fn new(
+ orgs: Vec,
+ ) -> OrgGroupMembershipBulkUpdateAttributes {
+ OrgGroupMembershipBulkUpdateAttributes {
+ orgs,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipBulkUpdateAttributes {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipBulkUpdateAttributesVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipBulkUpdateAttributesVisitor {
+ type Value = OrgGroupMembershipBulkUpdateAttributes;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut orgs: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "orgs" => {
+ orgs = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let orgs = orgs.ok_or_else(|| M::Error::missing_field("orgs"))?;
+
+ let content = OrgGroupMembershipBulkUpdateAttributes {
+ orgs,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipBulkUpdateAttributesVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_bulk_update_data.rs b/src/datadogV2/model/model_org_group_membership_bulk_update_data.rs
new file mode 100644
index 000000000..7609a965b
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_bulk_update_data.rs
@@ -0,0 +1,131 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Data for bulk updating org group memberships.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipBulkUpdateData {
+ /// Attributes for bulk updating org group memberships.
+ #[serde(rename = "attributes")]
+ pub attributes: crate::datadogV2::model::OrgGroupMembershipBulkUpdateAttributes,
+ /// Relationships for bulk updating memberships.
+ #[serde(rename = "relationships")]
+ pub relationships: crate::datadogV2::model::OrgGroupMembershipBulkUpdateRelationships,
+ /// Org group membership bulk update resource type.
+ #[serde(rename = "type")]
+ pub type_: crate::datadogV2::model::OrgGroupMembershipBulkUpdateType,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipBulkUpdateData {
+ pub fn new(
+ attributes: crate::datadogV2::model::OrgGroupMembershipBulkUpdateAttributes,
+ relationships: crate::datadogV2::model::OrgGroupMembershipBulkUpdateRelationships,
+ type_: crate::datadogV2::model::OrgGroupMembershipBulkUpdateType,
+ ) -> OrgGroupMembershipBulkUpdateData {
+ OrgGroupMembershipBulkUpdateData {
+ attributes,
+ relationships,
+ type_,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipBulkUpdateData {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipBulkUpdateDataVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipBulkUpdateDataVisitor {
+ type Value = OrgGroupMembershipBulkUpdateData;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut attributes: Option<
+ crate::datadogV2::model::OrgGroupMembershipBulkUpdateAttributes,
+ > = None;
+ let mut relationships: Option<
+ crate::datadogV2::model::OrgGroupMembershipBulkUpdateRelationships,
+ > = None;
+ let mut type_: Option =
+ None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "attributes" => {
+ attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "relationships" => {
+ relationships =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "type" => {
+ type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _type_) = type_ {
+ match _type_ {
+ crate::datadogV2::model::OrgGroupMembershipBulkUpdateType::UnparsedObject(_type_) => {
+ _unparsed = true;
+ },
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?;
+ let relationships =
+ relationships.ok_or_else(|| M::Error::missing_field("relationships"))?;
+ let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
+
+ let content = OrgGroupMembershipBulkUpdateData {
+ attributes,
+ relationships,
+ type_,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipBulkUpdateDataVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_bulk_update_relationships.rs b/src/datadogV2/model/model_org_group_membership_bulk_update_relationships.rs
new file mode 100644
index 000000000..e8e6f1476
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_bulk_update_relationships.rs
@@ -0,0 +1,113 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Relationships for bulk updating memberships.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipBulkUpdateRelationships {
+ /// Relationship to a single org group.
+ #[serde(rename = "source_org_group")]
+ pub source_org_group: crate::datadogV2::model::OrgGroupRelationshipToOne,
+ /// Relationship to a single org group.
+ #[serde(rename = "target_org_group")]
+ pub target_org_group: crate::datadogV2::model::OrgGroupRelationshipToOne,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipBulkUpdateRelationships {
+ pub fn new(
+ source_org_group: crate::datadogV2::model::OrgGroupRelationshipToOne,
+ target_org_group: crate::datadogV2::model::OrgGroupRelationshipToOne,
+ ) -> OrgGroupMembershipBulkUpdateRelationships {
+ OrgGroupMembershipBulkUpdateRelationships {
+ source_org_group,
+ target_org_group,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipBulkUpdateRelationships {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipBulkUpdateRelationshipsVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipBulkUpdateRelationshipsVisitor {
+ type Value = OrgGroupMembershipBulkUpdateRelationships;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut source_org_group: Option<
+ crate::datadogV2::model::OrgGroupRelationshipToOne,
+ > = None;
+ let mut target_org_group: Option<
+ crate::datadogV2::model::OrgGroupRelationshipToOne,
+ > = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "source_org_group" => {
+ source_org_group =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "target_org_group" => {
+ target_org_group =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let source_org_group =
+ source_org_group.ok_or_else(|| M::Error::missing_field("source_org_group"))?;
+ let target_org_group =
+ target_org_group.ok_or_else(|| M::Error::missing_field("target_org_group"))?;
+
+ let content = OrgGroupMembershipBulkUpdateRelationships {
+ source_org_group,
+ target_org_group,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipBulkUpdateRelationshipsVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_bulk_update_request.rs b/src/datadogV2/model/model_org_group_membership_bulk_update_request.rs
new file mode 100644
index 000000000..aa3ba8a5f
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_bulk_update_request.rs
@@ -0,0 +1,95 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Request to bulk update org group memberships.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipBulkUpdateRequest {
+ /// Data for bulk updating org group memberships.
+ #[serde(rename = "data")]
+ pub data: crate::datadogV2::model::OrgGroupMembershipBulkUpdateData,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipBulkUpdateRequest {
+ pub fn new(
+ data: crate::datadogV2::model::OrgGroupMembershipBulkUpdateData,
+ ) -> OrgGroupMembershipBulkUpdateRequest {
+ OrgGroupMembershipBulkUpdateRequest {
+ data,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipBulkUpdateRequest {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipBulkUpdateRequestVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipBulkUpdateRequestVisitor {
+ type Value = OrgGroupMembershipBulkUpdateRequest;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option =
+ None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
+
+ let content = OrgGroupMembershipBulkUpdateRequest {
+ data,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipBulkUpdateRequestVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_bulk_update_type.rs b/src/datadogV2/model/model_org_group_membership_bulk_update_type.rs
new file mode 100644
index 000000000..7b2a0b9b7
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_bulk_update_type.rs
@@ -0,0 +1,50 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+
+#[non_exhaustive]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum OrgGroupMembershipBulkUpdateType {
+ ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
+ UnparsedObject(crate::datadog::UnparsedObject),
+}
+
+impl ToString for OrgGroupMembershipBulkUpdateType {
+ fn to_string(&self) -> String {
+ match self {
+ Self::ORG_GROUP_MEMBERSHIP_BULK_UPDATES => {
+ String::from("org_group_membership_bulk_updates")
+ }
+ Self::UnparsedObject(v) => v.value.to_string(),
+ }
+ }
+}
+
+impl Serialize for OrgGroupMembershipBulkUpdateType {
+ fn serialize(&self, serializer: S) -> Result
+ where
+ S: Serializer,
+ {
+ match self {
+ Self::UnparsedObject(v) => v.serialize(serializer),
+ _ => serializer.serialize_str(self.to_string().as_str()),
+ }
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipBulkUpdateType {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ let s: String = String::deserialize(deserializer)?;
+ Ok(match s.as_str() {
+ "org_group_membership_bulk_updates" => Self::ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
+ _ => Self::UnparsedObject(crate::datadog::UnparsedObject {
+ value: serde_json::Value::String(s.into()),
+ }),
+ })
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_data.rs b/src/datadogV2/model/model_org_group_membership_data.rs
new file mode 100644
index 000000000..b51dea978
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_data.rs
@@ -0,0 +1,148 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// An org group membership resource.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipData {
+ /// Attributes of an org group membership.
+ #[serde(rename = "attributes")]
+ pub attributes: crate::datadogV2::model::OrgGroupMembershipAttributes,
+ /// The ID of the org group membership.
+ #[serde(rename = "id")]
+ pub id: uuid::Uuid,
+ /// Relationships of an org group membership.
+ #[serde(rename = "relationships")]
+ pub relationships: Option,
+ /// Org group memberships resource type.
+ #[serde(rename = "type")]
+ pub type_: crate::datadogV2::model::OrgGroupMembershipType,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl OrgGroupMembershipData {
+ pub fn new(
+ attributes: crate::datadogV2::model::OrgGroupMembershipAttributes,
+ id: uuid::Uuid,
+ type_: crate::datadogV2::model::OrgGroupMembershipType,
+ ) -> OrgGroupMembershipData {
+ OrgGroupMembershipData {
+ attributes,
+ id,
+ relationships: None,
+ type_,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn relationships(
+ mut self,
+ value: crate::datadogV2::model::OrgGroupMembershipRelationships,
+ ) -> Self {
+ self.relationships = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for OrgGroupMembershipData {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct OrgGroupMembershipDataVisitor;
+ impl<'a> Visitor<'a> for OrgGroupMembershipDataVisitor {
+ type Value = OrgGroupMembershipData;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut attributes: Option =
+ None;
+ let mut id: Option = None;
+ let mut relationships: Option<
+ crate::datadogV2::model::OrgGroupMembershipRelationships,
+ > = None;
+ let mut type_: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "attributes" => {
+ attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "id" => {
+ id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "relationships" => {
+ if v.is_null() {
+ continue;
+ }
+ relationships =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "type" => {
+ type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _type_) = type_ {
+ match _type_ {
+ crate::datadogV2::model::OrgGroupMembershipType::UnparsedObject(_type_) => {
+ _unparsed = true;
+ },
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?;
+ let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
+ let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
+
+ let content = OrgGroupMembershipData {
+ attributes,
+ id,
+ relationships,
+ type_,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(OrgGroupMembershipDataVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_org_group_membership_list_response.rs b/src/datadogV2/model/model_org_group_membership_list_response.rs
new file mode 100644
index 000000000..ed121c5ab
--- /dev/null
+++ b/src/datadogV2/model/model_org_group_membership_list_response.rs
@@ -0,0 +1,111 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Response containing a list of org group memberships.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct OrgGroupMembershipListResponse {
+ /// An array of org group memberships.
+ #[serde(rename = "data")]
+ pub data: Vec