UserAnnouncementFileModifyRequest
Bases: OCIRequest
This command is used to change the name of the file or upload a new announcement file for an existing announcement in the user repository. When modifying the file type the command will fail if the media type of the new file changes the announcement from audio to video (or vice versa).
The following elements are only used in AS data mode and ignored in XS data mode:
announcementFileExternalId
The response is either a SuccessResponse or an ErrorResponse.
Attributes:
user_id (Optional[str]):
announcement_file_key (Optional[AnnouncementFileKey]):
announcement_file_external_id (Optional[str]):
new_announcement_file_name (Optional[str]):
announcement_file (Optional[LabeledMediaFileResource]):
Source code in src/mercury_ocip/commands/commands.py
| @dataclass(kw_only=True)
class UserAnnouncementFileModifyRequest(OCIRequest):
"""This command is used to change the name of the file or upload a new announcement file for
an existing announcement in the user repository.
When modifying the file type the command will fail if the media type of the new file changes
the announcement from audio to video (or vice versa).
The following elements are only used in AS data mode and ignored in XS data mode:
announcementFileExternalId
The response is either a SuccessResponse or an ErrorResponse.
Attributes:
user_id (Optional[str]):
announcement_file_key (Optional[AnnouncementFileKey]):
announcement_file_external_id (Optional[str]):
new_announcement_file_name (Optional[str]):
announcement_file (Optional[LabeledMediaFileResource]):
"""
user_id: Optional[str] = field(default=None, metadata={"alias": "userId"})
announcement_file_key: Optional[AnnouncementFileKey] = field(
default=None, metadata={"alias": "announcementFileKey"}
)
announcement_file_external_id: Optional[str] = field(
default=None, metadata={"alias": "announcementFileExternalId"}
)
new_announcement_file_name: Optional[str] = field(
default=None, metadata={"alias": "newAnnouncementFileName"}
)
announcement_file: Optional[LabeledMediaFileResource] = field(
default=None, metadata={"alias": "announcementFile"}
)
|
Responses
Bases: OCIResponseSource code in src/mercury_ocip/commands/base_command.py
| class SuccessResponse(OCIResponse):
pass
|
Bases: OCIResponseSource code in src/mercury_ocip/commands/base_command.py
| class ErrorResponse(OCIResponse):
errorCode: Optional[int] = None
summary: str
summaryEnglish: str
detail: Optional[str] = None
|
Example Usage
from mercury_ocip.client import Client
from mercury_ocip.commands import UserAnnouncementFileModifyRequest
client = Client()
command = UserAnnouncementFileModifyRequest(
user_id=...,
announcement_file_key=...,
announcement_file_external_id=...,
new_announcement_file_name=...,
announcement_file=...,
)
response = client.command(command)
print(response)
Example 2 with Raw Command
from mercury_ocip.client import Client
client = Client()
response = client.raw_command("UserAnnouncementFileModifyRequest",
user_id=...,
announcement_file_key=...,
announcement_file_external_id=...,
new_announcement_file_name=...,
announcement_file=...,
)
print(response)