Skip to content

EnterpriseDepartmentModifyRequest

Bases: OCIRequest

Modify a department of an enterprise. The response is either a SuccessResponse or an ErrorResponse.

Attributes:

enterprise_id (str):

department_name (str):

new_department_name (Optional[str]):

new_parent_department_key (Optional[Nillable[EnterpriseDepartmentKey]]):
Source code in src/mercury_ocip_fast/commands/commands.py
@dataclass(kw_only=True)
class EnterpriseDepartmentModifyRequest(OCIRequest):
    """Modify a department of an enterprise.
        The response is either a SuccessResponse or an ErrorResponse.

    Attributes:

        enterprise_id (str):

        department_name (str):

        new_department_name (Optional[str]):

        new_parent_department_key (Optional[Nillable[EnterpriseDepartmentKey]]):

    """

    enterprise_id: str = field(metadata={"alias": "enterpriseId"})

    department_name: str = field(metadata={"alias": "departmentName"})

    new_department_name: Optional[str] = field(
        default=None, metadata={"alias": "newDepartmentName"}
    )

    new_parent_department_key: Optional[Nillable[EnterpriseDepartmentKey]] = field(
        default=None, metadata={"alias": "newParentDepartmentKey"}
    )

    def __post_init__(self):
        nillable_fields = ["new_parent_department_key"]
        for field_name in nillable_fields:
            value = getattr(self, field_name)
            if value == "" or value == "None":
                object.__setattr__(self, field_name, OCINil)

Responses

Bases: OCIResponse

Source code in src/mercury_ocip_fast/commands/base_command.py
class SuccessResponse(OCIResponse):
    pass

Bases: OCIResponse

Source code in src/mercury_ocip_fast/commands/base_command.py
class ErrorResponse(OCIResponse):
    errorCode: Optional[int] = None
    summary: str
    summaryEnglish: str
    detail: Optional[str] = None

Example Usage

from mercury_ocip_fast.client import Client
from mercury_ocip_fast.commands import EnterpriseDepartmentModifyRequest

client = Client()

command = EnterpriseDepartmentModifyRequest(
    enterprise_id=...,
    department_name=...,
    new_department_name=...,
    new_parent_department_key=...,
)

response = client.command(command)

print(response)

Example 2 with Raw Command

from mercury_ocip_fast.client import Client

client = Client()

response = client.raw_command("EnterpriseDepartmentModifyRequest",
    enterprise_id=...,
    department_name=...,
    new_department_name=...,
    new_parent_department_key=...,
)

print(response)