Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
356 changes: 288 additions & 68 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18253,6 +18253,48 @@ datadog\_api\_client.v2.model.maintenance\_data\_relationships\_status\_page\_da
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_data module
--------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_relationship\_to\_org module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_relationship_to_org
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_relationship\_to\_orgs module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_relationship_to_orgs
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_relationships module
-----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_relationships
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_response module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.managed\_orgs\_type module
--------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.managed_orgs_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.member\_team module
-------------------------------------------------

Expand Down Expand Up @@ -22292,6 +22334,13 @@ datadog\_api\_client.v2.model.order\_direction module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_attributes module
----------------------------------------------------

.. automodule:: datadog_api_client.v2.model.org_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_config\_get\_response module
---------------------------------------------------------------

Expand Down Expand Up @@ -22502,6 +22551,13 @@ datadog\_api\_client.v2.model.org\_connection\_user\_relationship\_data\_type mo
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_data module
----------------------------------------------

.. automodule:: datadog_api_client.v2.model.org_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_group\_attributes module
-----------------------------------------------------------

Expand Down Expand Up @@ -22985,6 +23041,20 @@ datadog\_api\_client.v2.model.org\_group\_update\_request module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_relationship\_data module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.org_relationship_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.org\_resource\_type module
--------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.org_resource_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.organization module
-------------------------------------------------

Expand Down
13 changes: 13 additions & 0 deletions examples/v2/organizations/ListOrgs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
List your managed organizations returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.organizations_api import OrganizationsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = OrganizationsApi(api_client)
response = api_instance.list_orgs()

print(response)
14 changes: 14 additions & 0 deletions examples/v2/users/DeleteUserInvitations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Delete a pending user's invitations returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.users_api import UsersApi
from uuid import UUID

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = UsersApi(api_client)
api_instance.delete_user_invitations(
user_id=UUID("4dee724d-00cc-11ea-a77b-570c9d03c6c5"),
)
42 changes: 42 additions & 0 deletions src/datadog_api_client/v2/api/organizations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
UnsetType,
unset,
)
from datadog_api_client.v2.model.managed_orgs_response import ManagedOrgsResponse
from datadog_api_client.v2.model.org_config_list_response import OrgConfigListResponse
from datadog_api_client.v2.model.org_config_get_response import OrgConfigGetResponse
from datadog_api_client.v2.model.org_config_write_request import OrgConfigWriteRequest
Expand Down Expand Up @@ -66,6 +67,28 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._list_orgs_endpoint = _Endpoint(
settings={
"response_type": (ManagedOrgsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/org",
"operation_id": "list_orgs",
"http_method": "GET",
"version": "v2",
},
params_map={
"filter_name": {
"openapi_types": (str,),
"attribute": "filter[name]",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._update_org_config_endpoint = _Endpoint(
settings={
"response_type": (OrgConfigGetResponse,),
Expand Down Expand Up @@ -141,6 +164,25 @@ def list_org_configs(
kwargs: Dict[str, Any] = {}
return self._list_org_configs_endpoint.call_with_http_info(**kwargs)

def list_orgs(
self,
*,
filter_name: Union[str, UnsetType] = unset,
) -> ManagedOrgsResponse:
"""List your managed organizations.

Returns the current organization and its managed organizations in JSON:API format.

:param filter_name: Filter managed organizations by name.
:type filter_name: str, optional
:rtype: ManagedOrgsResponse
"""
kwargs: Dict[str, Any] = {}
if filter_name is not unset:
kwargs["filter_name"] = filter_name

return self._list_orgs_endpoint.call_with_http_info(**kwargs)

def update_org_config(
self,
org_config_name: str,
Expand Down
19 changes: 10 additions & 9 deletions src/datadog_api_client/v2/api/security_monitoring_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __init__(self, api_client=None):
self._activate_content_pack_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/security_monitoring/content_packs/{content_pack_id}/activate",
"operation_id": "activate_content_pack",
"http_method": "PUT",
Expand Down Expand Up @@ -659,7 +659,7 @@ def __init__(self, api_client=None):
self._deactivate_content_pack_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate",
"operation_id": "deactivate_content_pack",
"http_method": "PUT",
Expand Down Expand Up @@ -1025,7 +1025,7 @@ def __init__(self, api_client=None):
self._get_content_packs_states_endpoint = _Endpoint(
settings={
"response_type": (SecurityMonitoringContentPackStatesResponse,),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/security_monitoring/content_packs/states",
"operation_id": "get_content_packs_states",
"http_method": "GET",
Expand Down Expand Up @@ -2993,11 +2993,11 @@ def activate_content_pack(
) -> None:
"""Activate content pack.

Activate a Cloud SIEM content pack. This operation configures the necessary
Activate a security monitoring content pack. This operation configures the necessary
log filters or security filters depending on the pricing model and updates the content
pack activation state.

:param content_pack_id: The ID of the content pack to activate (for example, ``aws-cloudtrail`` ).
:param content_pack_id: The ID of the content pack to activate.
:type content_pack_id: str
:rtype: None
"""
Expand Down Expand Up @@ -3417,10 +3417,10 @@ def deactivate_content_pack(
) -> None:
"""Deactivate content pack.

Deactivate a Cloud SIEM content pack. This operation removes the content pack's
Deactivate a security monitoring content pack. This operation removes the content pack's
configuration from log filters or security filters and updates the content pack activation state.

:param content_pack_id: The ID of the content pack to deactivate (for example, ``aws-cloudtrail`` ).
:param content_pack_id: The ID of the content pack to deactivate.
:type content_pack_id: str
:rtype: None
"""
Expand Down Expand Up @@ -3704,8 +3704,9 @@ def get_content_packs_states(
) -> SecurityMonitoringContentPackStatesResponse:
"""Get content pack states.

Get the activation state, integration status, and log collection status
for all Cloud SIEM content packs.
Get the activation and configuration states for all security monitoring content packs.
This endpoint returns status information about each content pack including activation state,
integration status, and log collection status.

:rtype: SecurityMonitoringContentPackStatesResponse
"""
Expand Down
42 changes: 42 additions & 0 deletions src/datadog_api_client/v2/api/users_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
get_attribute_from_path,
UnsetType,
unset,
UUID,
)
from datadog_api_client.v2.model.user_invitations_response import UserInvitationsResponse
from datadog_api_client.v2.model.user_invitations_request import UserInvitationsRequest
Expand Down Expand Up @@ -56,6 +57,29 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._delete_user_invitations_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/users/{user_id}/invitations",
"operation_id": "delete_user_invitations",
"http_method": "DELETE",
"version": "v2",
},
params_map={
"user_id": {
"required": True,
"openapi_types": (UUID,),
"attribute": "user_id",
"location": "path",
},
},
headers_map={
"accept": ["*/*"],
},
api_client=api_client,
)

self._disable_user_endpoint = _Endpoint(
settings={
"response_type": None,
Expand Down Expand Up @@ -280,6 +304,24 @@ def create_user(

return self._create_user_endpoint.call_with_http_info(**kwargs)

def delete_user_invitations(
self,
user_id: UUID,
) -> None:
"""Delete a pending user's invitations.

Cancel all pending invitations for a specified user.
Requires the ``user_access_invite`` permission.

:param user_id: The UUID of the user whose pending invitations should be canceled.
:type user_id: UUID
:rtype: None
"""
kwargs: Dict[str, Any] = {}
kwargs["user_id"] = user_id

return self._delete_user_invitations_endpoint.call_with_http_info(**kwargs)

def disable_user(
self,
user_id: str,
Expand Down
55 changes: 55 additions & 0 deletions src/datadog_api_client/v2/model/managed_orgs_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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.
from __future__ import annotations

from typing import TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
UUID,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.managed_orgs_relationships import ManagedOrgsRelationships
from datadog_api_client.v2.model.managed_orgs_type import ManagedOrgsType


class ManagedOrgsData(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.managed_orgs_relationships import ManagedOrgsRelationships
from datadog_api_client.v2.model.managed_orgs_type import ManagedOrgsType

return {
"id": (UUID,),
"relationships": (ManagedOrgsRelationships,),
"type": (ManagedOrgsType,),
}

attribute_map = {
"id": "id",
"relationships": "relationships",
"type": "type",
}

def __init__(self_, id: UUID, relationships: ManagedOrgsRelationships, type: ManagedOrgsType, **kwargs):
"""
The managed organizations resource.

:param id: The UUID of the current organization.
:type id: UUID

:param relationships: Relationships of the managed organizations resource.
:type relationships: ManagedOrgsRelationships

:param type: The resource type for managed organizations.
:type type: ManagedOrgsType
"""
super().__init__(kwargs)

self_.id = id
self_.relationships = relationships
self_.type = type
Loading
Loading