Skip to content

GroupDepartmentModifyRequest

Bases: OCIRequest

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

The following elements are only used in AS data mode:
   callingLineIdName
   caliingLineIdPhoneNumber

Attributes:

service_provider_id (str):

group_id (str):

department_name (str):

new_department_name (Optional[str]):

new_parent_department_key (Optional[Nillable[DepartmentKey]]):

calling_line_id_name (Optional[Nillable[str]]):

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

        The following elements are only used in AS data mode:
           callingLineIdName
           caliingLineIdPhoneNumber

    Attributes:

        service_provider_id (str):

        group_id (str):

        department_name (str):

        new_department_name (Optional[str]):

        new_parent_department_key (Optional[Nillable[DepartmentKey]]):

        calling_line_id_name (Optional[Nillable[str]]):

        calling_line_id_phone_number (Optional[Nillable[str]]):

    """

    service_provider_id: str = field(metadata={"alias": "serviceProviderId"})

    group_id: str = field(metadata={"alias": "groupId"})

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

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

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

    calling_line_id_name: Optional[Nillable[str]] = field(
        default=None, metadata={"alias": "callingLineIdName"}
    )

    calling_line_id_phone_number: Optional[Nillable[str]] = field(
        default=None, metadata={"alias": "callingLineIdPhoneNumber"}
    )

    def __post_init__(self):
        nillable_fields = [
            "new_parent_department_key",
            "calling_line_id_name",
            "calling_line_id_phone_number",
        ]
        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 GroupDepartmentModifyRequest

client = Client()

command = GroupDepartmentModifyRequest(
    service_provider_id=...,
    group_id=...,
    department_name=...,
    new_department_name=...,
    new_parent_department_key=...,
    calling_line_id_name=...,
    calling_line_id_phone_number=...,
)

response = client.command(command)

print(response)

Example 2 with Raw Command

from mercury_ocip_fast.client import Client

client = Client()

response = client.raw_command("GroupDepartmentModifyRequest",
    service_provider_id=...,
    group_id=...,
    department_name=...,
    new_department_name=...,
    new_parent_department_key=...,
    calling_line_id_name=...,
    calling_line_id_phone_number=...,
)

print(response)