Skip to content

Commit

Permalink
fix: temporarily remove file activities endpoint (box/box-openapi#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Mar 18, 2024
1 parent 59d46ea commit 72531c2
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "3d3d072", "specHash": "578a2f2", "version": "0.6.1" }
{ "engineHash": "3d3d072", "specHash": "d50ab5f", "version": "0.6.1" }
39 changes: 5 additions & 34 deletions box_sdk_gen/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from box_sdk_gen.schemas import ClientError

from box_sdk_gen.schemas import Outcome

from box_sdk_gen.networking.auth import Authentication

from box_sdk_gen.networking.network import NetworkSession
Expand Down Expand Up @@ -108,37 +110,6 @@ def __init__(
self.id = id


class StartWorkflowOutcomesTypeField(str, Enum):
OUTCOME = 'outcome'


class StartWorkflowOutcomes(BaseObject):
_discriminator = 'type', {'outcome'}

def __init__(
self,
*,
id: Optional[str] = None,
type: Optional[StartWorkflowOutcomesTypeField] = None,
parameter: Optional[str] = None,
**kwargs
):
"""
:param id: The id of the outcome, defaults to None
:type id: Optional[str], optional
:param type: The type of the outcome object, defaults to None
:type type: Optional[StartWorkflowOutcomesTypeField], optional
:param parameter: This is a placeholder example for various objects that
can be passed in - refer to the guides section to find
out more information., defaults to None
:type parameter: Optional[str], optional
"""
super().__init__(**kwargs)
self.id = id
self.type = type
self.parameter = parameter


class WorkflowsManager:
def __init__(
self,
Expand Down Expand Up @@ -226,7 +197,7 @@ def start_workflow(
folder: StartWorkflowFolder,
*,
type: Optional[StartWorkflowType] = None,
outcomes: Optional[List[StartWorkflowOutcomes]] = None,
outcomes: Optional[List[Outcome]] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> None:
"""
Expand All @@ -249,8 +220,8 @@ def start_workflow(
:type folder: StartWorkflowFolder
:param type: The type of the parameters object, defaults to None
:type type: Optional[StartWorkflowType], optional
:param outcomes: A list of outcomes required to be configured at start time., defaults to None
:type outcomes: Optional[List[StartWorkflowOutcomes]], optional
:param outcomes: A configurable outcome the workflow should complete., defaults to None
:type outcomes: Optional[List[Outcome]], 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
"""
Expand Down
171 changes: 171 additions & 0 deletions box_sdk_gen/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10242,6 +10242,109 @@ def __init__(
self.state = state


class CompletionRuleVariableTypeField(str, Enum):
VARIABLE = 'variable'


class CompletionRuleVariableVariableTypeField(str, Enum):
TASK_COMPLETION_RULE = 'task_completion_rule'


class CompletionRuleVariableVariableValueField(str, Enum):
ALL_ASSIGNEES = 'all_assignees'
ANY_ASSIGNEES = 'any_assignees'


class CompletionRuleVariable(BaseObject):
_discriminator = 'type', {'variable'}

def __init__(
self,
type: CompletionRuleVariableTypeField,
variable_type: CompletionRuleVariableVariableTypeField,
variable_value: CompletionRuleVariableVariableValueField,
**kwargs
):
"""
:param type: Completion
Rule object type.

:type type: CompletionRuleVariableTypeField
:param variable_type: Variable type
for the Completion
Rule object.

:type variable_type: CompletionRuleVariableVariableTypeField
:param variable_value: Variable
values for a completion
rule.

:type variable_value: CompletionRuleVariableVariableValueField
"""
super().__init__(**kwargs)
self.type = type
self.variable_type = variable_type
self.variable_value = variable_value


class CollaboratorVariableTypeField(str, Enum):
VARIABLE = 'variable'


class CollaboratorVariableVariableTypeField(str, Enum):
USER_LIST = 'user_list'


class CollaboratorVariableVariableValueTypeField(str, Enum):
USER = 'user'


class CollaboratorVariableVariableValueField(BaseObject):
_discriminator = 'type', {'user'}

def __init__(
self, type: CollaboratorVariableVariableValueTypeField, id: str, **kwargs
):
"""
:param type: The object type.
:type type: CollaboratorVariableVariableValueTypeField
:param id: User's ID.
:type id: str
"""
super().__init__(**kwargs)
self.type = type
self.id = id


class CollaboratorVariable(BaseObject):
_discriminator = 'type', {'variable'}

def __init__(
self,
type: CollaboratorVariableTypeField,
variable_type: CollaboratorVariableVariableTypeField,
variable_value: List[CollaboratorVariableVariableValueField],
**kwargs
):
"""
:param type: Collaborator
object type.

:type type: CollaboratorVariableTypeField
:param variable_type: Variable type
for the Collaborator
object.

:type variable_type: CollaboratorVariableVariableTypeField
:param variable_value: A list of user IDs.
:type variable_value: List[CollaboratorVariableVariableValueField]
"""
super().__init__(**kwargs)
self.type = type
self.variable_type = variable_type
self.variable_value = variable_value


class KeywordSkillCardTypeField(str, Enum):
SKILL_CARD = 'skill_card'

Expand Down Expand Up @@ -10535,6 +10638,74 @@ def __init__(
self.options = options


class RoleVariableTypeField(str, Enum):
VARIABLE = 'variable'


class RoleVariableVariableTypeField(str, Enum):
COLLABORATOR_ROLE = 'collaborator_role'


class RoleVariableVariableValueField(str, Enum):
EDITOR = 'editor'
VIEWER = 'viewer'
PREVIEWER = 'previewer'
UPLOADER = 'uploader'
PREVIEWER_UPLOADER = 'previewer uploader'
VIEWER_UPLOADER = 'viewer uploader'
CO_OWNER = 'co-owner'


class RoleVariable(BaseObject):
_discriminator = 'type', {'variable'}

def __init__(
self,
type: RoleVariableTypeField,
variable_type: RoleVariableVariableTypeField,
variable_value: RoleVariableVariableValueField,
**kwargs
):
"""
:param type: Role object type.

:type type: RoleVariableTypeField
:param variable_type: The variable type used
by the object.

:type variable_type: RoleVariableVariableTypeField
"""
super().__init__(**kwargs)
self.type = type
self.variable_type = variable_type
self.variable_value = variable_value


class Outcome(BaseObject):
def __init__(
self,
id: str,
*,
collaborators: Optional[CollaboratorVariable] = None,
completion_rule: Optional[CompletionRuleVariable] = None,
file_collaborator_role: Optional[RoleVariable] = None,
task_collaborators: Optional[CollaboratorVariable] = None,
role: Optional[RoleVariable] = None,
**kwargs
):
"""
:param id: ID of a specific outcome
:type id: str
"""
super().__init__(**kwargs)
self.id = id
self.collaborators = collaborators
self.completion_rule = completion_rule
self.file_collaborator_role = file_collaborator_role
self.task_collaborators = task_collaborators
self.role = role


class TimelineSkillCardTypeField(str, Enum):
SKILL_CARD = 'skill_card'

Expand Down
4 changes: 2 additions & 2 deletions docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ admin_client.workflows.start_workflow(workflow_to_run.id, StartWorkflowFlow(type
- The array of files for which the workflow should start. All files must be in the workflow's configured folder.
- folder `StartWorkflowFolder`
- The folder object for which the workflow is configured.
- outcomes `Optional[List[StartWorkflowOutcomes]]`
- A list of outcomes required to be configured at start time.
- outcomes `Optional[List[Outcome]]`
- A configurable outcome the workflow should complete.
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Expand Down

0 comments on commit 72531c2

Please sign in to comment.