Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1495a05
docs: Documentation for Java SDK (box/box-codegen#664)
box-sdk-build Feb 21, 2025
0806a40
docs: remove beta tag for AI extract endpoints (box/box-openapi#511)
box-sdk-build Feb 21, 2025
5305463
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Feb 21, 2025
3fa0476
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Feb 24, 2025
680206c
test: reorder function calls to fix test samples (box/box-codegen#666)
box-sdk-build Feb 24, 2025
e5f7815
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Feb 26, 2025
7a74063
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Feb 26, 2025
764e56f
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 3, 2025
7a75895
Auto resolve conflict by keeping our changes
Mar 4, 2025
c211acf
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 5, 2025
ef54025
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 6, 2025
48a9e51
Auto resolve conflict by keeping our changes
Mar 7, 2025
dd91b1d
test: Remove notification_email test because of business logic has ch…
box-sdk-build Mar 10, 2025
6e45783
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 10, 2025
1d83fae
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 11, 2025
2394b11
feat: add find app item for shared link endpoint (box/box-openapi#514)
box-sdk-build Mar 12, 2025
779811b
fix: add verification_phone_number property to create sign request (b…
box-sdk-build Mar 12, 2025
adfa47c
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Mar 12, 2025
cbd5819
feat: add Integration Mappings Teams API (box/box-openapi#517)
box-sdk-build Mar 12, 2025
9977c24
Auto resolve conflict by keeping our changes
Mar 12, 2025
e2c92f5
test: Support ITests for Shared Link for App Items (box/box-codegen#673)
box-sdk-build Mar 12, 2025
448d722
Auto resolve conflict by keeping our changes
Mar 13, 2025
f5b58a9
Auto resolve conflict by keeping our changes
Mar 13, 2025
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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "41feeaa", "specHash": "1080bb4", "version": "1.12.0" }
{ "engineHash": "be67a6e", "specHash": "c303afc", "version": "1.12.0" }
213 changes: 213 additions & 0 deletions box_sdk_gen/managers/integration_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
IntegrationMappingPartnerItemSlack,
)

from box_sdk_gen.schemas.integration_mapping_partner_item_teams_create_request import (
IntegrationMappingPartnerItemTeamsCreateRequest,
)

from box_sdk_gen.schemas.integration_mappings import IntegrationMappings

from box_sdk_gen.schemas.client_error import ClientError
Expand All @@ -34,6 +38,16 @@
IntegrationMappingSlackOptions,
)

from box_sdk_gen.schemas.integration_mappings_teams import IntegrationMappingsTeams

from box_sdk_gen.schemas.integration_mapping_teams import IntegrationMappingTeams

from box_sdk_gen.schemas.integration_mapping_teams_create_request import (
IntegrationMappingTeamsCreateRequest,
)

from box_sdk_gen.schemas.folder_reference import FolderReference

from box_sdk_gen.box.errors import BoxSDKError

from box_sdk_gen.networking.auth import Authentication
Expand Down Expand Up @@ -63,6 +77,15 @@ class GetSlackIntegrationMappingBoxItemType(str, Enum):
FOLDER = 'folder'


class GetIntegrationMappingTeamsPartnerItemType(str, Enum):
CHANNEL = 'channel'
TEAM = 'team'


class GetIntegrationMappingTeamsBoxItemType(str, Enum):
FOLDER = 'folder'


class IntegrationMappingsManager:
def __init__(
self,
Expand Down Expand Up @@ -285,3 +308,193 @@ def delete_slack_integration_mapping_by_id(
)
)
return None

def get_integration_mapping_teams(
self,
*,
partner_item_type: Optional[GetIntegrationMappingTeamsPartnerItemType] = None,
partner_item_id: Optional[str] = None,
box_item_id: Optional[str] = None,
box_item_type: Optional[GetIntegrationMappingTeamsBoxItemType] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> IntegrationMappingsTeams:
"""
Lists [Teams integration mappings](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams) in a users' enterprise.

You need Admin or Co-Admin role to


use this endpoint.

:param partner_item_type: Mapped item type, for which the mapping should be returned, defaults to None
:type partner_item_type: Optional[GetIntegrationMappingTeamsPartnerItemType], optional
:param partner_item_id: ID of the mapped item, for which the mapping should be returned, defaults to None
:type partner_item_id: Optional[str], optional
:param box_item_id: Box item ID, for which the mappings should be returned, defaults to None
:type box_item_id: Optional[str], optional
:param box_item_type: Box item type, for which the mappings should be returned, defaults to None
:type box_item_type: Optional[GetIntegrationMappingTeamsBoxItemType], optional
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
if extra_headers is None:
extra_headers = {}
query_params_map: Dict[str, str] = prepare_params(
{
'partner_item_type': to_string(partner_item_type),
'partner_item_id': to_string(partner_item_id),
'box_item_id': to_string(box_item_id),
'box_item_type': to_string(box_item_type),
}
)
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
FetchOptions(
url=''.join(
[
self.network_session.base_urls.base_url,
'/2.0/integration_mappings/teams',
]
),
method='GET',
params=query_params_map,
headers=headers_map,
response_format=ResponseFormat.JSON,
auth=self.auth,
network_session=self.network_session,
)
)
return deserialize(response.data, IntegrationMappingsTeams)

def create_integration_mapping_teams(
self,
partner_item: IntegrationMappingPartnerItemTeamsCreateRequest,
box_item: FolderReference,
*,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> IntegrationMappingTeams:
"""
Creates a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams)

by mapping a Teams channel to a Box item.


You need Admin or Co-Admin role to


use this endpoint.

:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
if extra_headers is None:
extra_headers = {}
request_body: Dict = {'partner_item': partner_item, 'box_item': box_item}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
FetchOptions(
url=''.join(
[
self.network_session.base_urls.base_url,
'/2.0/integration_mappings/teams',
]
),
method='POST',
headers=headers_map,
data=serialize(request_body),
content_type='application/json',
response_format=ResponseFormat.JSON,
auth=self.auth,
network_session=self.network_session,
)
)
return deserialize(response.data, IntegrationMappingTeams)

def update_integration_mapping_teams_by_id(
self,
integration_mapping_id: str,
*,
box_item: Optional[FolderReference] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> IntegrationMappingTeams:
"""
Updates a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams).

Supports updating the Box folder ID and options.


You need Admin or Co-Admin role to


use this endpoint.

:param integration_mapping_id: An ID of an integration mapping
Example: "11235432"
:type integration_mapping_id: str
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
if extra_headers is None:
extra_headers = {}
request_body: Dict = {'box_item': box_item}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
FetchOptions(
url=''.join(
[
self.network_session.base_urls.base_url,
'/2.0/integration_mappings/teams/',
to_string(integration_mapping_id),
]
),
method='PUT',
headers=headers_map,
data=serialize(request_body),
content_type='application/json',
response_format=ResponseFormat.JSON,
auth=self.auth,
network_session=self.network_session,
)
)
return deserialize(response.data, IntegrationMappingTeams)

def delete_integration_mapping_teams_by_id(
self,
integration_mapping_id: str,
*,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> None:
"""
Deletes a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams).

You need Admin or Co-Admin role to


use this endpoint.

:param integration_mapping_id: An ID of an integration mapping
Example: "11235432"
:type integration_mapping_id: str
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
if extra_headers is None:
extra_headers = {}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
FetchOptions(
url=''.join(
[
self.network_session.base_urls.base_url,
'/2.0/integration_mappings/teams/',
to_string(integration_mapping_id),
]
),
method='DELETE',
headers=headers_map,
response_format=ResponseFormat.NO_CONTENT,
auth=self.auth,
network_session=self.network_session,
)
)
return None
2 changes: 1 addition & 1 deletion box_sdk_gen/managers/shared_links_app_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
self.auth = auth
self.network_session = network_session

def get_shared_item_app_items(
def find_app_item_for_shared_link(
self, boxapi: str, *, extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> AppItem:
"""
Expand Down
12 changes: 12 additions & 0 deletions box_sdk_gen/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@

from box_sdk_gen.schemas.access_token import *

from box_sdk_gen.schemas.folder_reference import *

from box_sdk_gen.schemas.generic_source import *

from box_sdk_gen.schemas.group_base import *
Expand All @@ -138,6 +140,16 @@

from box_sdk_gen.schemas.integration_mapping_partner_item_slack import *

from box_sdk_gen.schemas.integration_mapping_partner_item_teams import *

from box_sdk_gen.schemas.integration_mapping_teams import *

from box_sdk_gen.schemas.integration_mappings_teams import *

from box_sdk_gen.schemas.integration_mapping_partner_item_teams_create_request import *

from box_sdk_gen.schemas.integration_mapping_teams_create_request import *

from box_sdk_gen.schemas.integration_mapping_slack_options import *

from box_sdk_gen.schemas.integration_mapping_slack_create_request import *
Expand Down
30 changes: 30 additions & 0 deletions box_sdk_gen/schemas/folder_reference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from enum import Enum

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.box.errors import BoxSDKError


class FolderReferenceTypeField(str, Enum):
FOLDER = 'folder'


class FolderReference(BaseObject):
_discriminator = 'type', {'folder'}

def __init__(
self,
id: str,
*,
type: FolderReferenceTypeField = FolderReferenceTypeField.FOLDER,
**kwargs
):
"""
:param id: ID of the folder
:type id: str
:param type: `folder`, defaults to FolderReferenceTypeField.FOLDER
:type type: FolderReferenceTypeField, optional
"""
super().__init__(**kwargs)
self.id = id
self.type = type
34 changes: 34 additions & 0 deletions box_sdk_gen/schemas/integration_mapping_partner_item_teams.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from enum import Enum

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.box.errors import BoxSDKError


class IntegrationMappingPartnerItemTeamsTypeField(str, Enum):
CHANNEL = 'channel'
TEAM = 'team'


class IntegrationMappingPartnerItemTeams(BaseObject):
_discriminator = 'type', {'channel', 'team'}

def __init__(
self,
type: IntegrationMappingPartnerItemTeamsTypeField,
id: str,
tenant_id: str,
**kwargs
):
"""
:param type: Type of the mapped item referenced in `id`
:type type: IntegrationMappingPartnerItemTeamsTypeField
:param id: ID of the mapped item (of type referenced in `type`)
:type id: str
:param tenant_id: ID of the tenant that is registered with Microsoft Teams.
:type tenant_id: str
"""
super().__init__(**kwargs)
self.type = type
self.id = id
self.tenant_id = tenant_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from enum import Enum

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.box.errors import BoxSDKError


class IntegrationMappingPartnerItemTeamsCreateRequestTypeField(str, Enum):
CHANNEL = 'channel'
TEAM = 'team'


class IntegrationMappingPartnerItemTeamsCreateRequest(BaseObject):
_discriminator = 'type', {'channel', 'team'}

def __init__(
self,
type: IntegrationMappingPartnerItemTeamsCreateRequestTypeField,
id: str,
tenant_id: str,
team_id: str,
**kwargs
):
"""
:param type: Type of the mapped item referenced in `id`
:type type: IntegrationMappingPartnerItemTeamsCreateRequestTypeField
:param id: ID of the mapped item (of type referenced in `type`)
:type id: str
:param tenant_id: ID of the tenant that is registered with Microsoft Teams.
:type tenant_id: str
:param team_id: ID of the team that is registered with Microsoft Teams.
:type team_id: str
"""
super().__init__(**kwargs)
self.type = type
self.id = id
self.tenant_id = tenant_id
self.team_id = team_id
Loading
Loading