From 4eeee6745a43456db223d53b2563d471faceaab9 Mon Sep 17 00:00:00 2001 From: "dropbox-sdk-updater[bot]" <306210582+dropbox-sdk-updater[bot]@users.noreply.github.com> Date: Sat, 3 Oct 2026 12:02:41 +0000 Subject: [PATCH] Automated Spec Update 248109f2fb632e0f545e13ed1852d2b39f5c45ad Automated update of the API specification Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> 0adcebc8331935c905bceac02237314074ff5a4a Automated update of the API specification Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> 2e92eafcd30342481e1f38c8a0d461795c0e94f2 Automated update of the API specification Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> 81dbdd6e7cb174bc2f74c6d3e02b6d37d2292c7b Automated update of the API specification Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> --- dropbox/base.py | 172 ++ dropbox/base_team.py | 72 +- dropbox/riviera.py | 1628 ++++++++++++++++- dropbox/sharing.py | 17 + dropbox/team.py | 4094 +++++++++++++++++++++--------------------- spec | 2 +- 6 files changed, 3860 insertions(+), 2125 deletions(-) diff --git a/dropbox/base.py b/dropbox/base.py index e95b8a6..74148b3 100644 --- a/dropbox/base.py +++ b/dropbox/base.py @@ -4505,6 +4505,79 @@ def paper_folders_create(self, name, parent_folder_id=None, is_team_folder=None) # ------------------------------------------ # Routes in riviera namespace + def riviera_download_transform_output(self, output_handle): + """ + Download the output of a completed `get_transform_async` job. Pass the + `output_handle` from the job's `complete` result. The body is the + produced file, and the `Dropbox-API-Result` header describes it. A + handle can only be redeemed by the user who requested the transform, and + only until its `expires_ts`; after that this route fails with + `expired_handle_error`, and the transform has to be requested again. A + handle that was never valid, or that belongs to another user, fails with + `user_error`. + + Route attributes: + scope: files.content.read + + :param output_handle: The `output_handle` from a `complete` + `get_transform_async/check` result. + :type output_handle: str + :rtype: (:class:`dropbox.riviera.DownloadTransformOutputResult`, + :class:`requests.models.Response`) + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.riviera.TransformApiV2Error` + + If you do not consume the entire response body, then you must call close + on the response object, otherwise you will max out your available + connections. We recommend using the `contextlib.closing + `_ + context manager to ensure this. + """ + arg = riviera.DownloadTransformOutputArgs(output_handle) + r = self.request( + riviera.download_transform_output, + "riviera", + arg, + None, + ) + return r + + def riviera_download_transform_output_to_file(self, download_path, output_handle): + """ + Download the output of a completed `get_transform_async` job. Pass the + `output_handle` from the job's `complete` result. The body is the + produced file, and the `Dropbox-API-Result` header describes it. A + handle can only be redeemed by the user who requested the transform, and + only until its `expires_ts`; after that this route fails with + `expired_handle_error`, and the transform has to be requested again. A + handle that was never valid, or that belongs to another user, fails with + `user_error`. + + Route attributes: + scope: files.content.read + + :param str download_path: Path on local machine to save file. + :param output_handle: The `output_handle` from a `complete` + `get_transform_async/check` result. + :type output_handle: str + :rtype: :class:`dropbox.riviera.DownloadTransformOutputResult` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.riviera.TransformApiV2Error` + """ + arg = riviera.DownloadTransformOutputArgs(output_handle) + r = self.request( + riviera.download_transform_output, + "riviera", + arg, + None, + ) + self._save_body_to_file(download_path, r[1]) + return r[0] + def riviera_get_keyframes_async( self, file_id_or_url=None, scene_change_threshold=0.0, include_images=False ): @@ -4927,6 +5000,105 @@ def riviera_get_transcript_async_check(self, async_job_id): ) return r + def riviera_get_transform_async( + self, transform_type, file_id_or_url=None, thumbnail=None, image=None, video_frame=None + ): + """ + Asynchronous file transformation: produces a new file from an existing + one. One route covers many conversions. Name the source file in + `file_id_or_url`, say what you want back in `transform_type`, and supply + that type's options message if it needs one: - `pdf`: documents and + images, to PDF. - `html`: spreadsheets, to HTML, preserving the sheet + layout. - `image`: images and single document pages, to JPEG or PNG. - + `thumbnail`: any thumbnailable source, resized to a named size bucket. - + `image_pdf`: documents, to a page image rendered by way of PDF. - + `video_frame`: one still frame from a video, at a requested offset. The + accepted input formats differ per transform -- they are not one shared + list -- and each is the intersection of the source format with the + pipeline that transform uses: - `pdf` and `image_pdf`: word-processing, + presentation and spreadsheet documents (.doc, .docx, .ppt, .pptx, .xls, + .xlsx, .odt, .odp, .ods, .rtf, .epub, .gdoc, .gslides, .hwp, .ai, .eps, + .dwg among others). Images are not accepted. - `html`: spreadsheets only + -- .xls, .xlsm, .xlsx, .ods, .gsheet. This is the complete list. Note + that .csv and .txt are *not* accepted here. - `image`: the documents + above, plus .pdf and .html, plus the iWork and design formats .pages, + .key, .numbers, .sketch, .xd, .indd and .psd, plus .avif, .heic, .svg + and camera RAW, plus fonts (.otf, .ttf), plus video. Formats a browser + can already display (.bmp, .gif, .ico, .jpeg, .png, .tif, .tiff, .webp) + are not accepted; use `thumbnail` for those. - `thumbnail`: everything + `image` accepts, plus .bmp, .gif, .ico, .jpeg, .png, .tif, .tiff, .webp + and JPEG 2000. - `video_frame`: .3g2, .3gp, .3gpp, .3gpp2, .asf, .avi, + .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, + .ogv, .rm, .ts, .vob, .webm, .wmv. This is the complete list. These + lists track Riviera's capability registry + (`dropbox/riviera/supported_types/previews_supported_types.yaml`), which + is generated and authoritative; treat it rather than this comment as the + final word. Formats the requested transform does not support fail with + `unsupported_format_error`. Options belonging to a different transform + type than the one requested fail with `invalid_options_error`. The + produced bytes are not returned by this route, and not by its `/check` + poll either. Poll `get_transform_async/check` with the returned async + job ID until it reports `complete` or `failed`; a `complete` result + carries a `TransformOutput` whose `output_handle` + `download_transform_output` exchanges for the bytes. Splitting retrieval + out this way is what lets the route return outputs larger than an async + result can carry. + + Route attributes: + scope: files.content.read + + :param file_id_or_url: Identifier of the source file to transform. + Callers must set exactly one of the `FileIdOrUrl` variants. The + referenced file must be in a format the requested `transform_type` + supports; see the route description for the per-transform format + lists. Requests against unsupported formats fail with + `unsupported_format_error`. + :type file_id_or_url: Nullable[:class:`dropbox.riviera.FileIdOrUrl`] + :param transform_type: What to produce from the source file. Required. + :type transform_type: :class:`dropbox.riviera.TransformType` + :param thumbnail: Options for `TransformType.thumbnail`. + :type thumbnail: Nullable[:class:`dropbox.riviera.ThumbnailOptions`] + :param image: Options for `TransformType.image` and + `TransformType.image_pdf`. + :type image: Nullable[:class:`dropbox.riviera.ImageOptions`] + :param video_frame: Options for `TransformType.video_frame`. + :type video_frame: Nullable[:class:`dropbox.riviera.VideoFrameOptions`] + :rtype: :class:`dropbox.async_.LaunchResultBase` + """ + arg = riviera.TransformArgs(transform_type, file_id_or_url, thumbnail, image, video_frame) + r = self.request( + riviera.get_transform_async, + "riviera", + arg, + None, + ) + return r + + def riviera_get_transform_async_check(self, async_job_id): + """ + Returns the status or result of specified get_transform_async task. + + Route attributes: + scope: files.content.read + + :param async_job_id: Id of the asynchronous job. This is the value of a + response returned from the method that launched the job. + :type async_job_id: str + :rtype: :class:`dropbox.riviera.GetTransformAsyncCheckResult` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.async_.PollError` + """ + arg = async_.PollArg(async_job_id) + r = self.request( + riviera.get_transform_async_check, + "riviera", + arg, + None, + ) + return r + # ------------------------------------------ # Routes in sharing namespace diff --git a/dropbox/base_team.py b/dropbox/base_team.py index 08e0137..bff8bd1 100644 --- a/dropbox/base_team.py +++ b/dropbox/base_team.py @@ -1424,7 +1424,7 @@ def team_members_add_job_status_get_v2(self, async_job_id): def team_members_bulk_suspend(self, members): """ - Launch a bulk suspend job. The server enforces a maximum of 500 members. + Deprecated compatibility alias for MembersSuspendBatch. Route attributes: scope: members.write @@ -1432,14 +1432,18 @@ def team_members_bulk_suspend(self, members): :param members: Must contain between 1 and 500 targets. The launch handler also rejects duplicate client item IDs and duplicate member selectors. - :type members: List[:class:`dropbox.team.BulkSuspendMemberTarget`] + :type members: List[:class:`dropbox.team.MembersSuspendBatchTarget`] :rtype: :class:`dropbox.async_.LaunchResultBase` :raises: :class:`.exceptions.ApiError` If this raises, ApiError will contain: - :class:`dropbox.team.BulkSuspendError` + :class:`dropbox.team.MembersSuspendBatchError` """ - arg = team.BulkSuspendArg(members) + warnings.warn( + "members/bulk_suspend is deprecated.", + DeprecationWarning, + ) + arg = team.MembersSuspendBatchArg(members) r = self.request( team.members_bulk_suspend, "team", @@ -1450,7 +1454,7 @@ def team_members_bulk_suspend(self, members): def team_members_bulk_suspend_job_status_check(self, async_job_id): """ - Poll a previously launched bulk suspend job. + Deprecated compatibility alias for MembersSuspendBatchJobStatusCheck. Route attributes: scope: members.write @@ -1458,12 +1462,16 @@ def team_members_bulk_suspend_job_status_check(self, async_job_id): :param async_job_id: Id of the asynchronous job. This is the value of a response returned from the method that launched the job. :type async_job_id: str - :rtype: :class:`dropbox.team.BulkSuspendJobStatus` + :rtype: :class:`dropbox.team.MembersSuspendBatchJobStatus` :raises: :class:`.exceptions.ApiError` If this raises, ApiError will contain: :class:`dropbox.async_.PollError` """ + warnings.warn( + "members/bulk_suspend/job_status/check is deprecated.", + DeprecationWarning, + ) arg = async_.PollArg(async_job_id) r = self.request( team.members_bulk_suspend_job_status_check, @@ -2264,6 +2272,58 @@ def team_members_suspend(self, user, wipe_data=True): ) return None + def team_members_suspend_batch(self, members): + """ + Launch a member suspension batch. The server enforces a maximum of 500 + members. + + Route attributes: + scope: members.write + + :param members: Must contain between 1 and 500 targets. The launch + handler also rejects duplicate client item IDs and duplicate member + selectors. + :type members: List[:class:`dropbox.team.MembersSuspendBatchTarget`] + :rtype: :class:`dropbox.async_.LaunchResultBase` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.team.MembersSuspendBatchError` + """ + arg = team.MembersSuspendBatchArg(members) + r = self.request( + team.members_suspend_batch, + "team", + arg, + None, + ) + return r + + def team_members_suspend_batch_job_status_check(self, async_job_id): + """ + Poll a previously launched member suspension batch job. + + Route attributes: + scope: members.write + + :param async_job_id: Id of the asynchronous job. This is the value of a + response returned from the method that launched the job. + :type async_job_id: str + :rtype: :class:`dropbox.team.MembersSuspendBatchJobStatus` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.async_.PollError` + """ + arg = async_.PollArg(async_job_id) + r = self.request( + team.members_suspend_batch_job_status_check, + "team", + arg, + None, + ) + return r + def team_members_unsuspend(self, user): """ Unsuspend a member from a team. Permission : Team member management diff --git a/dropbox/riviera.py b/dropbox/riviera.py index a962464..57f67bf 100644 --- a/dropbox/riviera.py +++ b/dropbox/riviera.py @@ -1063,6 +1063,89 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ContentApiV2Error_validator = bv.Union(ContentApiV2Error) +class DownloadTransformOutputArgs(bb.Struct): + """ + Arguments for `download_transform_output`. + + :ivar DownloadTransformOutputArgs.output_handle: + The `output_handle` from a `complete` `get_transform_async/check` + result. + """ + + __slots__ = [ + "_output_handle_value", + ] + + _has_required_fields = True + + def __init__(self, output_handle=None): + self._output_handle_value = bb.NOT_SET + if output_handle is not None: + self.output_handle = output_handle + + # Instance attribute type: str (validator is set below) + output_handle = bb.Attribute("output_handle") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(DownloadTransformOutputArgs, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +DownloadTransformOutputArgs_validator = bv.Struct(DownloadTransformOutputArgs) + + +class DownloadTransformOutputResult(bb.Struct): + """ + Describes the bytes in the response body. Returned in the + `Dropbox-API-Result` header. + + :ivar DownloadTransformOutputResult.size: + Size of the output in bytes. + :ivar DownloadTransformOutputResult.format: + Format of the output, as a short lowercase format name such as "pdf", + "html", "jpeg", or "png". + :ivar DownloadTransformOutputResult.mime_type: + MIME type corresponding to `format`. + """ + + __slots__ = [ + "_size_value", + "_format_value", + "_mime_type_value", + ] + + _has_required_fields = False + + def __init__(self, size=None, format=None, mime_type=None): + self._size_value = bb.NOT_SET + self._format_value = bb.NOT_SET + self._mime_type_value = bb.NOT_SET + if size is not None: + self.size = size + if format is not None: + self.format = format + if mime_type is not None: + self.mime_type = mime_type + + # Instance attribute type: int (validator is set below) + size = bb.Attribute("size") + + # Instance attribute type: str (validator is set below) + format = bb.Attribute("format") + + # Instance attribute type: str (validator is set below) + mime_type = bb.Attribute("mime_type") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(DownloadTransformOutputResult, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +DownloadTransformOutputResult_validator = bv.Struct(DownloadTransformOutputResult) + + class FileIdOrUrl(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will @@ -2373,6 +2456,165 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): GetTranscriptResult_validator = bv.Struct(GetTranscriptResult) +class GetTransformAsyncCheckResult(bb.Union): + """ + Result type for EventBus async check - must end in "CheckResult" + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar GetTransformAsyncCheckResult.in_progress: + The job has not finished yet. Poll again. + :ivar GetTransformAsyncCheckResult.complete: + The job finished successfully. + :vartype GetTransformAsyncCheckResult.complete: TransformOutput + :ivar GetTransformAsyncCheckResult.failed: + The job finished unsuccessfully. + :vartype GetTransformAsyncCheckResult.failed: TransformApiV2Error + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + in_progress = None + # Attribute is overwritten below the class definition + other = None + + @classmethod + def complete(cls, val): + """ + Create an instance of this class set to the ``complete`` tag with value + ``val``. + + :param TransformOutput val: + :rtype: GetTransformAsyncCheckResult + """ + return cls("complete", val) + + @classmethod + def failed(cls, val): + """ + Create an instance of this class set to the ``failed`` tag with value + ``val``. + + :param TransformApiV2Error val: + :rtype: GetTransformAsyncCheckResult + """ + return cls("failed", val) + + def is_in_progress(self): + """ + Check if the union tag is ``in_progress``. + + :rtype: bool + """ + return self._tag == "in_progress" + + def is_complete(self): + """ + Check if the union tag is ``complete``. + + :rtype: bool + """ + return self._tag == "complete" + + def is_failed(self): + """ + Check if the union tag is ``failed``. + + :rtype: bool + """ + return self._tag == "failed" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def get_complete(self): + """ + The job finished successfully. + + Only call this if :meth:`is_complete` is true. + + :rtype: TransformOutput + """ + if not self.is_complete(): + raise AttributeError("tag 'complete' not set") + return self._value + + def get_failed(self): + """ + The job finished unsuccessfully. + + Only call this if :meth:`is_failed` is true. + + :rtype: TransformApiV2Error + """ + if not self.is_failed(): + raise AttributeError("tag 'failed' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(GetTransformAsyncCheckResult, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +GetTransformAsyncCheckResult_validator = bv.Union(GetTransformAsyncCheckResult) + + +class ImageOptions(bb.Struct): + """ + Options for `TransformType.image` and `TransformType.image_pdf`. Supplying + this message with any other transform type fails with + `invalid_options_error`. + + :ivar ImageOptions.page_number: + For multi-page sources (PDFs, presentations, documents), the 1-based + page to render. Each request renders one page; to render a whole + document, issue one request per page. Defaults to the first page when + omitted. + :ivar ImageOptions.scale_percent: + Scale the rendered image to this percentage of its natural size. Must be + in (0, 100] -- the pipeline does not upscale, so values above 100 are + rejected with `invalid_options_error`. Defaults to 100 (no scaling) when + omitted. + """ + + __slots__ = [ + "_page_number_value", + "_scale_percent_value", + ] + + _has_required_fields = False + + def __init__(self, page_number=None, scale_percent=None): + self._page_number_value = bb.NOT_SET + self._scale_percent_value = bb.NOT_SET + if page_number is not None: + self.page_number = page_number + if scale_percent is not None: + self.scale_percent = scale_percent + + # Instance attribute type: int (validator is set below) + page_number = bb.Attribute("page_number") + + # Instance attribute type: int (validator is set below) + scale_percent = bb.Attribute("scale_percent") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ImageOptions, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +ImageOptions_validator = bv.Struct(ImageOptions) + + class KeyframesExtractionApiV2Error(bb.Union): """ Reason a keyframe extraction job failed. Returned in the `failed` variant of @@ -3560,45 +3802,58 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): TextExtractionApiV2Error_validator = bv.Union(TextExtractionApiV2Error) -class TimestampLevel(bb.Union): +class ThumbnailFormat(bb.Union): """ - Granularity of the time offsets returned for each transcript segment. + The encoding of the produced image. These match `files/get_thumbnail`'s + formats: JPEG is the better choice for photographs, PNG for screenshots, + line art, and anything with sharp text edges or transparency. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar TimestampLevel.sentence: - One segment per spoken sentence (recommended). This is the default when - ``GetTranscriptArgs.timestamp_level`` is omitted. - :ivar TimestampLevel.word: - One segment per word, useful for fine-grained alignment such as - captioning or highlight-as-you-listen experiences. + :ivar ThumbnailFormat.jpeg: + Lossy JPEG. The default, and the right choice for photographic sources. + :ivar ThumbnailFormat.png: + Lossless PNG, with alpha preserved. + :ivar ThumbnailFormat.webp: + WebP, which compresses better than either JPEG or PNG at comparable + quality but is not readable by every consumer. """ _catch_all = "other" # Attribute is overwritten below the class definition - sentence = None + jpeg = None # Attribute is overwritten below the class definition - word = None + png = None + # Attribute is overwritten below the class definition + webp = None # Attribute is overwritten below the class definition other = None - def is_sentence(self): + def is_jpeg(self): """ - Check if the union tag is ``sentence``. + Check if the union tag is ``jpeg``. :rtype: bool """ - return self._tag == "sentence" + return self._tag == "jpeg" - def is_word(self): + def is_png(self): """ - Check if the union tag is ``word``. + Check if the union tag is ``png``. :rtype: bool """ - return self._tag == "word" + return self._tag == "png" + + def is_webp(self): + """ + Check if the union tag is ``webp``. + + :rtype: bool + """ + return self._tag == "webp" def is_other(self): """ @@ -3609,116 +3864,1008 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(TimestampLevel, self)._process_custom_annotations( + super(ThumbnailFormat, self)._process_custom_annotations( annotation_type, field_path, processor ) -TimestampLevel_validator = bv.Union(TimestampLevel) +ThumbnailFormat_validator = bv.Union(ThumbnailFormat) -class MetadataUnion(bb.Union): +class ThumbnailMode(bb.Union): """ - The extracted metadata. Exactly one variant is populated, corresponding to - ``GetMetadataResult.metadata_type``. + How to resize and crop the source to reach the requested `ThumbnailSize`. + These match `files/get_thumbnail`'s modes. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar MetadataUnion.exif: - EXIF metadata, for image files. - :vartype MetadataUnion.exif: ApiExifMetadata - :ivar MetadataUnion.media: - Container and per-stream metadata, for audio and video files. - :vartype MetadataUnion.media: ApiMediaMetadata - :ivar MetadataUnion.pdf: - Document metadata, for PDFs. - :vartype MetadataUnion.pdf: ApiPdfMetadata - :ivar MetadataUnion.office: - Document metadata, for MS Office files. - :vartype MetadataUnion.office: ApiOfficeMetadata + :ivar ThumbnailMode.strict: + Scale down the image to fit within the given size. + :ivar ThumbnailMode.bestfit: + Scale down the image to fit within the given size or its transpose. + :ivar ThumbnailMode.fitone_bestfit: + Scale down the image to completely cover the given size or its + transpose. + :ivar ThumbnailMode.original: + Don't resize the image at all. """ _catch_all = "other" # Attribute is overwritten below the class definition + strict = None + # Attribute is overwritten below the class definition + bestfit = None + # Attribute is overwritten below the class definition + fitone_bestfit = None + # Attribute is overwritten below the class definition + original = None + # Attribute is overwritten below the class definition other = None - @classmethod - def exif(cls, val): - """ - Create an instance of this class set to the ``exif`` tag with value - ``val``. - - :param ApiExifMetadata val: - :rtype: MetadataUnion - """ - return cls("exif", val) - - @classmethod - def media(cls, val): - """ - Create an instance of this class set to the ``media`` tag with value - ``val``. - - :param ApiMediaMetadata val: - :rtype: MetadataUnion - """ - return cls("media", val) - - @classmethod - def pdf(cls, val): - """ - Create an instance of this class set to the ``pdf`` tag with value - ``val``. - - :param ApiPdfMetadata val: - :rtype: MetadataUnion - """ - return cls("pdf", val) - - @classmethod - def office(cls, val): - """ - Create an instance of this class set to the ``office`` tag with value - ``val``. - - :param ApiOfficeMetadata val: - :rtype: MetadataUnion - """ - return cls("office", val) - - def is_exif(self): + def is_strict(self): """ - Check if the union tag is ``exif``. + Check if the union tag is ``strict``. :rtype: bool """ - return self._tag == "exif" + return self._tag == "strict" - def is_media(self): + def is_bestfit(self): """ - Check if the union tag is ``media``. + Check if the union tag is ``bestfit``. :rtype: bool """ - return self._tag == "media" + return self._tag == "bestfit" - def is_pdf(self): + def is_fitone_bestfit(self): """ - Check if the union tag is ``pdf``. + Check if the union tag is ``fitone_bestfit``. :rtype: bool """ - return self._tag == "pdf" + return self._tag == "fitone_bestfit" - def is_office(self): + def is_original(self): """ - Check if the union tag is ``office``. + Check if the union tag is ``original``. :rtype: bool """ - return self._tag == "office" + return self._tag == "original" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ThumbnailMode, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +ThumbnailMode_validator = bv.Union(ThumbnailMode) + + +class ThumbnailOptions(bb.Struct): + """ + Options for `TransformType.thumbnail`. Supplying this message with any other + transform type fails with `invalid_options_error`. + + :ivar ThumbnailOptions.size: + The size bucket to produce. Defaults to `w64h64` when omitted. + :ivar ThumbnailOptions.mode: + How to fit the source into `size`. Defaults to `strict` when omitted. + :ivar ThumbnailOptions.format: + The output encoding. Defaults to `jpeg` when omitted. + """ + + __slots__ = [ + "_size_value", + "_mode_value", + "_format_value", + ] + + _has_required_fields = False + + def __init__(self, size=None, mode=None, format=None): + self._size_value = bb.NOT_SET + self._mode_value = bb.NOT_SET + self._format_value = bb.NOT_SET + if size is not None: + self.size = size + if mode is not None: + self.mode = mode + if format is not None: + self.format = format + + # Instance attribute type: ThumbnailSize (validator is set below) + size = bb.Attribute("size", user_defined=True) + + # Instance attribute type: ThumbnailMode (validator is set below) + mode = bb.Attribute("mode", user_defined=True) + + # Instance attribute type: ThumbnailFormat (validator is set below) + format = bb.Attribute("format", user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ThumbnailOptions, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +ThumbnailOptions_validator = bv.Struct(ThumbnailOptions) + + +class ThumbnailSize(bb.Union): + """ + The size of the thumbnail to produce. These are the same named size buckets + `files/get_thumbnail` supports, with the same meanings; arbitrary pixel + dimensions are not accepted. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar ThumbnailSize.w32h32: + 32 by 32 px. + :ivar ThumbnailSize.w64h64: + 64 by 64 px. + :ivar ThumbnailSize.w128h128: + 128 by 128 px. + :ivar ThumbnailSize.w256h256: + 256 by 256 px. + :ivar ThumbnailSize.w480h320: + 480 by 320 px. + :ivar ThumbnailSize.w640h480: + 640 by 480 px. + :ivar ThumbnailSize.w960h640: + 960 by 640 px. + :ivar ThumbnailSize.w1024h768: + 1024 by 768 px. + :ivar ThumbnailSize.w2048h1536: + 2048 by 1536 px. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + w32h32 = None + # Attribute is overwritten below the class definition + w64h64 = None + # Attribute is overwritten below the class definition + w128h128 = None + # Attribute is overwritten below the class definition + w256h256 = None + # Attribute is overwritten below the class definition + w480h320 = None + # Attribute is overwritten below the class definition + w640h480 = None + # Attribute is overwritten below the class definition + w960h640 = None + # Attribute is overwritten below the class definition + w1024h768 = None + # Attribute is overwritten below the class definition + w2048h1536 = None + # Attribute is overwritten below the class definition + other = None + + def is_w32h32(self): + """ + Check if the union tag is ``w32h32``. + + :rtype: bool + """ + return self._tag == "w32h32" + + def is_w64h64(self): + """ + Check if the union tag is ``w64h64``. + + :rtype: bool + """ + return self._tag == "w64h64" + + def is_w128h128(self): + """ + Check if the union tag is ``w128h128``. + + :rtype: bool + """ + return self._tag == "w128h128" + + def is_w256h256(self): + """ + Check if the union tag is ``w256h256``. + + :rtype: bool + """ + return self._tag == "w256h256" + + def is_w480h320(self): + """ + Check if the union tag is ``w480h320``. + + :rtype: bool + """ + return self._tag == "w480h320" + + def is_w640h480(self): + """ + Check if the union tag is ``w640h480``. + + :rtype: bool + """ + return self._tag == "w640h480" + + def is_w960h640(self): + """ + Check if the union tag is ``w960h640``. + + :rtype: bool + """ + return self._tag == "w960h640" + + def is_w1024h768(self): + """ + Check if the union tag is ``w1024h768``. + + :rtype: bool + """ + return self._tag == "w1024h768" + + def is_w2048h1536(self): + """ + Check if the union tag is ``w2048h1536``. + + :rtype: bool + """ + return self._tag == "w2048h1536" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ThumbnailSize, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +ThumbnailSize_validator = bv.Union(ThumbnailSize) + + +class TimestampLevel(bb.Union): + """ + Granularity of the time offsets returned for each transcript segment. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar TimestampLevel.sentence: + One segment per spoken sentence (recommended). This is the default when + ``GetTranscriptArgs.timestamp_level`` is omitted. + :ivar TimestampLevel.word: + One segment per word, useful for fine-grained alignment such as + captioning or highlight-as-you-listen experiences. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + sentence = None + # Attribute is overwritten below the class definition + word = None + # Attribute is overwritten below the class definition + other = None + + def is_sentence(self): + """ + Check if the union tag is ``sentence``. + + :rtype: bool + """ + return self._tag == "sentence" + + def is_word(self): + """ + Check if the union tag is ``word``. + + :rtype: bool + """ + return self._tag == "word" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(TimestampLevel, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +TimestampLevel_validator = bv.Union(TimestampLevel) + + +class TransformApiV2Error(bb.Union): + """ + Reason a transform job failed. Returned in the `failed` variant of + `GetTransformAsyncCheckResult`, and by `download_transform_output`. This is + a semantic error union: the HTTP status of the poll request itself is + unaffected (a poll that surfaces a failed job is still a normal successful + poll response). Callers should branch on the variant. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar TransformApiV2Error.server_error: + An unexpected, typically transient, server-side failure. The string is a + human-readable message; retrying with backoff may succeed. + :vartype TransformApiV2Error.server_error: str + :ivar TransformApiV2Error.user_error: + The request could not be processed as supplied (a problem with the + caller's input). The string is a human-readable message; retrying the + same request will not help. + :vartype TransformApiV2Error.user_error: str + :ivar TransformApiV2Error.unsupported_format_error: + The source file is not in a format the requested `transform_type` can + convert. + :ivar TransformApiV2Error.link_download_disabled_error: + `FileIdOrUrl.url` referenced a Dropbox shared link whose owner has + disabled downloads. + :ivar TransformApiV2Error.shared_link_password_protected: + `FileIdOrUrl.url` referenced a password-protected Dropbox shared link. + Riviera cannot supply the password, so such links cannot be transformed. + :ivar TransformApiV2Error.limit_exceeded_error: + A resource limit was exceeded while producing the result -- for example + the source file is larger than the requested transform accepts. + :ivar TransformApiV2Error.conversion_failure_error: + The source file was readable but could not be converted, for example + because it is corrupt. + :ivar TransformApiV2Error.not_found_error: + The referenced file does not exist or is not accessible. + :ivar TransformApiV2Error.is_a_folder_error: + The target is a folder, not a file. + :ivar TransformApiV2Error.invalid_options_error: + `transform_type` was missing, or the supplied options did not match the + requested transform type, or an option was out of range. The request is + malformed; fix it rather than retrying it. + :ivar TransformApiV2Error.expired_handle_error: + The `output_handle` presented to `download_transform_output` has passed + its `TransformOutput.expires_ts`. Request the transform again to get a + fresh handle. Only `download_transform_output` produces this; a poll + never does. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + unsupported_format_error = None + # Attribute is overwritten below the class definition + link_download_disabled_error = None + # Attribute is overwritten below the class definition + shared_link_password_protected = None + # Attribute is overwritten below the class definition + limit_exceeded_error = None + # Attribute is overwritten below the class definition + conversion_failure_error = None + # Attribute is overwritten below the class definition + not_found_error = None + # Attribute is overwritten below the class definition + is_a_folder_error = None + # Attribute is overwritten below the class definition + invalid_options_error = None + # Attribute is overwritten below the class definition + expired_handle_error = None + # Attribute is overwritten below the class definition + other = None + + @classmethod + def server_error(cls, val): + """ + Create an instance of this class set to the ``server_error`` tag with + value ``val``. + + :param str val: + :rtype: TransformApiV2Error + """ + return cls("server_error", val) + + @classmethod + def user_error(cls, val): + """ + Create an instance of this class set to the ``user_error`` tag with + value ``val``. + + :param str val: + :rtype: TransformApiV2Error + """ + return cls("user_error", val) + + def is_server_error(self): + """ + Check if the union tag is ``server_error``. + + :rtype: bool + """ + return self._tag == "server_error" + + def is_user_error(self): + """ + Check if the union tag is ``user_error``. + + :rtype: bool + """ + return self._tag == "user_error" + + def is_unsupported_format_error(self): + """ + Check if the union tag is ``unsupported_format_error``. + + :rtype: bool + """ + return self._tag == "unsupported_format_error" + + def is_link_download_disabled_error(self): + """ + Check if the union tag is ``link_download_disabled_error``. + + :rtype: bool + """ + return self._tag == "link_download_disabled_error" + + def is_shared_link_password_protected(self): + """ + Check if the union tag is ``shared_link_password_protected``. + + :rtype: bool + """ + return self._tag == "shared_link_password_protected" + + def is_limit_exceeded_error(self): + """ + Check if the union tag is ``limit_exceeded_error``. + + :rtype: bool + """ + return self._tag == "limit_exceeded_error" + + def is_conversion_failure_error(self): + """ + Check if the union tag is ``conversion_failure_error``. + + :rtype: bool + """ + return self._tag == "conversion_failure_error" + + def is_not_found_error(self): + """ + Check if the union tag is ``not_found_error``. + + :rtype: bool + """ + return self._tag == "not_found_error" + + def is_is_a_folder_error(self): + """ + Check if the union tag is ``is_a_folder_error``. + + :rtype: bool + """ + return self._tag == "is_a_folder_error" + + def is_invalid_options_error(self): + """ + Check if the union tag is ``invalid_options_error``. + + :rtype: bool + """ + return self._tag == "invalid_options_error" + + def is_expired_handle_error(self): + """ + Check if the union tag is ``expired_handle_error``. + + :rtype: bool + """ + return self._tag == "expired_handle_error" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def get_server_error(self): + """ + An unexpected, typically transient, server-side failure. The string is a + human-readable message; retrying with backoff may succeed. + + Only call this if :meth:`is_server_error` is true. + + :rtype: str + """ + if not self.is_server_error(): + raise AttributeError("tag 'server_error' not set") + return self._value + + def get_user_error(self): + """ + The request could not be processed as supplied (a problem with the + caller's input). The string is a human-readable message; retrying the + same request will not help. + + Only call this if :meth:`is_user_error` is true. + + :rtype: str + """ + if not self.is_user_error(): + raise AttributeError("tag 'user_error' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(TransformApiV2Error, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +TransformApiV2Error_validator = bv.Union(TransformApiV2Error) + + +class TransformArgs(bb.Struct): + """ + Arguments for the asynchronous `get_transform_async` route. Exactly one of + `file_id`, `path`, or `url` must be supplied via `file_id_or_url` to + identify the source file, and exactly one variant of `transform_type` must + be set to say what to produce from it. At most one options message may be + set, and it must be the one belonging to the requested `transform_type`. + Options that belong to a different transform type are rejected with + `invalid_options_error` rather than ignored, so that a request whose + parameters were misassembled fails visibly instead of quietly producing the + wrong output. + + :ivar TransformArgs.file_id_or_url: + Identifier of the source file to transform. Callers must set exactly one + of the `FileIdOrUrl` variants. The referenced file must be in a format + the requested `transform_type` supports; see the route description for + the per-transform format lists. Requests against unsupported formats + fail with `unsupported_format_error`. + :ivar TransformArgs.transform_type: + What to produce from the source file. Required. + :ivar TransformArgs.thumbnail: + Options for `TransformType.thumbnail`. + :ivar TransformArgs.image: + Options for `TransformType.image` and `TransformType.image_pdf`. + :ivar TransformArgs.video_frame: + Options for `TransformType.video_frame`. + """ + + __slots__ = [ + "_file_id_or_url_value", + "_transform_type_value", + "_thumbnail_value", + "_image_value", + "_video_frame_value", + ] + + _has_required_fields = True + + def __init__( + self, transform_type=None, file_id_or_url=None, thumbnail=None, image=None, video_frame=None + ): + self._file_id_or_url_value = bb.NOT_SET + self._transform_type_value = bb.NOT_SET + self._thumbnail_value = bb.NOT_SET + self._image_value = bb.NOT_SET + self._video_frame_value = bb.NOT_SET + if file_id_or_url is not None: + self.file_id_or_url = file_id_or_url + if transform_type is not None: + self.transform_type = transform_type + if thumbnail is not None: + self.thumbnail = thumbnail + if image is not None: + self.image = image + if video_frame is not None: + self.video_frame = video_frame + + # Instance attribute type: FileIdOrUrl (validator is set below) + file_id_or_url = bb.Attribute("file_id_or_url", nullable=True, user_defined=True) + + # Instance attribute type: TransformType (validator is set below) + transform_type = bb.Attribute("transform_type", user_defined=True) + + # Instance attribute type: ThumbnailOptions (validator is set below) + thumbnail = bb.Attribute("thumbnail", nullable=True, user_defined=True) + + # Instance attribute type: ImageOptions (validator is set below) + image = bb.Attribute("image", nullable=True, user_defined=True) + + # Instance attribute type: VideoFrameOptions (validator is set below) + video_frame = bb.Attribute("video_frame", nullable=True, user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(TransformArgs, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +TransformArgs_validator = bv.Struct(TransformArgs) + + +class TransformOutput(bb.Struct): + """ + A completed transform: a handle for retrieving the produced bytes, plus + enough metadata to decide whether to retrieve them. The bytes themselves are + deliberately not carried here. A completed async result is persisted, so it + is bounded by a row-size limit well below the size of a typical converted + document -- an inline payload would fail for exactly the large documents + this route exists to convert. The transform therefore completes by caching + its output and handing back `output_handle`, which + `download_transform_output` exchanges for the bytes. + + :ivar TransformOutput.output_handle: + Opaque, single-purpose handle for the produced bytes. Pass it to + `download_transform_output` to retrieve them. The handle is scoped to + the account that created it and cannot be used to read anything other + than the output of this transform. It is not a URL and carries no + meaning for callers beyond being passed back verbatim. + :ivar TransformOutput.size: + Size of the produced output in bytes. + :ivar TransformOutput.format: + Format of the produced output, as a short lowercase format name such as + "pdf", "html", "jpeg", or "png". This reflects what was actually + produced, which for some sources differs from what was requested. + :ivar TransformOutput.mime_type: + MIME type corresponding to `format`, for callers that need a + Content-Type to hand to a downstream consumer. + :ivar TransformOutput.expires_ts: + Unix timestamp, in seconds, after which `output_handle` is no longer + accepted. Retrieve the bytes before this point; after it, + `download_transform_output` reports `expired_handle_error` and the + transform has to be requested again. + """ + + __slots__ = [ + "_output_handle_value", + "_size_value", + "_format_value", + "_mime_type_value", + "_expires_ts_value", + ] + + _has_required_fields = False + + def __init__(self, output_handle=None, size=None, format=None, mime_type=None, expires_ts=None): + self._output_handle_value = bb.NOT_SET + self._size_value = bb.NOT_SET + self._format_value = bb.NOT_SET + self._mime_type_value = bb.NOT_SET + self._expires_ts_value = bb.NOT_SET + if output_handle is not None: + self.output_handle = output_handle + if size is not None: + self.size = size + if format is not None: + self.format = format + if mime_type is not None: + self.mime_type = mime_type + if expires_ts is not None: + self.expires_ts = expires_ts + + # Instance attribute type: str (validator is set below) + output_handle = bb.Attribute("output_handle") + + # Instance attribute type: int (validator is set below) + size = bb.Attribute("size") + + # Instance attribute type: str (validator is set below) + format = bb.Attribute("format") + + # Instance attribute type: str (validator is set below) + mime_type = bb.Attribute("mime_type") + + # Instance attribute type: int (validator is set below) + expires_ts = bb.Attribute("expires_ts") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(TransformOutput, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +TransformOutput_validator = bv.Struct(TransformOutput) + + +class TransformType(bb.Union): + """ + Which derived file to produce from the source file. Unlike the other Riviera + content routes, which each expose one capability, `get_transform_async` is a + single route over many conversions: the caller names the source file and the + output it wants, and the service picks the conversion pipeline. Exactly one + variant must be set; a request with none set fails with + `invalid_options_error`. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar TransformType.pdf: + Convert the source document to PDF. Supported for word-processing, + presentation, and spreadsheet documents; images are not accepted. + :ivar TransformType.html: + Convert the source document to HTML. Supported for spreadsheets only, + where HTML preserves the sheet layout that a PDF rendering flattens. + :ivar TransformType.image: + Re-encode the source as a web-safe raster image (JPEG or PNG). This is + the transform to use to normalize formats a browser cannot display + directly -- HEIC, camera RAW, PSD, SVG -- and to render a single page of + a document as an image. Formats a browser can already display, such as + JPEG and PNG, are not accepted; use `thumbnail` to resize or re-encode + those. Configured by `TransformArgs.image`. + :ivar TransformType.thumbnail: + Produce a resized thumbnail of the source at one of the supported sizes. + Configured by `TransformArgs.thumbnail`. + :ivar TransformType.image_pdf: + Render the source as a page image by way of a PDF conversion, rather + than by whichever image pipeline the source format would otherwise use. + Prefer `image` unless you specifically need the PDF-rendered result; the + two differ for formats that have a native image pipeline of their own + (ebooks, for example). Configured by `TransformArgs.image`. + :ivar TransformType.video_frame: + Extract a single frame from a video as a still image. Configured by + `TransformArgs.video_frame`. This produces one frame at one requested + offset. To get the set of scene-change keyframes across a whole video, + use `get_keyframes_async`, which returns every detected frame with its + timestamp and scene score. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + pdf = None + # Attribute is overwritten below the class definition + html = None + # Attribute is overwritten below the class definition + image = None + # Attribute is overwritten below the class definition + thumbnail = None + # Attribute is overwritten below the class definition + image_pdf = None + # Attribute is overwritten below the class definition + video_frame = None + # Attribute is overwritten below the class definition + other = None + + def is_pdf(self): + """ + Check if the union tag is ``pdf``. + + :rtype: bool + """ + return self._tag == "pdf" + + def is_html(self): + """ + Check if the union tag is ``html``. + + :rtype: bool + """ + return self._tag == "html" + + def is_image(self): + """ + Check if the union tag is ``image``. + + :rtype: bool + """ + return self._tag == "image" + + def is_thumbnail(self): + """ + Check if the union tag is ``thumbnail``. + + :rtype: bool + """ + return self._tag == "thumbnail" + + def is_image_pdf(self): + """ + Check if the union tag is ``image_pdf``. + + :rtype: bool + """ + return self._tag == "image_pdf" + + def is_video_frame(self): + """ + Check if the union tag is ``video_frame``. + + :rtype: bool + """ + return self._tag == "video_frame" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(TransformType, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +TransformType_validator = bv.Union(TransformType) + + +class VideoFrameOptions(bb.Struct): + """ + Options for `TransformType.video_frame`. Supplying this message with any + other transform type fails with `invalid_options_error`. + + :ivar VideoFrameOptions.offset_in_seconds: + Offset into the video, in seconds, of the frame to extract. Should be + within the video's duration. Defaults to 0 (the first frame) when + omitted. Only the lower bound is enforced, because the upper bound is + the source's duration, which is not known until the video is opened. An + offset past the end is not rejected. + :ivar VideoFrameOptions.scale_percent: + Scale the extracted frame to this percentage of the video's natural + frame size. Must be in (0, 100]; the pipeline does not upscale. Defaults + to 100 (no scaling) when omitted. + """ + + __slots__ = [ + "_offset_in_seconds_value", + "_scale_percent_value", + ] + + _has_required_fields = False + + def __init__(self, offset_in_seconds=None, scale_percent=None): + self._offset_in_seconds_value = bb.NOT_SET + self._scale_percent_value = bb.NOT_SET + if offset_in_seconds is not None: + self.offset_in_seconds = offset_in_seconds + if scale_percent is not None: + self.scale_percent = scale_percent + + # Instance attribute type: float (validator is set below) + offset_in_seconds = bb.Attribute("offset_in_seconds") + + # Instance attribute type: int (validator is set below) + scale_percent = bb.Attribute("scale_percent") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(VideoFrameOptions, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +VideoFrameOptions_validator = bv.Struct(VideoFrameOptions) + + +class MetadataUnion(bb.Union): + """ + The extracted metadata. Exactly one variant is populated, corresponding to + ``GetMetadataResult.metadata_type``. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar MetadataUnion.exif: + EXIF metadata, for image files. + :vartype MetadataUnion.exif: ApiExifMetadata + :ivar MetadataUnion.media: + Container and per-stream metadata, for audio and video files. + :vartype MetadataUnion.media: ApiMediaMetadata + :ivar MetadataUnion.pdf: + Document metadata, for PDFs. + :vartype MetadataUnion.pdf: ApiPdfMetadata + :ivar MetadataUnion.office: + Document metadata, for MS Office files. + :vartype MetadataUnion.office: ApiOfficeMetadata + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + other = None + + @classmethod + def exif(cls, val): + """ + Create an instance of this class set to the ``exif`` tag with value + ``val``. + + :param ApiExifMetadata val: + :rtype: MetadataUnion + """ + return cls("exif", val) + + @classmethod + def media(cls, val): + """ + Create an instance of this class set to the ``media`` tag with value + ``val``. + + :param ApiMediaMetadata val: + :rtype: MetadataUnion + """ + return cls("media", val) + + @classmethod + def pdf(cls, val): + """ + Create an instance of this class set to the ``pdf`` tag with value + ``val``. + + :param ApiPdfMetadata val: + :rtype: MetadataUnion + """ + return cls("pdf", val) + + @classmethod + def office(cls, val): + """ + Create an instance of this class set to the ``office`` tag with value + ``val``. + + :param ApiOfficeMetadata val: + :rtype: MetadataUnion + """ + return cls("office", val) + + def is_exif(self): + """ + Check if the union tag is ``exif``. + + :rtype: bool + """ + return self._tag == "exif" + + def is_media(self): + """ + Check if the union tag is ``media``. + + :rtype: bool + """ + return self._tag == "media" + + def is_pdf(self): + """ + Check if the union tag is ``pdf``. + + :rtype: bool + """ + return self._tag == "pdf" + + def is_office(self): + """ + Check if the union tag is ``office``. + + :rtype: bool + """ + return self._tag == "office" def is_other(self): """ @@ -4066,6 +5213,28 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ContentApiV2Error.is_a_folder_error = ContentApiV2Error("is_a_folder_error") ContentApiV2Error.other = ContentApiV2Error("other") +DownloadTransformOutputArgs.output_handle.validator = bv.String() +DownloadTransformOutputArgs._all_field_names_ = set(["output_handle"]) +DownloadTransformOutputArgs._all_fields_ = [ + ("output_handle", DownloadTransformOutputArgs.output_handle.validator) +] + +DownloadTransformOutputResult.size.validator = bv.UInt64() +DownloadTransformOutputResult.format.validator = bv.String() +DownloadTransformOutputResult.mime_type.validator = bv.String() +DownloadTransformOutputResult._all_field_names_ = set( + [ + "size", + "format", + "mime_type", + ] +) +DownloadTransformOutputResult._all_fields_ = [ + ("size", DownloadTransformOutputResult.size.validator), + ("format", DownloadTransformOutputResult.format.validator), + ("mime_type", DownloadTransformOutputResult.mime_type.validator), +] + FileIdOrUrl._file_id_validator = bv.String() FileIdOrUrl._url_validator = bv.String() FileIdOrUrl._path_validator = bv.String() @@ -4270,6 +5439,33 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ("structured_transcript", GetTranscriptResult.structured_transcript.validator) ] +GetTransformAsyncCheckResult._in_progress_validator = bv.Void() +GetTransformAsyncCheckResult._complete_validator = TransformOutput_validator +GetTransformAsyncCheckResult._failed_validator = TransformApiV2Error_validator +GetTransformAsyncCheckResult._other_validator = bv.Void() +GetTransformAsyncCheckResult._tagmap = { + "in_progress": GetTransformAsyncCheckResult._in_progress_validator, + "complete": GetTransformAsyncCheckResult._complete_validator, + "failed": GetTransformAsyncCheckResult._failed_validator, + "other": GetTransformAsyncCheckResult._other_validator, +} + +GetTransformAsyncCheckResult.in_progress = GetTransformAsyncCheckResult("in_progress") +GetTransformAsyncCheckResult.other = GetTransformAsyncCheckResult("other") + +ImageOptions.page_number.validator = bv.UInt32(min_value=1) +ImageOptions.scale_percent.validator = bv.UInt32(min_value=1, max_value=100) +ImageOptions._all_field_names_ = set( + [ + "page_number", + "scale_percent", + ] +) +ImageOptions._all_fields_ = [ + ("page_number", ImageOptions.page_number.validator), + ("scale_percent", ImageOptions.scale_percent.validator), +] + KeyframesExtractionApiV2Error._server_error_validator = bv.String() KeyframesExtractionApiV2Error._user_error_validator = bv.String() KeyframesExtractionApiV2Error._unsupported_format_error_validator = bv.Void() @@ -4521,6 +5717,91 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): TextExtractionApiV2Error.is_a_folder_error = TextExtractionApiV2Error("is_a_folder_error") TextExtractionApiV2Error.other = TextExtractionApiV2Error("other") +ThumbnailFormat._jpeg_validator = bv.Void() +ThumbnailFormat._png_validator = bv.Void() +ThumbnailFormat._webp_validator = bv.Void() +ThumbnailFormat._other_validator = bv.Void() +ThumbnailFormat._tagmap = { + "jpeg": ThumbnailFormat._jpeg_validator, + "png": ThumbnailFormat._png_validator, + "webp": ThumbnailFormat._webp_validator, + "other": ThumbnailFormat._other_validator, +} + +ThumbnailFormat.jpeg = ThumbnailFormat("jpeg") +ThumbnailFormat.png = ThumbnailFormat("png") +ThumbnailFormat.webp = ThumbnailFormat("webp") +ThumbnailFormat.other = ThumbnailFormat("other") + +ThumbnailMode._strict_validator = bv.Void() +ThumbnailMode._bestfit_validator = bv.Void() +ThumbnailMode._fitone_bestfit_validator = bv.Void() +ThumbnailMode._original_validator = bv.Void() +ThumbnailMode._other_validator = bv.Void() +ThumbnailMode._tagmap = { + "strict": ThumbnailMode._strict_validator, + "bestfit": ThumbnailMode._bestfit_validator, + "fitone_bestfit": ThumbnailMode._fitone_bestfit_validator, + "original": ThumbnailMode._original_validator, + "other": ThumbnailMode._other_validator, +} + +ThumbnailMode.strict = ThumbnailMode("strict") +ThumbnailMode.bestfit = ThumbnailMode("bestfit") +ThumbnailMode.fitone_bestfit = ThumbnailMode("fitone_bestfit") +ThumbnailMode.original = ThumbnailMode("original") +ThumbnailMode.other = ThumbnailMode("other") + +ThumbnailOptions.size.validator = ThumbnailSize_validator +ThumbnailOptions.mode.validator = ThumbnailMode_validator +ThumbnailOptions.format.validator = ThumbnailFormat_validator +ThumbnailOptions._all_field_names_ = set( + [ + "size", + "mode", + "format", + ] +) +ThumbnailOptions._all_fields_ = [ + ("size", ThumbnailOptions.size.validator), + ("mode", ThumbnailOptions.mode.validator), + ("format", ThumbnailOptions.format.validator), +] + +ThumbnailSize._w32h32_validator = bv.Void() +ThumbnailSize._w64h64_validator = bv.Void() +ThumbnailSize._w128h128_validator = bv.Void() +ThumbnailSize._w256h256_validator = bv.Void() +ThumbnailSize._w480h320_validator = bv.Void() +ThumbnailSize._w640h480_validator = bv.Void() +ThumbnailSize._w960h640_validator = bv.Void() +ThumbnailSize._w1024h768_validator = bv.Void() +ThumbnailSize._w2048h1536_validator = bv.Void() +ThumbnailSize._other_validator = bv.Void() +ThumbnailSize._tagmap = { + "w32h32": ThumbnailSize._w32h32_validator, + "w64h64": ThumbnailSize._w64h64_validator, + "w128h128": ThumbnailSize._w128h128_validator, + "w256h256": ThumbnailSize._w256h256_validator, + "w480h320": ThumbnailSize._w480h320_validator, + "w640h480": ThumbnailSize._w640h480_validator, + "w960h640": ThumbnailSize._w960h640_validator, + "w1024h768": ThumbnailSize._w1024h768_validator, + "w2048h1536": ThumbnailSize._w2048h1536_validator, + "other": ThumbnailSize._other_validator, +} + +ThumbnailSize.w32h32 = ThumbnailSize("w32h32") +ThumbnailSize.w64h64 = ThumbnailSize("w64h64") +ThumbnailSize.w128h128 = ThumbnailSize("w128h128") +ThumbnailSize.w256h256 = ThumbnailSize("w256h256") +ThumbnailSize.w480h320 = ThumbnailSize("w480h320") +ThumbnailSize.w640h480 = ThumbnailSize("w640h480") +ThumbnailSize.w960h640 = ThumbnailSize("w960h640") +ThumbnailSize.w1024h768 = ThumbnailSize("w1024h768") +ThumbnailSize.w2048h1536 = ThumbnailSize("w2048h1536") +ThumbnailSize.other = ThumbnailSize("other") + TimestampLevel._sentence_validator = bv.Void() TimestampLevel._word_validator = bv.Void() TimestampLevel._other_validator = bv.Void() @@ -4534,6 +5815,130 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): TimestampLevel.word = TimestampLevel("word") TimestampLevel.other = TimestampLevel("other") +TransformApiV2Error._server_error_validator = bv.String() +TransformApiV2Error._user_error_validator = bv.String() +TransformApiV2Error._unsupported_format_error_validator = bv.Void() +TransformApiV2Error._link_download_disabled_error_validator = bv.Void() +TransformApiV2Error._shared_link_password_protected_validator = bv.Void() +TransformApiV2Error._limit_exceeded_error_validator = bv.Void() +TransformApiV2Error._conversion_failure_error_validator = bv.Void() +TransformApiV2Error._not_found_error_validator = bv.Void() +TransformApiV2Error._is_a_folder_error_validator = bv.Void() +TransformApiV2Error._invalid_options_error_validator = bv.Void() +TransformApiV2Error._expired_handle_error_validator = bv.Void() +TransformApiV2Error._other_validator = bv.Void() +TransformApiV2Error._tagmap = { + "server_error": TransformApiV2Error._server_error_validator, + "user_error": TransformApiV2Error._user_error_validator, + "unsupported_format_error": TransformApiV2Error._unsupported_format_error_validator, + "link_download_disabled_error": TransformApiV2Error._link_download_disabled_error_validator, + "shared_link_password_protected": TransformApiV2Error._shared_link_password_protected_validator, + "limit_exceeded_error": TransformApiV2Error._limit_exceeded_error_validator, + "conversion_failure_error": TransformApiV2Error._conversion_failure_error_validator, + "not_found_error": TransformApiV2Error._not_found_error_validator, + "is_a_folder_error": TransformApiV2Error._is_a_folder_error_validator, + "invalid_options_error": TransformApiV2Error._invalid_options_error_validator, + "expired_handle_error": TransformApiV2Error._expired_handle_error_validator, + "other": TransformApiV2Error._other_validator, +} + +TransformApiV2Error.unsupported_format_error = TransformApiV2Error("unsupported_format_error") +TransformApiV2Error.link_download_disabled_error = TransformApiV2Error( + "link_download_disabled_error" +) +TransformApiV2Error.shared_link_password_protected = TransformApiV2Error( + "shared_link_password_protected" +) +TransformApiV2Error.limit_exceeded_error = TransformApiV2Error("limit_exceeded_error") +TransformApiV2Error.conversion_failure_error = TransformApiV2Error("conversion_failure_error") +TransformApiV2Error.not_found_error = TransformApiV2Error("not_found_error") +TransformApiV2Error.is_a_folder_error = TransformApiV2Error("is_a_folder_error") +TransformApiV2Error.invalid_options_error = TransformApiV2Error("invalid_options_error") +TransformApiV2Error.expired_handle_error = TransformApiV2Error("expired_handle_error") +TransformApiV2Error.other = TransformApiV2Error("other") + +TransformArgs.file_id_or_url.validator = bv.Nullable(FileIdOrUrl_validator) +TransformArgs.transform_type.validator = TransformType_validator +TransformArgs.thumbnail.validator = bv.Nullable(ThumbnailOptions_validator) +TransformArgs.image.validator = bv.Nullable(ImageOptions_validator) +TransformArgs.video_frame.validator = bv.Nullable(VideoFrameOptions_validator) +TransformArgs._all_field_names_ = set( + [ + "file_id_or_url", + "transform_type", + "thumbnail", + "image", + "video_frame", + ] +) +TransformArgs._all_fields_ = [ + ("file_id_or_url", TransformArgs.file_id_or_url.validator), + ("transform_type", TransformArgs.transform_type.validator), + ("thumbnail", TransformArgs.thumbnail.validator), + ("image", TransformArgs.image.validator), + ("video_frame", TransformArgs.video_frame.validator), +] + +TransformOutput.output_handle.validator = bv.String() +TransformOutput.size.validator = bv.UInt64() +TransformOutput.format.validator = bv.String() +TransformOutput.mime_type.validator = bv.String() +TransformOutput.expires_ts.validator = bv.UInt64() +TransformOutput._all_field_names_ = set( + [ + "output_handle", + "size", + "format", + "mime_type", + "expires_ts", + ] +) +TransformOutput._all_fields_ = [ + ("output_handle", TransformOutput.output_handle.validator), + ("size", TransformOutput.size.validator), + ("format", TransformOutput.format.validator), + ("mime_type", TransformOutput.mime_type.validator), + ("expires_ts", TransformOutput.expires_ts.validator), +] + +TransformType._pdf_validator = bv.Void() +TransformType._html_validator = bv.Void() +TransformType._image_validator = bv.Void() +TransformType._thumbnail_validator = bv.Void() +TransformType._image_pdf_validator = bv.Void() +TransformType._video_frame_validator = bv.Void() +TransformType._other_validator = bv.Void() +TransformType._tagmap = { + "pdf": TransformType._pdf_validator, + "html": TransformType._html_validator, + "image": TransformType._image_validator, + "thumbnail": TransformType._thumbnail_validator, + "image_pdf": TransformType._image_pdf_validator, + "video_frame": TransformType._video_frame_validator, + "other": TransformType._other_validator, +} + +TransformType.pdf = TransformType("pdf") +TransformType.html = TransformType("html") +TransformType.image = TransformType("image") +TransformType.thumbnail = TransformType("thumbnail") +TransformType.image_pdf = TransformType("image_pdf") +TransformType.video_frame = TransformType("video_frame") +TransformType.other = TransformType("other") + +VideoFrameOptions.offset_in_seconds.validator = bv.Float64(min_value=0.0) +VideoFrameOptions.scale_percent.validator = bv.UInt32(min_value=1, max_value=100) +VideoFrameOptions._all_field_names_ = set( + [ + "offset_in_seconds", + "scale_percent", + ] +) +VideoFrameOptions._all_fields_ = [ + ("offset_in_seconds", VideoFrameOptions.offset_in_seconds.validator), + ("scale_percent", VideoFrameOptions.scale_percent.validator), +] + MetadataUnion._exif_validator = ApiExifMetadata_validator MetadataUnion._media_validator = ApiMediaMetadata_validator MetadataUnion._pdf_validator = ApiPdfMetadata_validator @@ -4608,6 +6013,9 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ApiTranscriptSegment.text.default = "" ApiTranscriptSegment.start_time.default = 0.0 ApiTranscriptSegment.end_time.default = 0.0 +DownloadTransformOutputResult.size.default = 0 +DownloadTransformOutputResult.format.default = "" +DownloadTransformOutputResult.mime_type.default = "" GetKeyframesArgs.scene_change_threshold.default = 0.0 GetKeyframesArgs.include_images.default = False GetMarkdownArgs.enable_ocr.default = False @@ -4620,7 +6028,28 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): GetTranscriptArgs.timestamp_level.default = TimestampLevel.sentence GetTranscriptArgs.included_special_words.default = "" GetTranscriptArgs.audio_language.default = "" +ImageOptions.page_number.default = 1 +ImageOptions.scale_percent.default = 100 MediaDurationError.limit.default = 0 +ThumbnailOptions.size.default = ThumbnailSize.w64h64 +ThumbnailOptions.mode.default = ThumbnailMode.strict +ThumbnailOptions.format.default = ThumbnailFormat.jpeg +TransformOutput.output_handle.default = "" +TransformOutput.size.default = 0 +TransformOutput.format.default = "" +TransformOutput.mime_type.default = "" +TransformOutput.expires_ts.default = 0 +VideoFrameOptions.offset_in_seconds.default = 0.0 +VideoFrameOptions.scale_percent.default = 100 +download_transform_output = bb.Route( + "download_transform_output", + 1, + False, + DownloadTransformOutputArgs_validator, + DownloadTransformOutputResult_validator, + TransformApiV2Error_validator, + {"auth": "app, user", "host": "content", "style": "download"}, +) get_keyframes_async = bb.Route( "get_keyframes_async", 1, @@ -4729,8 +6158,27 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): async_.PollError_validator, {"auth": "app, user", "host": "api", "style": "rpc"}, ) +get_transform_async = bb.Route( + "get_transform_async", + 1, + False, + TransformArgs_validator, + async_.LaunchResultBase_validator, + bv.Void(), + {"auth": "app, user", "host": "api", "style": "rpc"}, +) +get_transform_async_check = bb.Route( + "get_transform_async/check", + 1, + False, + async_.PollArg_validator, + GetTransformAsyncCheckResult_validator, + async_.PollError_validator, + {"auth": "app, user", "host": "api", "style": "rpc"}, +) ROUTES = { + "download_transform_output": download_transform_output, "get_keyframes_async": get_keyframes_async, "get_keyframes_async/check": get_keyframes_async_check, "get_markdown_async": get_markdown_async, @@ -4743,4 +6191,6 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): "get_text_async/check": get_text_async_check, "get_transcript_async": get_transcript_async, "get_transcript_async/check": get_transcript_async_check, + "get_transform_async": get_transform_async, + "get_transform_async/check": get_transform_async_check, } diff --git a/dropbox/sharing.py b/dropbox/sharing.py index 41c21e3..e143542 100644 --- a/dropbox/sharing.py +++ b/dropbox/sharing.py @@ -4596,6 +4596,10 @@ class LinkAudience(bb.Union): password is required to access the link. Login is not required. :ivar LinkAudience.members: Field is deprecated. Link is accessible only by members of the content. + :ivar LinkAudience.public_logged_in_only: + Link is accessible only by signed-in Dropbox users. This audience is + currently read-only through API v2: API v2 write methods reject requests + that set it. """ _catch_all = "other" @@ -4610,6 +4614,8 @@ class LinkAudience(bb.Union): # Attribute is overwritten below the class definition members = None # Attribute is overwritten below the class definition + public_logged_in_only = None + # Attribute is overwritten below the class definition other = None def is_public(self): @@ -4652,6 +4658,14 @@ def is_members(self): """ return self._tag == "members" + def is_public_logged_in_only(self): + """ + Check if the union tag is ``public_logged_in_only``. + + :rtype: bool + """ + return self._tag == "public_logged_in_only" + def is_other(self): """ Check if the union tag is ``other``. @@ -13747,6 +13761,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): LinkAudience._no_one_validator = bv.Void() LinkAudience._password_validator = bv.Void() LinkAudience._members_validator = bv.Void() +LinkAudience._public_logged_in_only_validator = bv.Void() LinkAudience._other_validator = bv.Void() LinkAudience._tagmap = { "public": LinkAudience._public_validator, @@ -13754,6 +13769,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): "no_one": LinkAudience._no_one_validator, "password": LinkAudience._password_validator, "members": LinkAudience._members_validator, + "public_logged_in_only": LinkAudience._public_logged_in_only_validator, "other": LinkAudience._other_validator, } @@ -13762,6 +13778,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): LinkAudience.no_one = LinkAudience("no_one") LinkAudience.password = LinkAudience("password") LinkAudience.members = LinkAudience("members") +LinkAudience.public_logged_in_only = LinkAudience("public_logged_in_only") LinkAudience.other = LinkAudience("other") VisibilityPolicyDisallowedReason._delete_and_recreate_validator = bv.Void() diff --git a/dropbox/team.py b/dropbox/team.py index bf6ea13..bd4d728 100644 --- a/dropbox/team.py +++ b/dropbox/team.py @@ -908,165 +908,31 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): BaseTeamFolderError_validator = bv.Union(BaseTeamFolderError) -class BulkSuspendArg(bb.Struct): - """ - Launches one action-specific bulk suspend job. - - :ivar BulkSuspendArg.members: - Must contain between 1 and 500 targets. The launch handler also rejects - duplicate client item IDs and duplicate member selectors. - """ - - __slots__ = [ - "_members_value", - ] - - _has_required_fields = True - - def __init__(self, members=None): - self._members_value = bb.NOT_SET - if members is not None: - self.members = members - - # Instance attribute type: list of [BulkSuspendMemberTarget] (validator is set below) - members = bb.Attribute("members") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendArg, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -BulkSuspendArg_validator = bv.Struct(BulkSuspendArg) - - -class BulkSuspendComplete(bb.Struct): - __slots__ = [ - "_requested_value", - "_suspended_value", - "_failed_value", - "_unknown_value", - "_report_delivery_value", - ] - - _has_required_fields = True - - def __init__( - self, requested=None, suspended=None, failed=None, unknown=None, report_delivery=None - ): - self._requested_value = bb.NOT_SET - self._suspended_value = bb.NOT_SET - self._failed_value = bb.NOT_SET - self._unknown_value = bb.NOT_SET - self._report_delivery_value = bb.NOT_SET - if requested is not None: - self.requested = requested - if suspended is not None: - self.suspended = suspended - if failed is not None: - self.failed = failed - if unknown is not None: - self.unknown = unknown - if report_delivery is not None: - self.report_delivery = report_delivery - - # Instance attribute type: int (validator is set below) - requested = bb.Attribute("requested") - - # Instance attribute type: int (validator is set below) - suspended = bb.Attribute("suspended") - - # Instance attribute type: int (validator is set below) - failed = bb.Attribute("failed") - - # Instance attribute type: int (validator is set below) - unknown = bb.Attribute("unknown") - - # Instance attribute type: BulkSuspendReportDeliveryStatus (validator is set below) - report_delivery = bb.Attribute("report_delivery", user_defined=True) - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendComplete, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -BulkSuspendComplete_validator = bv.Struct(BulkSuspendComplete) - - -class BulkSuspendError(bb.Union): +class CustomQuotaError(bb.Union): """ - A typed launch rejection. Authorization failures continue to use the API v2 - authentication/permission error surface. + Error returned when getting member custom quota. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. + + :ivar CustomQuotaError.too_many_users: + A maximum of 1000 users can be set for a single call. """ _catch_all = "other" # Attribute is overwritten below the class definition - invalid_request = None - # Attribute is overwritten below the class definition - too_many_members = None - # Attribute is overwritten below the class definition - duplicate_client_item_id = None - # Attribute is overwritten below the class definition - duplicate_team_member_id = None - # Attribute is overwritten below the class definition - acting_admin = None - # Attribute is overwritten below the class definition - last_admin = None + too_many_users = None # Attribute is overwritten below the class definition other = None - def is_invalid_request(self): - """ - Check if the union tag is ``invalid_request``. - - :rtype: bool - """ - return self._tag == "invalid_request" - - def is_too_many_members(self): - """ - Check if the union tag is ``too_many_members``. - - :rtype: bool - """ - return self._tag == "too_many_members" - - def is_duplicate_client_item_id(self): - """ - Check if the union tag is ``duplicate_client_item_id``. - - :rtype: bool - """ - return self._tag == "duplicate_client_item_id" - - def is_duplicate_team_member_id(self): - """ - Check if the union tag is ``duplicate_team_member_id``. - - :rtype: bool - """ - return self._tag == "duplicate_team_member_id" - - def is_acting_admin(self): - """ - Check if the union tag is ``acting_admin``. - - :rtype: bool - """ - return self._tag == "acting_admin" - - def is_last_admin(self): + def is_too_many_users(self): """ - Check if the union tag is ``last_admin``. + Check if the union tag is ``too_many_users``. :rtype: bool """ - return self._tag == "last_admin" + return self._tag == "too_many_users" def is_other(self): """ @@ -1077,22 +943,28 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendError, self)._process_custom_annotations( + super(CustomQuotaError, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendError_validator = bv.Union(BulkSuspendError) +CustomQuotaError_validator = bv.Union(CustomQuotaError) -class BulkSuspendJobStatus(async_.PollResultBase): +class CustomQuotaResult(bb.Union): """ - Coarse job state. Live row progress and report contents are intentionally - omitted; callers receive row details in the terminal email report. + User custom quota. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. + + :ivar CustomQuotaResult.success: + User's custom quota. + :vartype CustomQuotaResult.success: UserCustomQuotaResult + :ivar CustomQuotaResult.invalid_user: + Invalid user (not in team). + :vartype CustomQuotaResult.invalid_user: UserSelectorArg """ _catch_all = "other" @@ -1100,42 +972,42 @@ class BulkSuspendJobStatus(async_.PollResultBase): other = None @classmethod - def complete(cls, val): + def success(cls, val): """ - Create an instance of this class set to the ``complete`` tag with value + Create an instance of this class set to the ``success`` tag with value ``val``. - :param BulkSuspendComplete val: - :rtype: BulkSuspendJobStatus + :param UserCustomQuotaResult val: + :rtype: CustomQuotaResult """ - return cls("complete", val) + return cls("success", val) @classmethod - def failed(cls, val): + def invalid_user(cls, val): """ - Create an instance of this class set to the ``failed`` tag with value - ``val``. + Create an instance of this class set to the ``invalid_user`` tag with + value ``val``. - :param BulkSuspendTaskFailure val: - :rtype: BulkSuspendJobStatus + :param UserSelectorArg val: + :rtype: CustomQuotaResult """ - return cls("failed", val) + return cls("invalid_user", val) - def is_complete(self): + def is_success(self): """ - Check if the union tag is ``complete``. + Check if the union tag is ``success``. :rtype: bool """ - return self._tag == "complete" + return self._tag == "success" - def is_failed(self): + def is_invalid_user(self): """ - Check if the union tag is ``failed``. + Check if the union tag is ``invalid_user``. :rtype: bool """ - return self._tag == "failed" + return self._tag == "invalid_user" def is_other(self): """ @@ -1145,536 +1017,457 @@ def is_other(self): """ return self._tag == "other" - def get_complete(self): + def get_success(self): """ - Only call this if :meth:`is_complete` is true. + User's custom quota. + + Only call this if :meth:`is_success` is true. - :rtype: BulkSuspendComplete + :rtype: UserCustomQuotaResult """ - if not self.is_complete(): - raise AttributeError("tag 'complete' not set") + if not self.is_success(): + raise AttributeError("tag 'success' not set") return self._value - def get_failed(self): + def get_invalid_user(self): """ - Only call this if :meth:`is_failed` is true. + Invalid user (not in team). + + Only call this if :meth:`is_invalid_user` is true. - :rtype: BulkSuspendTaskFailure + :rtype: UserSelectorArg """ - if not self.is_failed(): - raise AttributeError("tag 'failed' not set") + if not self.is_invalid_user(): + raise AttributeError("tag 'invalid_user' not set") return self._value def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendJobStatus, self)._process_custom_annotations( + super(CustomQuotaResult, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendJobStatus_validator = bv.Union(BulkSuspendJobStatus) +CustomQuotaResult_validator = bv.Union(CustomQuotaResult) -class BulkSuspendMemberTarget(bb.Struct): +class CustomQuotaUsersArg(bb.Struct): """ - One member selected for suspension. The opaque client item ID correlates the - eventual report row with the caller's input without sending CSV data. + :ivar CustomQuotaUsersArg.users: + List of users. """ __slots__ = [ - "_client_item_id_value", - "_suspend_arg_value", + "_users_value", ] _has_required_fields = True - def __init__(self, client_item_id=None, suspend_arg=None): - self._client_item_id_value = bb.NOT_SET - self._suspend_arg_value = bb.NOT_SET - if client_item_id is not None: - self.client_item_id = client_item_id - if suspend_arg is not None: - self.suspend_arg = suspend_arg - - # Instance attribute type: str (validator is set below) - client_item_id = bb.Attribute("client_item_id") + def __init__(self, users=None): + self._users_value = bb.NOT_SET + if users is not None: + self.users = users - # Instance attribute type: MembersDeactivateArg (validator is set below) - suspend_arg = bb.Attribute("suspend_arg", user_defined=True) + # Instance attribute type: list of [UserSelectorArg] (validator is set below) + users = bb.Attribute("users") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendMemberTarget, self)._process_custom_annotations( + super(CustomQuotaUsersArg, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendMemberTarget_validator = bv.Struct(BulkSuspendMemberTarget) +CustomQuotaUsersArg_validator = bv.Struct(CustomQuotaUsersArg) -class BulkSuspendReportDeliveryStatus(bb.Union): +class DateRange(bb.Struct): """ - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. + Input arguments that can be provided for most reports. + + :ivar DateRange.start_date: + Optional starting date (inclusive). If start_date is None or too long + ago, this field will be set to 6 months ago. + :ivar DateRange.end_date: + Optional ending date (exclusive). """ - _catch_all = "other" - # Attribute is overwritten below the class definition - bulk_suspend_report_delivery_status_unspecified = None - # Attribute is overwritten below the class definition - bulk_suspend_report_delivery_status_pending = None - # Attribute is overwritten below the class definition - bulk_suspend_report_delivery_status_delivered = None - # Attribute is overwritten below the class definition - bulk_suspend_report_delivery_status_failed = None - # Attribute is overwritten below the class definition - other = None + __slots__ = [ + "_start_date_value", + "_end_date_value", + ] - def is_bulk_suspend_report_delivery_status_unspecified(self): - """ - Check if the union tag is ``bulk_suspend_report_delivery_status_unspecified``. + _has_required_fields = False - :rtype: bool - """ - return self._tag == "bulk_suspend_report_delivery_status_unspecified" - - def is_bulk_suspend_report_delivery_status_pending(self): - """ - Check if the union tag is ``bulk_suspend_report_delivery_status_pending``. - - :rtype: bool - """ - return self._tag == "bulk_suspend_report_delivery_status_pending" - - def is_bulk_suspend_report_delivery_status_delivered(self): - """ - Check if the union tag is ``bulk_suspend_report_delivery_status_delivered``. - - :rtype: bool - """ - return self._tag == "bulk_suspend_report_delivery_status_delivered" - - def is_bulk_suspend_report_delivery_status_failed(self): - """ - Check if the union tag is ``bulk_suspend_report_delivery_status_failed``. - - :rtype: bool - """ - return self._tag == "bulk_suspend_report_delivery_status_failed" + def __init__(self, start_date=None, end_date=None): + self._start_date_value = bb.NOT_SET + self._end_date_value = bb.NOT_SET + if start_date is not None: + self.start_date = start_date + if end_date is not None: + self.end_date = end_date - def is_other(self): - """ - Check if the union tag is ``other``. + # Instance attribute type: datetime.datetime (validator is set below) + start_date = bb.Attribute("start_date", nullable=True) - :rtype: bool - """ - return self._tag == "other" + # Instance attribute type: datetime.datetime (validator is set below) + end_date = bb.Attribute("end_date", nullable=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendReportDeliveryStatus, self)._process_custom_annotations( - annotation_type, field_path, processor - ) + super(DateRange, self)._process_custom_annotations(annotation_type, field_path, processor) -BulkSuspendReportDeliveryStatus_validator = bv.Union(BulkSuspendReportDeliveryStatus) +DateRange_validator = bv.Struct(DateRange) -class UserSelectorError(bb.Union): +class DateRangeError(bb.Union): """ - Error that can be returned whenever a struct derived from - :class:`UserSelectorArg` is used. + Errors that can originate from problems in input arguments to reports. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - - :ivar UserSelectorError.user_not_found: - No matching user found. The provided team_member_id, email, or - external_id does not exist on this team. """ - _catch_all = None + _catch_all = "other" # Attribute is overwritten below the class definition - user_not_found = None + other = None - def is_user_not_found(self): + def is_other(self): """ - Check if the union tag is ``user_not_found``. + Check if the union tag is ``other``. :rtype: bool """ - return self._tag == "user_not_found" + return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(UserSelectorError, self)._process_custom_annotations( + super(DateRangeError, self)._process_custom_annotations( annotation_type, field_path, processor ) -UserSelectorError_validator = bv.Union(UserSelectorError) +DateRangeError_validator = bv.Union(DateRangeError) -class MembersDeactivateError(UserSelectorError): +class DeleteSecondaryEmailResult(bb.Union): """ + Result of trying to delete a secondary email address. 'success' is the only + value indicating that a secondary email was successfully deleted. The other + values explain the type of error that occurred, and include the email for + which the error occurred. + This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar MembersDeactivateError.user_not_in_team: - The user is not a member of the team. + :ivar DeleteSecondaryEmailResult.success: + The secondary email was successfully deleted. + :vartype DeleteSecondaryEmailResult.success: str + :ivar DeleteSecondaryEmailResult.not_found: + The email address was not found for the user. + :vartype DeleteSecondaryEmailResult.not_found: str + :ivar DeleteSecondaryEmailResult.cannot_remove_primary: + The email address is the primary email address of the user, and cannot + be removed. + :vartype DeleteSecondaryEmailResult.cannot_remove_primary: str """ _catch_all = "other" # Attribute is overwritten below the class definition - user_not_in_team = None - # Attribute is overwritten below the class definition other = None - def is_user_not_in_team(self): + @classmethod + def success(cls, val): """ - Check if the union tag is ``user_not_in_team``. + Create an instance of this class set to the ``success`` tag with value + ``val``. - :rtype: bool + :param str val: + :rtype: DeleteSecondaryEmailResult """ - return self._tag == "user_not_in_team" + return cls("success", val) - def is_other(self): + @classmethod + def not_found(cls, val): """ - Check if the union tag is ``other``. + Create an instance of this class set to the ``not_found`` tag with value + ``val``. - :rtype: bool + :param str val: + :rtype: DeleteSecondaryEmailResult """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersDeactivateError, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -MembersDeactivateError_validator = bv.Union(MembersDeactivateError) - - -class MembersSuspendError(MembersDeactivateError): - """ - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. + return cls("not_found", val) - :ivar MembersSuspendError.suspend_inactive_user: - The user is not active, so it cannot be suspended. - :ivar MembersSuspendError.suspend_last_admin: - The user is the last admin of the team, so it cannot be suspended. - :ivar MembersSuspendError.team_license_limit: - Team is full. The organization has no available licenses. - """ + @classmethod + def cannot_remove_primary(cls, val): + """ + Create an instance of this class set to the ``cannot_remove_primary`` + tag with value ``val``. - # Attribute is overwritten below the class definition - suspend_inactive_user = None - # Attribute is overwritten below the class definition - suspend_last_admin = None - # Attribute is overwritten below the class definition - team_license_limit = None + :param str val: + :rtype: DeleteSecondaryEmailResult + """ + return cls("cannot_remove_primary", val) - def is_suspend_inactive_user(self): + def is_success(self): """ - Check if the union tag is ``suspend_inactive_user``. + Check if the union tag is ``success``. :rtype: bool """ - return self._tag == "suspend_inactive_user" + return self._tag == "success" - def is_suspend_last_admin(self): + def is_not_found(self): """ - Check if the union tag is ``suspend_last_admin``. + Check if the union tag is ``not_found``. :rtype: bool """ - return self._tag == "suspend_last_admin" + return self._tag == "not_found" - def is_team_license_limit(self): + def is_cannot_remove_primary(self): """ - Check if the union tag is ``team_license_limit``. + Check if the union tag is ``cannot_remove_primary``. :rtype: bool """ - return self._tag == "team_license_limit" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSuspendError, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -MembersSuspendError_validator = bv.Union(MembersSuspendError) + return self._tag == "cannot_remove_primary" + def is_other(self): + """ + Check if the union tag is ``other``. -class BulkSuspendRowFailure(MembersSuspendError): - """ - Stable machine-readable reasons used by the terminal row report. + :rtype: bool + """ + return self._tag == "other" - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. - """ + def get_success(self): + """ + The secondary email was successfully deleted. - # Attribute is overwritten below the class definition - protected_acting_admin = None - # Attribute is overwritten below the class definition - permission_changed = None - # Attribute is overwritten below the class definition - suspend_failed = None + Only call this if :meth:`is_success` is true. - def is_protected_acting_admin(self): + :rtype: str """ - Check if the union tag is ``protected_acting_admin``. + if not self.is_success(): + raise AttributeError("tag 'success' not set") + return self._value - :rtype: bool + def get_not_found(self): """ - return self._tag == "protected_acting_admin" + The email address was not found for the user. - def is_permission_changed(self): - """ - Check if the union tag is ``permission_changed``. + Only call this if :meth:`is_not_found` is true. - :rtype: bool + :rtype: str """ - return self._tag == "permission_changed" + if not self.is_not_found(): + raise AttributeError("tag 'not_found' not set") + return self._value - def is_suspend_failed(self): + def get_cannot_remove_primary(self): """ - Check if the union tag is ``suspend_failed``. + The email address is the primary email address of the user, and cannot + be removed. - :rtype: bool + Only call this if :meth:`is_cannot_remove_primary` is true. + + :rtype: str """ - return self._tag == "suspend_failed" + if not self.is_cannot_remove_primary(): + raise AttributeError("tag 'cannot_remove_primary' not set") + return self._value def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendRowFailure, self)._process_custom_annotations( + super(DeleteSecondaryEmailResult, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendRowFailure_validator = bv.Union(BulkSuspendRowFailure) +DeleteSecondaryEmailResult_validator = bv.Union(DeleteSecondaryEmailResult) -class BulkSuspendRowOutcome(bb.Union): +class DeleteSecondaryEmailsArg(bb.Struct): """ - The terminal outcome for one requested member. Row outcomes are delivered in - the report rather than embedded in the status response. - - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. + :ivar DeleteSecondaryEmailsArg.emails_to_delete: + List of users and their secondary emails to delete. """ - _catch_all = "other" - # Attribute is overwritten below the class definition - suspended = None - # Attribute is overwritten below the class definition - unknown = None - # Attribute is overwritten below the class definition - other = None + __slots__ = [ + "_emails_to_delete_value", + ] - @classmethod - def failed(cls, val): - """ - Create an instance of this class set to the ``failed`` tag with value - ``val``. + _has_required_fields = True - :param BulkSuspendRowFailure val: - :rtype: BulkSuspendRowOutcome - """ - return cls("failed", val) + def __init__(self, emails_to_delete=None): + self._emails_to_delete_value = bb.NOT_SET + if emails_to_delete is not None: + self.emails_to_delete = emails_to_delete - def is_suspended(self): - """ - Check if the union tag is ``suspended``. - - :rtype: bool - """ - return self._tag == "suspended" - - def is_failed(self): - """ - Check if the union tag is ``failed``. - - :rtype: bool - """ - return self._tag == "failed" - - def is_unknown(self): - """ - Check if the union tag is ``unknown``. - - :rtype: bool - """ - return self._tag == "unknown" - - def is_other(self): - """ - Check if the union tag is ``other``. - - :rtype: bool - """ - return self._tag == "other" - - def get_failed(self): - """ - Only call this if :meth:`is_failed` is true. - - :rtype: BulkSuspendRowFailure - """ - if not self.is_failed(): - raise AttributeError("tag 'failed' not set") - return self._value + # Instance attribute type: list of [UserSecondaryEmailsArg] (validator is set below) + emails_to_delete = bb.Attribute("emails_to_delete") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendRowOutcome, self)._process_custom_annotations( + super(DeleteSecondaryEmailsArg, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendRowOutcome_validator = bv.Union(BulkSuspendRowOutcome) - - -class BulkSuspendTaskFailure(bb.Union): - """ - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. - """ +DeleteSecondaryEmailsArg_validator = bv.Struct(DeleteSecondaryEmailsArg) - _catch_all = "other" - # Attribute is overwritten below the class definition - unusable_result = None - # Attribute is overwritten below the class definition - other = None - def is_unusable_result(self): - """ - Check if the union tag is ``unusable_result``. +class DeleteSecondaryEmailsResult(bb.Struct): + __slots__ = [ + "_results_value", + ] - :rtype: bool - """ - return self._tag == "unusable_result" + _has_required_fields = True - def is_other(self): - """ - Check if the union tag is ``other``. + def __init__(self, results=None): + self._results_value = bb.NOT_SET + if results is not None: + self.results = results - :rtype: bool - """ - return self._tag == "other" + # Instance attribute type: list of [UserDeleteResult] (validator is set below) + results = bb.Attribute("results") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(BulkSuspendTaskFailure, self)._process_custom_annotations( + super(DeleteSecondaryEmailsResult, self)._process_custom_annotations( annotation_type, field_path, processor ) -BulkSuspendTaskFailure_validator = bv.Union(BulkSuspendTaskFailure) +DeleteSecondaryEmailsResult_validator = bv.Struct(DeleteSecondaryEmailsResult) -class CustomQuotaError(bb.Union): +class DesktopClientSession(DeviceSession): """ - Error returned when getting member custom quota. - - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. + Information about linked Dropbox desktop client sessions. - :ivar CustomQuotaError.too_many_users: - A maximum of 1000 users can be set for a single call. + :ivar DesktopClientSession.host_name: + Name of the hosting desktop. + :ivar DesktopClientSession.client_type: + The Dropbox desktop client type. + :ivar DesktopClientSession.client_version: + The Dropbox client version. + :ivar DesktopClientSession.platform: + Information on the hosting platform. + :ivar DesktopClientSession.is_delete_on_unlink_supported: + Whether it's possible to delete all of the account files upon unlinking. """ - _catch_all = "other" - # Attribute is overwritten below the class definition - too_many_users = None - # Attribute is overwritten below the class definition - other = None + __slots__ = [ + "_host_name_value", + "_client_type_value", + "_client_version_value", + "_platform_value", + "_is_delete_on_unlink_supported_value", + ] - def is_too_many_users(self): - """ - Check if the union tag is ``too_many_users``. + _has_required_fields = True - :rtype: bool - """ - return self._tag == "too_many_users" + def __init__( + self, + session_id=None, + host_name=None, + client_type=None, + client_version=None, + platform=None, + is_delete_on_unlink_supported=None, + ip_address=None, + country=None, + created=None, + updated=None, + ): + super(DesktopClientSession, self).__init__( + session_id, ip_address, country, created, updated + ) + self._host_name_value = bb.NOT_SET + self._client_type_value = bb.NOT_SET + self._client_version_value = bb.NOT_SET + self._platform_value = bb.NOT_SET + self._is_delete_on_unlink_supported_value = bb.NOT_SET + if host_name is not None: + self.host_name = host_name + if client_type is not None: + self.client_type = client_type + if client_version is not None: + self.client_version = client_version + if platform is not None: + self.platform = platform + if is_delete_on_unlink_supported is not None: + self.is_delete_on_unlink_supported = is_delete_on_unlink_supported - def is_other(self): - """ - Check if the union tag is ``other``. + # Instance attribute type: str (validator is set below) + host_name = bb.Attribute("host_name") - :rtype: bool - """ - return self._tag == "other" + # Instance attribute type: DesktopPlatform (validator is set below) + client_type = bb.Attribute("client_type", user_defined=True) + + # Instance attribute type: str (validator is set below) + client_version = bb.Attribute("client_version") + + # Instance attribute type: str (validator is set below) + platform = bb.Attribute("platform") + + # Instance attribute type: bool (validator is set below) + is_delete_on_unlink_supported = bb.Attribute("is_delete_on_unlink_supported") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(CustomQuotaError, self)._process_custom_annotations( + super(DesktopClientSession, self)._process_custom_annotations( annotation_type, field_path, processor ) -CustomQuotaError_validator = bv.Union(CustomQuotaError) +DesktopClientSession_validator = bv.Struct(DesktopClientSession) -class CustomQuotaResult(bb.Union): +class DesktopPlatform(bb.Union): """ - User custom quota. - This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar CustomQuotaResult.success: - User's custom quota. - :vartype CustomQuotaResult.success: UserCustomQuotaResult - :ivar CustomQuotaResult.invalid_user: - Invalid user (not in team). - :vartype CustomQuotaResult.invalid_user: UserSelectorArg + :ivar DesktopPlatform.windows: + Official Windows Dropbox desktop client. + :ivar DesktopPlatform.mac: + Official Mac Dropbox desktop client. + :ivar DesktopPlatform.linux: + Official Linux Dropbox desktop client. """ _catch_all = "other" # Attribute is overwritten below the class definition + windows = None + # Attribute is overwritten below the class definition + mac = None + # Attribute is overwritten below the class definition + linux = None + # Attribute is overwritten below the class definition other = None - @classmethod - def success(cls, val): - """ - Create an instance of this class set to the ``success`` tag with value - ``val``. - - :param UserCustomQuotaResult val: - :rtype: CustomQuotaResult - """ - return cls("success", val) - - @classmethod - def invalid_user(cls, val): + def is_windows(self): """ - Create an instance of this class set to the ``invalid_user`` tag with - value ``val``. + Check if the union tag is ``windows``. - :param UserSelectorArg val: - :rtype: CustomQuotaResult + :rtype: bool """ - return cls("invalid_user", val) + return self._tag == "windows" - def is_success(self): + def is_mac(self): """ - Check if the union tag is ``success``. + Check if the union tag is ``mac``. :rtype: bool """ - return self._tag == "success" + return self._tag == "mac" - def is_invalid_user(self): + def is_linux(self): """ - Check if the union tag is ``invalid_user``. + Check if the union tag is ``linux``. :rtype: bool """ - return self._tag == "invalid_user" + return self._tag == "linux" def is_other(self): """ @@ -1684,120 +1477,231 @@ def is_other(self): """ return self._tag == "other" - def get_success(self): - """ - User's custom quota. - - Only call this if :meth:`is_success` is true. - - :rtype: UserCustomQuotaResult - """ - if not self.is_success(): - raise AttributeError("tag 'success' not set") - return self._value - - def get_invalid_user(self): - """ - Invalid user (not in team). - - Only call this if :meth:`is_invalid_user` is true. - - :rtype: UserSelectorArg - """ - if not self.is_invalid_user(): - raise AttributeError("tag 'invalid_user' not set") - return self._value - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(CustomQuotaResult, self)._process_custom_annotations( + super(DesktopPlatform, self)._process_custom_annotations( annotation_type, field_path, processor ) -CustomQuotaResult_validator = bv.Union(CustomQuotaResult) +DesktopPlatform_validator = bv.Union(DesktopPlatform) -class CustomQuotaUsersArg(bb.Struct): +class DeviceSessionArg(bb.Struct): """ - :ivar CustomQuotaUsersArg.users: - List of users. + :ivar DeviceSessionArg.session_id: + The session id. + :ivar DeviceSessionArg.team_member_id: + The unique id of the member owning the device. """ __slots__ = [ - "_users_value", + "_session_id_value", + "_team_member_id_value", ] _has_required_fields = True - def __init__(self, users=None): - self._users_value = bb.NOT_SET - if users is not None: - self.users = users + def __init__(self, session_id=None, team_member_id=None): + self._session_id_value = bb.NOT_SET + self._team_member_id_value = bb.NOT_SET + if session_id is not None: + self.session_id = session_id + if team_member_id is not None: + self.team_member_id = team_member_id - # Instance attribute type: list of [UserSelectorArg] (validator is set below) - users = bb.Attribute("users") + # Instance attribute type: str (validator is set below) + session_id = bb.Attribute("session_id") + + # Instance attribute type: str (validator is set below) + team_member_id = bb.Attribute("team_member_id") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(CustomQuotaUsersArg, self)._process_custom_annotations( + super(DeviceSessionArg, self)._process_custom_annotations( annotation_type, field_path, processor ) -CustomQuotaUsersArg_validator = bv.Struct(CustomQuotaUsersArg) +DeviceSessionArg_validator = bv.Struct(DeviceSessionArg) -class DateRange(bb.Struct): +class DevicesActive(bb.Struct): """ - Input arguments that can be provided for most reports. + Each of the items is an array of values, one value per day. The value is the + number of devices active within a time window, ending with that day. If + there is no data for a day, then the value will be None. - :ivar DateRange.start_date: - Optional starting date (inclusive). If start_date is None or too long - ago, this field will be set to 6 months ago. - :ivar DateRange.end_date: - Optional ending date (exclusive). + :ivar DevicesActive.windows: + Array of number of linked windows (desktop) clients with activity. + :ivar DevicesActive.macos: + Array of number of linked mac (desktop) clients with activity. + :ivar DevicesActive.linux: + Array of number of linked linus (desktop) clients with activity. + :ivar DevicesActive.ios: + Array of number of linked ios devices with activity. + :ivar DevicesActive.android: + Array of number of linked android devices with activity. + :ivar DevicesActive.other: + Array of number of other linked devices (blackberry, windows phone, etc) + with activity. + :ivar DevicesActive.total: + Array of total number of linked clients with activity. """ __slots__ = [ - "_start_date_value", - "_end_date_value", + "_windows_value", + "_macos_value", + "_linux_value", + "_ios_value", + "_android_value", + "_other_value", + "_total_value", + ] + + _has_required_fields = True + + def __init__( + self, windows=None, macos=None, linux=None, ios=None, android=None, other=None, total=None + ): + self._windows_value = bb.NOT_SET + self._macos_value = bb.NOT_SET + self._linux_value = bb.NOT_SET + self._ios_value = bb.NOT_SET + self._android_value = bb.NOT_SET + self._other_value = bb.NOT_SET + self._total_value = bb.NOT_SET + if windows is not None: + self.windows = windows + if macos is not None: + self.macos = macos + if linux is not None: + self.linux = linux + if ios is not None: + self.ios = ios + if android is not None: + self.android = android + if other is not None: + self.other = other + if total is not None: + self.total = total + + # Instance attribute type: list of [Optional[int]] (validator is set below) + windows = bb.Attribute("windows") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + macos = bb.Attribute("macos") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + linux = bb.Attribute("linux") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + ios = bb.Attribute("ios") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + android = bb.Attribute("android") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + other = bb.Attribute("other") + + # Instance attribute type: list of [Optional[int]] (validator is set below) + total = bb.Attribute("total") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(DevicesActive, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +DevicesActive_validator = bv.Struct(DevicesActive) + + +class ExcludedUsersListArg(bb.Struct): + """ + Excluded users list argument. + + :ivar ExcludedUsersListArg.limit: + Number of results to return per call. + """ + + __slots__ = [ + "_limit_value", ] _has_required_fields = False - def __init__(self, start_date=None, end_date=None): - self._start_date_value = bb.NOT_SET - self._end_date_value = bb.NOT_SET - if start_date is not None: - self.start_date = start_date - if end_date is not None: - self.end_date = end_date + def __init__(self, limit=None): + self._limit_value = bb.NOT_SET + if limit is not None: + self.limit = limit - # Instance attribute type: datetime.datetime (validator is set below) - start_date = bb.Attribute("start_date", nullable=True) + # Instance attribute type: int (validator is set below) + limit = bb.Attribute("limit") - # Instance attribute type: datetime.datetime (validator is set below) - end_date = bb.Attribute("end_date", nullable=True) + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ExcludedUsersListArg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +ExcludedUsersListArg_validator = bv.Struct(ExcludedUsersListArg) + + +class ExcludedUsersListContinueArg(bb.Struct): + """ + Excluded users list continue argument. + + :ivar ExcludedUsersListContinueArg.cursor: + Indicates from what point to get the next set of users. + """ + + __slots__ = [ + "_cursor_value", + ] + + _has_required_fields = True + + def __init__(self, cursor=None): + self._cursor_value = bb.NOT_SET + if cursor is not None: + self.cursor = cursor + + # Instance attribute type: str (validator is set below) + cursor = bb.Attribute("cursor") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DateRange, self)._process_custom_annotations(annotation_type, field_path, processor) + super(ExcludedUsersListContinueArg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) -DateRange_validator = bv.Struct(DateRange) +ExcludedUsersListContinueArg_validator = bv.Struct(ExcludedUsersListContinueArg) -class DateRangeError(bb.Union): +class ExcludedUsersListContinueError(bb.Union): """ - Errors that can originate from problems in input arguments to reports. + Excluded users list continue error. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. + + :ivar ExcludedUsersListContinueError.invalid_cursor: + The cursor is invalid. """ _catch_all = "other" # Attribute is overwritten below the class definition + invalid_cursor = None + # Attribute is overwritten below the class definition other = None + def is_invalid_cursor(self): + """ + Check if the union tag is ``invalid_cursor``. + + :rtype: bool + """ + return self._tag == "invalid_cursor" + def is_other(self): """ Check if the union tag is ``other``. @@ -1807,334 +1711,179 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DateRangeError, self)._process_custom_annotations( + super(ExcludedUsersListContinueError, self)._process_custom_annotations( annotation_type, field_path, processor ) -DateRangeError_validator = bv.Union(DateRangeError) +ExcludedUsersListContinueError_validator = bv.Union(ExcludedUsersListContinueError) -class DeleteSecondaryEmailResult(bb.Union): +class ExcludedUsersListError(bb.Union): """ - Result of trying to delete a secondary email address. 'success' is the only - value indicating that a secondary email was successfully deleted. The other - values explain the type of error that occurred, and include the email for - which the error occurred. + Excluded users list error. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar DeleteSecondaryEmailResult.success: - The secondary email was successfully deleted. - :vartype DeleteSecondaryEmailResult.success: str - :ivar DeleteSecondaryEmailResult.not_found: - The email address was not found for the user. - :vartype DeleteSecondaryEmailResult.not_found: str - :ivar DeleteSecondaryEmailResult.cannot_remove_primary: - The email address is the primary email address of the user, and cannot - be removed. - :vartype DeleteSecondaryEmailResult.cannot_remove_primary: str + :ivar ExcludedUsersListError.list_error: + An error occurred. """ _catch_all = "other" # Attribute is overwritten below the class definition + list_error = None + # Attribute is overwritten below the class definition other = None - @classmethod - def success(cls, val): + def is_list_error(self): """ - Create an instance of this class set to the ``success`` tag with value - ``val``. + Check if the union tag is ``list_error``. - :param str val: - :rtype: DeleteSecondaryEmailResult + :rtype: bool """ - return cls("success", val) + return self._tag == "list_error" - @classmethod - def not_found(cls, val): + def is_other(self): """ - Create an instance of this class set to the ``not_found`` tag with value - ``val``. + Check if the union tag is ``other``. - :param str val: - :rtype: DeleteSecondaryEmailResult + :rtype: bool """ - return cls("not_found", val) - - @classmethod - def cannot_remove_primary(cls, val): - """ - Create an instance of this class set to the ``cannot_remove_primary`` - tag with value ``val``. - - :param str val: - :rtype: DeleteSecondaryEmailResult - """ - return cls("cannot_remove_primary", val) - - def is_success(self): - """ - Check if the union tag is ``success``. - - :rtype: bool - """ - return self._tag == "success" - - def is_not_found(self): - """ - Check if the union tag is ``not_found``. - - :rtype: bool - """ - return self._tag == "not_found" - - def is_cannot_remove_primary(self): - """ - Check if the union tag is ``cannot_remove_primary``. - - :rtype: bool - """ - return self._tag == "cannot_remove_primary" - - def is_other(self): - """ - Check if the union tag is ``other``. - - :rtype: bool - """ - return self._tag == "other" - - def get_success(self): - """ - The secondary email was successfully deleted. - - Only call this if :meth:`is_success` is true. - - :rtype: str - """ - if not self.is_success(): - raise AttributeError("tag 'success' not set") - return self._value - - def get_not_found(self): - """ - The email address was not found for the user. - - Only call this if :meth:`is_not_found` is true. - - :rtype: str - """ - if not self.is_not_found(): - raise AttributeError("tag 'not_found' not set") - return self._value - - def get_cannot_remove_primary(self): - """ - The email address is the primary email address of the user, and cannot - be removed. - - Only call this if :meth:`is_cannot_remove_primary` is true. - - :rtype: str - """ - if not self.is_cannot_remove_primary(): - raise AttributeError("tag 'cannot_remove_primary' not set") - return self._value + return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DeleteSecondaryEmailResult, self)._process_custom_annotations( + super(ExcludedUsersListError, self)._process_custom_annotations( annotation_type, field_path, processor ) -DeleteSecondaryEmailResult_validator = bv.Union(DeleteSecondaryEmailResult) +ExcludedUsersListError_validator = bv.Union(ExcludedUsersListError) -class DeleteSecondaryEmailsArg(bb.Struct): +class ExcludedUsersListResult(bb.Struct): """ - :ivar DeleteSecondaryEmailsArg.emails_to_delete: - List of users and their secondary emails to delete. + Excluded users list result. + + :ivar ExcludedUsersListResult.cursor: + Pass the cursor into + :meth:`dropbox.dropbox_client.Dropbox.team_member_space_limits_excluded_users_list_continue` + to obtain additional excluded users. + :ivar ExcludedUsersListResult.has_more: + Is true if there are additional excluded users that have not been + returned yet. An additional call to + :meth:`dropbox.dropbox_client.Dropbox.team_member_space_limits_excluded_users_list_continue` + can retrieve them. """ __slots__ = [ - "_emails_to_delete_value", + "_users_value", + "_cursor_value", + "_has_more_value", ] _has_required_fields = True - def __init__(self, emails_to_delete=None): - self._emails_to_delete_value = bb.NOT_SET - if emails_to_delete is not None: - self.emails_to_delete = emails_to_delete - - # Instance attribute type: list of [UserSecondaryEmailsArg] (validator is set below) - emails_to_delete = bb.Attribute("emails_to_delete") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DeleteSecondaryEmailsArg, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -DeleteSecondaryEmailsArg_validator = bv.Struct(DeleteSecondaryEmailsArg) - - -class DeleteSecondaryEmailsResult(bb.Struct): - __slots__ = [ - "_results_value", - ] + def __init__(self, users=None, has_more=None, cursor=None): + self._users_value = bb.NOT_SET + self._cursor_value = bb.NOT_SET + self._has_more_value = bb.NOT_SET + if users is not None: + self.users = users + if cursor is not None: + self.cursor = cursor + if has_more is not None: + self.has_more = has_more - _has_required_fields = True + # Instance attribute type: list of [MemberProfile] (validator is set below) + users = bb.Attribute("users") - def __init__(self, results=None): - self._results_value = bb.NOT_SET - if results is not None: - self.results = results + # Instance attribute type: str (validator is set below) + cursor = bb.Attribute("cursor", nullable=True) - # Instance attribute type: list of [UserDeleteResult] (validator is set below) - results = bb.Attribute("results") + # Instance attribute type: bool (validator is set below) + has_more = bb.Attribute("has_more") def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DeleteSecondaryEmailsResult, self)._process_custom_annotations( + super(ExcludedUsersListResult, self)._process_custom_annotations( annotation_type, field_path, processor ) -DeleteSecondaryEmailsResult_validator = bv.Struct(DeleteSecondaryEmailsResult) +ExcludedUsersListResult_validator = bv.Struct(ExcludedUsersListResult) -class DesktopClientSession(DeviceSession): +class ExcludedUsersUpdateArg(bb.Struct): """ - Information about linked Dropbox desktop client sessions. + Argument of excluded users update operation. Should include a list of users + to add/remove (according to endpoint), Maximum size of the list is 1000 + users. - :ivar DesktopClientSession.host_name: - Name of the hosting desktop. - :ivar DesktopClientSession.client_type: - The Dropbox desktop client type. - :ivar DesktopClientSession.client_version: - The Dropbox client version. - :ivar DesktopClientSession.platform: - Information on the hosting platform. - :ivar DesktopClientSession.is_delete_on_unlink_supported: - Whether it's possible to delete all of the account files upon unlinking. + :ivar ExcludedUsersUpdateArg.users: + List of users to be added/removed. """ __slots__ = [ - "_host_name_value", - "_client_type_value", - "_client_version_value", - "_platform_value", - "_is_delete_on_unlink_supported_value", + "_users_value", ] - _has_required_fields = True - - def __init__( - self, - session_id=None, - host_name=None, - client_type=None, - client_version=None, - platform=None, - is_delete_on_unlink_supported=None, - ip_address=None, - country=None, - created=None, - updated=None, - ): - super(DesktopClientSession, self).__init__( - session_id, ip_address, country, created, updated - ) - self._host_name_value = bb.NOT_SET - self._client_type_value = bb.NOT_SET - self._client_version_value = bb.NOT_SET - self._platform_value = bb.NOT_SET - self._is_delete_on_unlink_supported_value = bb.NOT_SET - if host_name is not None: - self.host_name = host_name - if client_type is not None: - self.client_type = client_type - if client_version is not None: - self.client_version = client_version - if platform is not None: - self.platform = platform - if is_delete_on_unlink_supported is not None: - self.is_delete_on_unlink_supported = is_delete_on_unlink_supported - - # Instance attribute type: str (validator is set below) - host_name = bb.Attribute("host_name") - - # Instance attribute type: DesktopPlatform (validator is set below) - client_type = bb.Attribute("client_type", user_defined=True) - - # Instance attribute type: str (validator is set below) - client_version = bb.Attribute("client_version") + _has_required_fields = False - # Instance attribute type: str (validator is set below) - platform = bb.Attribute("platform") + def __init__(self, users=None): + self._users_value = bb.NOT_SET + if users is not None: + self.users = users - # Instance attribute type: bool (validator is set below) - is_delete_on_unlink_supported = bb.Attribute("is_delete_on_unlink_supported") + # Instance attribute type: list of [UserSelectorArg] (validator is set below) + users = bb.Attribute("users", nullable=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DesktopClientSession, self)._process_custom_annotations( + super(ExcludedUsersUpdateArg, self)._process_custom_annotations( annotation_type, field_path, processor ) -DesktopClientSession_validator = bv.Struct(DesktopClientSession) +ExcludedUsersUpdateArg_validator = bv.Struct(ExcludedUsersUpdateArg) -class DesktopPlatform(bb.Union): +class ExcludedUsersUpdateError(bb.Union): """ + Excluded users update error. + This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar DesktopPlatform.windows: - Official Windows Dropbox desktop client. - :ivar DesktopPlatform.mac: - Official Mac Dropbox desktop client. - :ivar DesktopPlatform.linux: - Official Linux Dropbox desktop client. + :ivar ExcludedUsersUpdateError.users_not_in_team: + At least one of the users is not part of your team. + :ivar ExcludedUsersUpdateError.too_many_users: + A maximum of 1000 users for each of addition/removal can be supplied. """ _catch_all = "other" # Attribute is overwritten below the class definition - windows = None - # Attribute is overwritten below the class definition - mac = None + users_not_in_team = None # Attribute is overwritten below the class definition - linux = None + too_many_users = None # Attribute is overwritten below the class definition other = None - def is_windows(self): + def is_users_not_in_team(self): """ - Check if the union tag is ``windows``. + Check if the union tag is ``users_not_in_team``. :rtype: bool """ - return self._tag == "windows" + return self._tag == "users_not_in_team" - def is_mac(self): - """ - Check if the union tag is ``mac``. - - :rtype: bool - """ - return self._tag == "mac" - - def is_linux(self): + def is_too_many_users(self): """ - Check if the union tag is ``linux``. + Check if the union tag is ``too_many_users``. :rtype: bool """ - return self._tag == "linux" + return self._tag == "too_many_users" def is_other(self): """ @@ -2145,229 +1894,70 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DesktopPlatform, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -DesktopPlatform_validator = bv.Union(DesktopPlatform) - - -class DeviceSessionArg(bb.Struct): - """ - :ivar DeviceSessionArg.session_id: - The session id. - :ivar DeviceSessionArg.team_member_id: - The unique id of the member owning the device. - """ - - __slots__ = [ - "_session_id_value", - "_team_member_id_value", - ] - - _has_required_fields = True - - def __init__(self, session_id=None, team_member_id=None): - self._session_id_value = bb.NOT_SET - self._team_member_id_value = bb.NOT_SET - if session_id is not None: - self.session_id = session_id - if team_member_id is not None: - self.team_member_id = team_member_id - - # Instance attribute type: str (validator is set below) - session_id = bb.Attribute("session_id") - - # Instance attribute type: str (validator is set below) - team_member_id = bb.Attribute("team_member_id") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DeviceSessionArg, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -DeviceSessionArg_validator = bv.Struct(DeviceSessionArg) - - -class DevicesActive(bb.Struct): - """ - Each of the items is an array of values, one value per day. The value is the - number of devices active within a time window, ending with that day. If - there is no data for a day, then the value will be None. - - :ivar DevicesActive.windows: - Array of number of linked windows (desktop) clients with activity. - :ivar DevicesActive.macos: - Array of number of linked mac (desktop) clients with activity. - :ivar DevicesActive.linux: - Array of number of linked linus (desktop) clients with activity. - :ivar DevicesActive.ios: - Array of number of linked ios devices with activity. - :ivar DevicesActive.android: - Array of number of linked android devices with activity. - :ivar DevicesActive.other: - Array of number of other linked devices (blackberry, windows phone, etc) - with activity. - :ivar DevicesActive.total: - Array of total number of linked clients with activity. - """ - - __slots__ = [ - "_windows_value", - "_macos_value", - "_linux_value", - "_ios_value", - "_android_value", - "_other_value", - "_total_value", - ] - - _has_required_fields = True - - def __init__( - self, windows=None, macos=None, linux=None, ios=None, android=None, other=None, total=None - ): - self._windows_value = bb.NOT_SET - self._macos_value = bb.NOT_SET - self._linux_value = bb.NOT_SET - self._ios_value = bb.NOT_SET - self._android_value = bb.NOT_SET - self._other_value = bb.NOT_SET - self._total_value = bb.NOT_SET - if windows is not None: - self.windows = windows - if macos is not None: - self.macos = macos - if linux is not None: - self.linux = linux - if ios is not None: - self.ios = ios - if android is not None: - self.android = android - if other is not None: - self.other = other - if total is not None: - self.total = total - - # Instance attribute type: list of [Optional[int]] (validator is set below) - windows = bb.Attribute("windows") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - macos = bb.Attribute("macos") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - linux = bb.Attribute("linux") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - ios = bb.Attribute("ios") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - android = bb.Attribute("android") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - other = bb.Attribute("other") - - # Instance attribute type: list of [Optional[int]] (validator is set below) - total = bb.Attribute("total") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(DevicesActive, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -DevicesActive_validator = bv.Struct(DevicesActive) - - -class ExcludedUsersListArg(bb.Struct): - """ - Excluded users list argument. - - :ivar ExcludedUsersListArg.limit: - Number of results to return per call. - """ - - __slots__ = [ - "_limit_value", - ] - - _has_required_fields = False - - def __init__(self, limit=None): - self._limit_value = bb.NOT_SET - if limit is not None: - self.limit = limit - - # Instance attribute type: int (validator is set below) - limit = bb.Attribute("limit") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersListArg, self)._process_custom_annotations( + super(ExcludedUsersUpdateError, self)._process_custom_annotations( annotation_type, field_path, processor ) -ExcludedUsersListArg_validator = bv.Struct(ExcludedUsersListArg) +ExcludedUsersUpdateError_validator = bv.Union(ExcludedUsersUpdateError) -class ExcludedUsersListContinueArg(bb.Struct): +class ExcludedUsersUpdateResult(bb.Struct): """ - Excluded users list continue argument. + Excluded users update result. - :ivar ExcludedUsersListContinueArg.cursor: - Indicates from what point to get the next set of users. + :ivar ExcludedUsersUpdateResult.status: + Update status. """ __slots__ = [ - "_cursor_value", + "_status_value", ] _has_required_fields = True - def __init__(self, cursor=None): - self._cursor_value = bb.NOT_SET - if cursor is not None: - self.cursor = cursor + def __init__(self, status=None): + self._status_value = bb.NOT_SET + if status is not None: + self.status = status - # Instance attribute type: str (validator is set below) - cursor = bb.Attribute("cursor") + # Instance attribute type: ExcludedUsersUpdateStatus (validator is set below) + status = bb.Attribute("status", user_defined=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersListContinueArg, self)._process_custom_annotations( + super(ExcludedUsersUpdateResult, self)._process_custom_annotations( annotation_type, field_path, processor ) -ExcludedUsersListContinueArg_validator = bv.Struct(ExcludedUsersListContinueArg) +ExcludedUsersUpdateResult_validator = bv.Struct(ExcludedUsersUpdateResult) -class ExcludedUsersListContinueError(bb.Union): +class ExcludedUsersUpdateStatus(bb.Union): """ - Excluded users list continue error. + Excluded users update operation status. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar ExcludedUsersListContinueError.invalid_cursor: - The cursor is invalid. + :ivar ExcludedUsersUpdateStatus.success: + Update successful. """ _catch_all = "other" # Attribute is overwritten below the class definition - invalid_cursor = None + success = None # Attribute is overwritten below the class definition other = None - def is_invalid_cursor(self): + def is_success(self): """ - Check if the union tag is ``invalid_cursor``. + Check if the union tag is ``success``. :rtype: bool """ - return self._tag == "invalid_cursor" + return self._tag == "success" def is_other(self): """ @@ -2378,468 +1968,211 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersListContinueError, self)._process_custom_annotations( + super(ExcludedUsersUpdateStatus, self)._process_custom_annotations( annotation_type, field_path, processor ) -ExcludedUsersListContinueError_validator = bv.Union(ExcludedUsersListContinueError) +ExcludedUsersUpdateStatus_validator = bv.Union(ExcludedUsersUpdateStatus) -class ExcludedUsersListError(bb.Union): +class Feature(bb.Union): """ - Excluded users list error. + A set of features that a Dropbox Business account may support. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar ExcludedUsersListError.list_error: - An error occurred. + :ivar Feature.upload_api_rate_limit: + The number of upload API calls allowed per month. + :ivar Feature.has_team_shared_dropbox: + Does this team have a shared team root. + :ivar Feature.has_team_file_events: + Does this team have file events. + :ivar Feature.has_team_selective_sync: + Does this team have team selective sync enabled. + :ivar Feature.has_distinct_member_homes: + Does this team have team member folder. """ _catch_all = "other" # Attribute is overwritten below the class definition - list_error = None + upload_api_rate_limit = None + # Attribute is overwritten below the class definition + has_team_shared_dropbox = None + # Attribute is overwritten below the class definition + has_team_file_events = None + # Attribute is overwritten below the class definition + has_team_selective_sync = None + # Attribute is overwritten below the class definition + has_distinct_member_homes = None # Attribute is overwritten below the class definition other = None - def is_list_error(self): + def is_upload_api_rate_limit(self): """ - Check if the union tag is ``list_error``. + Check if the union tag is ``upload_api_rate_limit``. :rtype: bool """ - return self._tag == "list_error" + return self._tag == "upload_api_rate_limit" - def is_other(self): + def is_has_team_shared_dropbox(self): """ - Check if the union tag is ``other``. + Check if the union tag is ``has_team_shared_dropbox``. :rtype: bool """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersListError, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -ExcludedUsersListError_validator = bv.Union(ExcludedUsersListError) - - -class ExcludedUsersListResult(bb.Struct): - """ - Excluded users list result. - - :ivar ExcludedUsersListResult.cursor: - Pass the cursor into - :meth:`dropbox.dropbox_client.Dropbox.team_member_space_limits_excluded_users_list_continue` - to obtain additional excluded users. - :ivar ExcludedUsersListResult.has_more: - Is true if there are additional excluded users that have not been - returned yet. An additional call to - :meth:`dropbox.dropbox_client.Dropbox.team_member_space_limits_excluded_users_list_continue` - can retrieve them. - """ - - __slots__ = [ - "_users_value", - "_cursor_value", - "_has_more_value", - ] - - _has_required_fields = True - - def __init__(self, users=None, has_more=None, cursor=None): - self._users_value = bb.NOT_SET - self._cursor_value = bb.NOT_SET - self._has_more_value = bb.NOT_SET - if users is not None: - self.users = users - if cursor is not None: - self.cursor = cursor - if has_more is not None: - self.has_more = has_more - - # Instance attribute type: list of [MemberProfile] (validator is set below) - users = bb.Attribute("users") - - # Instance attribute type: str (validator is set below) - cursor = bb.Attribute("cursor", nullable=True) - - # Instance attribute type: bool (validator is set below) - has_more = bb.Attribute("has_more") - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersListResult, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - + return self._tag == "has_team_shared_dropbox" -ExcludedUsersListResult_validator = bv.Struct(ExcludedUsersListResult) + def is_has_team_file_events(self): + """ + Check if the union tag is ``has_team_file_events``. + :rtype: bool + """ + return self._tag == "has_team_file_events" -class ExcludedUsersUpdateArg(bb.Struct): - """ - Argument of excluded users update operation. Should include a list of users - to add/remove (according to endpoint), Maximum size of the list is 1000 - users. + def is_has_team_selective_sync(self): + """ + Check if the union tag is ``has_team_selective_sync``. - :ivar ExcludedUsersUpdateArg.users: - List of users to be added/removed. - """ + :rtype: bool + """ + return self._tag == "has_team_selective_sync" - __slots__ = [ - "_users_value", - ] + def is_has_distinct_member_homes(self): + """ + Check if the union tag is ``has_distinct_member_homes``. - _has_required_fields = False + :rtype: bool + """ + return self._tag == "has_distinct_member_homes" - def __init__(self, users=None): - self._users_value = bb.NOT_SET - if users is not None: - self.users = users + def is_other(self): + """ + Check if the union tag is ``other``. - # Instance attribute type: list of [UserSelectorArg] (validator is set below) - users = bb.Attribute("users", nullable=True) + :rtype: bool + """ + return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersUpdateArg, self)._process_custom_annotations( - annotation_type, field_path, processor - ) + super(Feature, self)._process_custom_annotations(annotation_type, field_path, processor) -ExcludedUsersUpdateArg_validator = bv.Struct(ExcludedUsersUpdateArg) +Feature_validator = bv.Union(Feature) -class ExcludedUsersUpdateError(bb.Union): +class FeatureValue(bb.Union): """ - Excluded users update error. + The values correspond to entries in :class:`Feature`. You may get different + value according to your Dropbox Business plan. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - - :ivar ExcludedUsersUpdateError.users_not_in_team: - At least one of the users is not part of your team. - :ivar ExcludedUsersUpdateError.too_many_users: - A maximum of 1000 users for each of addition/removal can be supplied. """ _catch_all = "other" # Attribute is overwritten below the class definition - users_not_in_team = None - # Attribute is overwritten below the class definition - too_many_users = None - # Attribute is overwritten below the class definition other = None - def is_users_not_in_team(self): + @classmethod + def upload_api_rate_limit(cls, val): """ - Check if the union tag is ``users_not_in_team``. + Create an instance of this class set to the ``upload_api_rate_limit`` + tag with value ``val``. - :rtype: bool + :param UploadApiRateLimitValue val: + :rtype: FeatureValue """ - return self._tag == "users_not_in_team" + return cls("upload_api_rate_limit", val) - def is_too_many_users(self): + @classmethod + def has_team_shared_dropbox(cls, val): """ - Check if the union tag is ``too_many_users``. + Create an instance of this class set to the ``has_team_shared_dropbox`` + tag with value ``val``. - :rtype: bool + :param HasTeamSharedDropboxValue val: + :rtype: FeatureValue """ - return self._tag == "too_many_users" + return cls("has_team_shared_dropbox", val) - def is_other(self): + @classmethod + def has_team_file_events(cls, val): """ - Check if the union tag is ``other``. + Create an instance of this class set to the ``has_team_file_events`` tag + with value ``val``. - :rtype: bool + :param HasTeamFileEventsValue val: + :rtype: FeatureValue """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersUpdateError, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -ExcludedUsersUpdateError_validator = bv.Union(ExcludedUsersUpdateError) - - -class ExcludedUsersUpdateResult(bb.Struct): - """ - Excluded users update result. - - :ivar ExcludedUsersUpdateResult.status: - Update status. - """ + return cls("has_team_file_events", val) - __slots__ = [ - "_status_value", - ] + @classmethod + def has_team_selective_sync(cls, val): + """ + Create an instance of this class set to the ``has_team_selective_sync`` + tag with value ``val``. - _has_required_fields = True + :param HasTeamSelectiveSyncValue val: + :rtype: FeatureValue + """ + return cls("has_team_selective_sync", val) - def __init__(self, status=None): - self._status_value = bb.NOT_SET - if status is not None: - self.status = status + @classmethod + def has_distinct_member_homes(cls, val): + """ + Create an instance of this class set to the + ``has_distinct_member_homes`` tag with value ``val``. - # Instance attribute type: ExcludedUsersUpdateStatus (validator is set below) - status = bb.Attribute("status", user_defined=True) + :param HasDistinctMemberHomesValue val: + :rtype: FeatureValue + """ + return cls("has_distinct_member_homes", val) - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersUpdateResult, self)._process_custom_annotations( - annotation_type, field_path, processor - ) + def is_upload_api_rate_limit(self): + """ + Check if the union tag is ``upload_api_rate_limit``. + :rtype: bool + """ + return self._tag == "upload_api_rate_limit" -ExcludedUsersUpdateResult_validator = bv.Struct(ExcludedUsersUpdateResult) + def is_has_team_shared_dropbox(self): + """ + Check if the union tag is ``has_team_shared_dropbox``. + :rtype: bool + """ + return self._tag == "has_team_shared_dropbox" -class ExcludedUsersUpdateStatus(bb.Union): - """ - Excluded users update operation status. + def is_has_team_file_events(self): + """ + Check if the union tag is ``has_team_file_events``. - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. + :rtype: bool + """ + return self._tag == "has_team_file_events" - :ivar ExcludedUsersUpdateStatus.success: - Update successful. - """ + def is_has_team_selective_sync(self): + """ + Check if the union tag is ``has_team_selective_sync``. - _catch_all = "other" - # Attribute is overwritten below the class definition - success = None - # Attribute is overwritten below the class definition - other = None + :rtype: bool + """ + return self._tag == "has_team_selective_sync" - def is_success(self): + def is_has_distinct_member_homes(self): """ - Check if the union tag is ``success``. + Check if the union tag is ``has_distinct_member_homes``. :rtype: bool """ - return self._tag == "success" - - def is_other(self): - """ - Check if the union tag is ``other``. - - :rtype: bool - """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(ExcludedUsersUpdateStatus, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -ExcludedUsersUpdateStatus_validator = bv.Union(ExcludedUsersUpdateStatus) - - -class Feature(bb.Union): - """ - A set of features that a Dropbox Business account may support. - - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. - - :ivar Feature.upload_api_rate_limit: - The number of upload API calls allowed per month. - :ivar Feature.has_team_shared_dropbox: - Does this team have a shared team root. - :ivar Feature.has_team_file_events: - Does this team have file events. - :ivar Feature.has_team_selective_sync: - Does this team have team selective sync enabled. - :ivar Feature.has_distinct_member_homes: - Does this team have team member folder. - """ - - _catch_all = "other" - # Attribute is overwritten below the class definition - upload_api_rate_limit = None - # Attribute is overwritten below the class definition - has_team_shared_dropbox = None - # Attribute is overwritten below the class definition - has_team_file_events = None - # Attribute is overwritten below the class definition - has_team_selective_sync = None - # Attribute is overwritten below the class definition - has_distinct_member_homes = None - # Attribute is overwritten below the class definition - other = None - - def is_upload_api_rate_limit(self): - """ - Check if the union tag is ``upload_api_rate_limit``. - - :rtype: bool - """ - return self._tag == "upload_api_rate_limit" - - def is_has_team_shared_dropbox(self): - """ - Check if the union tag is ``has_team_shared_dropbox``. - - :rtype: bool - """ - return self._tag == "has_team_shared_dropbox" - - def is_has_team_file_events(self): - """ - Check if the union tag is ``has_team_file_events``. - - :rtype: bool - """ - return self._tag == "has_team_file_events" - - def is_has_team_selective_sync(self): - """ - Check if the union tag is ``has_team_selective_sync``. - - :rtype: bool - """ - return self._tag == "has_team_selective_sync" - - def is_has_distinct_member_homes(self): - """ - Check if the union tag is ``has_distinct_member_homes``. - - :rtype: bool - """ - return self._tag == "has_distinct_member_homes" - - def is_other(self): - """ - Check if the union tag is ``other``. - - :rtype: bool - """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(Feature, self)._process_custom_annotations(annotation_type, field_path, processor) - - -Feature_validator = bv.Union(Feature) - - -class FeatureValue(bb.Union): - """ - The values correspond to entries in :class:`Feature`. You may get different - value according to your Dropbox Business plan. - - This class acts as a tagged union. Only one of the ``is_*`` methods will - return true. To get the associated value of a tag (if one exists), use the - corresponding ``get_*`` method. - """ - - _catch_all = "other" - # Attribute is overwritten below the class definition - other = None - - @classmethod - def upload_api_rate_limit(cls, val): - """ - Create an instance of this class set to the ``upload_api_rate_limit`` - tag with value ``val``. - - :param UploadApiRateLimitValue val: - :rtype: FeatureValue - """ - return cls("upload_api_rate_limit", val) - - @classmethod - def has_team_shared_dropbox(cls, val): - """ - Create an instance of this class set to the ``has_team_shared_dropbox`` - tag with value ``val``. - - :param HasTeamSharedDropboxValue val: - :rtype: FeatureValue - """ - return cls("has_team_shared_dropbox", val) - - @classmethod - def has_team_file_events(cls, val): - """ - Create an instance of this class set to the ``has_team_file_events`` tag - with value ``val``. - - :param HasTeamFileEventsValue val: - :rtype: FeatureValue - """ - return cls("has_team_file_events", val) - - @classmethod - def has_team_selective_sync(cls, val): - """ - Create an instance of this class set to the ``has_team_selective_sync`` - tag with value ``val``. - - :param HasTeamSelectiveSyncValue val: - :rtype: FeatureValue - """ - return cls("has_team_selective_sync", val) - - @classmethod - def has_distinct_member_homes(cls, val): - """ - Create an instance of this class set to the - ``has_distinct_member_homes`` tag with value ``val``. - - :param HasDistinctMemberHomesValue val: - :rtype: FeatureValue - """ - return cls("has_distinct_member_homes", val) - - def is_upload_api_rate_limit(self): - """ - Check if the union tag is ``upload_api_rate_limit``. - - :rtype: bool - """ - return self._tag == "upload_api_rate_limit" - - def is_has_team_shared_dropbox(self): - """ - Check if the union tag is ``has_team_shared_dropbox``. - - :rtype: bool - """ - return self._tag == "has_team_shared_dropbox" - - def is_has_team_file_events(self): - """ - Check if the union tag is ``has_team_file_events``. - - :rtype: bool - """ - return self._tag == "has_team_file_events" - - def is_has_team_selective_sync(self): - """ - Check if the union tag is ``has_team_selective_sync``. - - :rtype: bool - """ - return self._tag == "has_team_selective_sync" - - def is_has_distinct_member_homes(self): - """ - Check if the union tag is ``has_distinct_member_homes``. - - :rtype: bool - """ - return self._tag == "has_distinct_member_homes" + return self._tag == "has_distinct_member_homes" def is_other(self): """ @@ -8494,6 +7827,41 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): MemberProfile_validator = bv.Struct(MemberProfile) +class UserSelectorError(bb.Union): + """ + Error that can be returned whenever a struct derived from + :class:`UserSelectorArg` is used. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar UserSelectorError.user_not_found: + No matching user found. The provided team_member_id, email, or + external_id does not exist on this team. + """ + + _catch_all = None + # Attribute is overwritten below the class definition + user_not_found = None + + def is_user_not_found(self): + """ + Check if the union tag is ``user_not_found``. + + :rtype: bool + """ + return self._tag == "user_not_found" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(UserSelectorError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +UserSelectorError_validator = bv.Union(UserSelectorError) + + class MemberSelectorError(UserSelectorError): """ This class acts as a tagged union. Only one of the ``is_*`` methods will @@ -9015,19 +8383,60 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): MembersDeactivateArg_validator = bv.Struct(MembersDeactivateArg) -class MembersPermanentlyDeleteFilesError(MembersDeactivateError): +class MembersDeactivateError(UserSelectorError): """ This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar MembersPermanentlyDeleteFilesError.transfer_in_progress: - Cannot permanently delete files while it's being transferred. - :ivar MembersPermanentlyDeleteFilesError.already_transferred: - Cannot permanently delete files that have already been transferred. - :ivar MembersPermanentlyDeleteFilesError.already_transferred_or_deleted: - Cannot permanently delete files that have already been transferred or - deleted. + :ivar MembersDeactivateError.user_not_in_team: + The user is not a member of the team. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + user_not_in_team = None + # Attribute is overwritten below the class definition + other = None + + def is_user_not_in_team(self): + """ + Check if the union tag is ``user_not_in_team``. + + :rtype: bool + """ + return self._tag == "user_not_in_team" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersDeactivateError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersDeactivateError_validator = bv.Union(MembersDeactivateError) + + +class MembersPermanentlyDeleteFilesError(MembersDeactivateError): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar MembersPermanentlyDeleteFilesError.transfer_in_progress: + Cannot permanently delete files while it's being transferred. + :ivar MembersPermanentlyDeleteFilesError.already_transferred: + Cannot permanently delete files that have already been transferred. + :ivar MembersPermanentlyDeleteFilesError.already_transferred_or_deleted: + Cannot permanently delete files that have already been transferred or + deleted. """ # Attribute is overwritten below the class definition @@ -10169,166 +9578,815 @@ class MembersRemoveError(MembersTransferFilesError): """ # Attribute is overwritten below the class definition - remove_last_admin = None - # Attribute is overwritten below the class definition - cannot_keep_account_and_transfer = None - # Attribute is overwritten below the class definition - cannot_keep_account_and_delete_data = None - # Attribute is overwritten below the class definition - cannot_keep_account_and_permanently_delete = None - # Attribute is overwritten below the class definition - email_address_too_long_to_be_disabled = None + remove_last_admin = None + # Attribute is overwritten below the class definition + cannot_keep_account_and_transfer = None + # Attribute is overwritten below the class definition + cannot_keep_account_and_delete_data = None + # Attribute is overwritten below the class definition + cannot_keep_account_and_permanently_delete = None + # Attribute is overwritten below the class definition + email_address_too_long_to_be_disabled = None + # Attribute is overwritten below the class definition + cannot_keep_invited_user_account = None + # Attribute is overwritten below the class definition + cannot_retain_shares_when_data_wiped = None + # Attribute is overwritten below the class definition + cannot_retain_shares_when_no_account_kept = None + # Attribute is overwritten below the class definition + cannot_retain_shares_when_team_external_sharing_off = None + # Attribute is overwritten below the class definition + cannot_keep_account = None + # Attribute is overwritten below the class definition + cannot_keep_account_under_legal_hold = None + # Attribute is overwritten below the class definition + cannot_keep_account_required_to_sign_tos = None + # Attribute is overwritten below the class definition + cannot_permanently_delete_and_transfer = None + # Attribute is overwritten below the class definition + member_is_transfer_destination = None + + def is_remove_last_admin(self): + """ + Check if the union tag is ``remove_last_admin``. + + :rtype: bool + """ + return self._tag == "remove_last_admin" + + def is_cannot_keep_account_and_transfer(self): + """ + Check if the union tag is ``cannot_keep_account_and_transfer``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account_and_transfer" + + def is_cannot_keep_account_and_delete_data(self): + """ + Check if the union tag is ``cannot_keep_account_and_delete_data``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account_and_delete_data" + + def is_cannot_keep_account_and_permanently_delete(self): + """ + Check if the union tag is ``cannot_keep_account_and_permanently_delete``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account_and_permanently_delete" + + def is_email_address_too_long_to_be_disabled(self): + """ + Check if the union tag is ``email_address_too_long_to_be_disabled``. + + :rtype: bool + """ + return self._tag == "email_address_too_long_to_be_disabled" + + def is_cannot_keep_invited_user_account(self): + """ + Check if the union tag is ``cannot_keep_invited_user_account``. + + :rtype: bool + """ + return self._tag == "cannot_keep_invited_user_account" + + def is_cannot_retain_shares_when_data_wiped(self): + """ + Check if the union tag is ``cannot_retain_shares_when_data_wiped``. + + :rtype: bool + """ + return self._tag == "cannot_retain_shares_when_data_wiped" + + def is_cannot_retain_shares_when_no_account_kept(self): + """ + Check if the union tag is ``cannot_retain_shares_when_no_account_kept``. + + :rtype: bool + """ + return self._tag == "cannot_retain_shares_when_no_account_kept" + + def is_cannot_retain_shares_when_team_external_sharing_off(self): + """ + Check if the union tag is ``cannot_retain_shares_when_team_external_sharing_off``. + + :rtype: bool + """ + return self._tag == "cannot_retain_shares_when_team_external_sharing_off" + + def is_cannot_keep_account(self): + """ + Check if the union tag is ``cannot_keep_account``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account" + + def is_cannot_keep_account_under_legal_hold(self): + """ + Check if the union tag is ``cannot_keep_account_under_legal_hold``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account_under_legal_hold" + + def is_cannot_keep_account_required_to_sign_tos(self): + """ + Check if the union tag is ``cannot_keep_account_required_to_sign_tos``. + + :rtype: bool + """ + return self._tag == "cannot_keep_account_required_to_sign_tos" + + def is_cannot_permanently_delete_and_transfer(self): + """ + Check if the union tag is ``cannot_permanently_delete_and_transfer``. + + :rtype: bool + """ + return self._tag == "cannot_permanently_delete_and_transfer" + + def is_member_is_transfer_destination(self): + """ + Check if the union tag is ``member_is_transfer_destination``. + + :rtype: bool + """ + return self._tag == "member_is_transfer_destination" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersRemoveError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersRemoveError_validator = bv.Union(MembersRemoveError) + + +class MembersSendWelcomeError(MemberSelectorError): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + other = None + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSendWelcomeError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSendWelcomeError_validator = bv.Union(MembersSendWelcomeError) + + +class MembersSetPermissions2Arg(bb.Struct): + """ + Exactly one of team_member_id, email, or external_id must be provided to + identify the user account. + + :ivar MembersSetPermissions2Arg.user: + Identity of user whose role will be set. + :ivar MembersSetPermissions2Arg.new_roles: + The new roles for the member. Send empty list to make user member only. + For now, only up to one role is allowed. + """ + + __slots__ = [ + "_user_value", + "_new_roles_value", + ] + + _has_required_fields = True + + def __init__(self, user=None, new_roles=None): + self._user_value = bb.NOT_SET + self._new_roles_value = bb.NOT_SET + if user is not None: + self.user = user + if new_roles is not None: + self.new_roles = new_roles + + # Instance attribute type: UserSelectorArg (validator is set below) + user = bb.Attribute("user", user_defined=True) + + # Instance attribute type: list of [str] (validator is set below) + new_roles = bb.Attribute("new_roles", nullable=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissions2Arg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissions2Arg_validator = bv.Struct(MembersSetPermissions2Arg) + + +class MembersSetPermissions2Error(UserSelectorError): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar MembersSetPermissions2Error.last_admin: + Cannot remove the admin setting of the last admin. + :ivar MembersSetPermissions2Error.user_not_in_team: + The user is not a member of the team. + :ivar MembersSetPermissions2Error.cannot_set_permissions: + Cannot remove/grant permissions. This can happen if the team member is + suspended. + :ivar MembersSetPermissions2Error.role_not_found: + No matching role found. At least one of the provided new_roles does not + exist on this team. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + last_admin = None + # Attribute is overwritten below the class definition + user_not_in_team = None + # Attribute is overwritten below the class definition + cannot_set_permissions = None + # Attribute is overwritten below the class definition + role_not_found = None + # Attribute is overwritten below the class definition + other = None + + def is_last_admin(self): + """ + Check if the union tag is ``last_admin``. + + :rtype: bool + """ + return self._tag == "last_admin" + + def is_user_not_in_team(self): + """ + Check if the union tag is ``user_not_in_team``. + + :rtype: bool + """ + return self._tag == "user_not_in_team" + + def is_cannot_set_permissions(self): + """ + Check if the union tag is ``cannot_set_permissions``. + + :rtype: bool + """ + return self._tag == "cannot_set_permissions" + + def is_role_not_found(self): + """ + Check if the union tag is ``role_not_found``. + + :rtype: bool + """ + return self._tag == "role_not_found" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissions2Error, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissions2Error_validator = bv.Union(MembersSetPermissions2Error) + + +class MembersSetPermissions2Result(bb.Struct): + """ + :ivar MembersSetPermissions2Result.team_member_id: + The member ID of the user to which the change was applied. + :ivar MembersSetPermissions2Result.roles: + The roles after the change. Empty in case the user become a non-admin. + """ + + __slots__ = [ + "_team_member_id_value", + "_roles_value", + ] + + _has_required_fields = True + + def __init__(self, team_member_id=None, roles=None): + self._team_member_id_value = bb.NOT_SET + self._roles_value = bb.NOT_SET + if team_member_id is not None: + self.team_member_id = team_member_id + if roles is not None: + self.roles = roles + + # Instance attribute type: str (validator is set below) + team_member_id = bb.Attribute("team_member_id") + + # Instance attribute type: list of [TeamMemberRole] (validator is set below) + roles = bb.Attribute("roles", nullable=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissions2Result, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissions2Result_validator = bv.Struct(MembersSetPermissions2Result) + + +class MembersSetPermissionsArg(bb.Struct): + """ + Exactly one of team_member_id, email, or external_id must be provided to + identify the user account. + + :ivar MembersSetPermissionsArg.user: + Identity of user whose role will be set. + :ivar MembersSetPermissionsArg.new_role: + The new role of the member. + """ + + __slots__ = [ + "_user_value", + "_new_role_value", + ] + + _has_required_fields = True + + def __init__(self, user=None, new_role=None): + self._user_value = bb.NOT_SET + self._new_role_value = bb.NOT_SET + if user is not None: + self.user = user + if new_role is not None: + self.new_role = new_role + + # Instance attribute type: UserSelectorArg (validator is set below) + user = bb.Attribute("user", user_defined=True) + + # Instance attribute type: AdminTier (validator is set below) + new_role = bb.Attribute("new_role", user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissionsArg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissionsArg_validator = bv.Struct(MembersSetPermissionsArg) + + +class MembersSetPermissionsError(UserSelectorError): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar MembersSetPermissionsError.last_admin: + Cannot remove the admin setting of the last admin. + :ivar MembersSetPermissionsError.user_not_in_team: + The user is not a member of the team. + :ivar MembersSetPermissionsError.cannot_set_permissions: + Cannot remove/grant permissions. + :ivar MembersSetPermissionsError.team_license_limit: + Team is full. The organization has no available licenses. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + last_admin = None + # Attribute is overwritten below the class definition + user_not_in_team = None + # Attribute is overwritten below the class definition + cannot_set_permissions = None + # Attribute is overwritten below the class definition + team_license_limit = None + # Attribute is overwritten below the class definition + other = None + + def is_last_admin(self): + """ + Check if the union tag is ``last_admin``. + + :rtype: bool + """ + return self._tag == "last_admin" + + def is_user_not_in_team(self): + """ + Check if the union tag is ``user_not_in_team``. + + :rtype: bool + """ + return self._tag == "user_not_in_team" + + def is_cannot_set_permissions(self): + """ + Check if the union tag is ``cannot_set_permissions``. + + :rtype: bool + """ + return self._tag == "cannot_set_permissions" + + def is_team_license_limit(self): + """ + Check if the union tag is ``team_license_limit``. + + :rtype: bool + """ + return self._tag == "team_license_limit" + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == "other" + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissionsError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissionsError_validator = bv.Union(MembersSetPermissionsError) + + +class MembersSetPermissionsResult(bb.Struct): + """ + :ivar MembersSetPermissionsResult.team_member_id: + The member ID of the user to which the change was applied. + :ivar MembersSetPermissionsResult.role: + The role after the change. + """ + + __slots__ = [ + "_team_member_id_value", + "_role_value", + ] + + _has_required_fields = True + + def __init__(self, team_member_id=None, role=None): + self._team_member_id_value = bb.NOT_SET + self._role_value = bb.NOT_SET + if team_member_id is not None: + self.team_member_id = team_member_id + if role is not None: + self.role = role + + # Instance attribute type: str (validator is set below) + team_member_id = bb.Attribute("team_member_id") + + # Instance attribute type: AdminTier (validator is set below) + role = bb.Attribute("role", user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetPermissionsResult, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetPermissionsResult_validator = bv.Struct(MembersSetPermissionsResult) + + +class MembersSetProfileArg(bb.Struct): + """ + Exactly one of team_member_id, email, or external_id must be provided to + identify the user account. At least one of new_email, new_external_id, + new_given_name, and/or new_surname must be provided. + + :ivar MembersSetProfileArg.user: + Identity of user whose profile will be set. + :ivar MembersSetProfileArg.new_email: + New email for member. + :ivar MembersSetProfileArg.new_external_id: + New external ID for member. + :ivar MembersSetProfileArg.new_given_name: + New given name for member. + :ivar MembersSetProfileArg.new_surname: + New surname for member. + :ivar MembersSetProfileArg.new_persistent_id: + New persistent ID. This field only available to teams using persistent + ID SAML configuration. + :ivar MembersSetProfileArg.new_is_directory_restricted: + New value for whether the user is a directory restricted user. + """ + + __slots__ = [ + "_user_value", + "_new_email_value", + "_new_external_id_value", + "_new_given_name_value", + "_new_surname_value", + "_new_persistent_id_value", + "_new_is_directory_restricted_value", + ] + + _has_required_fields = True + + def __init__( + self, + user=None, + new_email=None, + new_external_id=None, + new_given_name=None, + new_surname=None, + new_persistent_id=None, + new_is_directory_restricted=None, + ): + self._user_value = bb.NOT_SET + self._new_email_value = bb.NOT_SET + self._new_external_id_value = bb.NOT_SET + self._new_given_name_value = bb.NOT_SET + self._new_surname_value = bb.NOT_SET + self._new_persistent_id_value = bb.NOT_SET + self._new_is_directory_restricted_value = bb.NOT_SET + if user is not None: + self.user = user + if new_email is not None: + self.new_email = new_email + if new_external_id is not None: + self.new_external_id = new_external_id + if new_given_name is not None: + self.new_given_name = new_given_name + if new_surname is not None: + self.new_surname = new_surname + if new_persistent_id is not None: + self.new_persistent_id = new_persistent_id + if new_is_directory_restricted is not None: + self.new_is_directory_restricted = new_is_directory_restricted + + # Instance attribute type: UserSelectorArg (validator is set below) + user = bb.Attribute("user", user_defined=True) + + # Instance attribute type: str (validator is set below) + new_email = bb.Attribute("new_email", nullable=True) + + # Instance attribute type: str (validator is set below) + new_external_id = bb.Attribute("new_external_id", nullable=True) + + # Instance attribute type: str (validator is set below) + new_given_name = bb.Attribute("new_given_name", nullable=True) + + # Instance attribute type: str (validator is set below) + new_surname = bb.Attribute("new_surname", nullable=True) + + # Instance attribute type: str (validator is set below) + new_persistent_id = bb.Attribute("new_persistent_id", nullable=True) + + # Instance attribute type: bool (validator is set below) + new_is_directory_restricted = bb.Attribute("new_is_directory_restricted", nullable=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetProfileArg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSetProfileArg_validator = bv.Struct(MembersSetProfileArg) + + +class MembersSetProfileError(MemberSelectorError): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar MembersSetProfileError.external_id_and_new_external_id_unsafe: + It is unsafe to use both external_id and new_external_id. + :ivar MembersSetProfileError.no_new_data_specified: + None of new_email, new_given_name, new_surname, or new_external_id are + specified. + :ivar MembersSetProfileError.email_reserved_for_other_user: + Email is already reserved for another user. + :ivar MembersSetProfileError.external_id_used_by_other_user: + The external ID is already in use by another team member. + :ivar MembersSetProfileError.set_profile_disallowed: + Modifying deleted users is not allowed. + :ivar MembersSetProfileError.param_cannot_be_empty: + Parameter new_email cannot be empty. + :ivar MembersSetProfileError.persistent_id_disabled: + Persistent ID is only available to teams with persistent ID SAML + configuration. Please contact Dropbox for more information. + :ivar MembersSetProfileError.persistent_id_used_by_other_user: + The persistent ID is already in use by another team member. + :ivar MembersSetProfileError.directory_restricted_off: + Directory Restrictions option is not available. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + external_id_and_new_external_id_unsafe = None # Attribute is overwritten below the class definition - cannot_keep_invited_user_account = None + no_new_data_specified = None # Attribute is overwritten below the class definition - cannot_retain_shares_when_data_wiped = None + email_reserved_for_other_user = None # Attribute is overwritten below the class definition - cannot_retain_shares_when_no_account_kept = None + external_id_used_by_other_user = None # Attribute is overwritten below the class definition - cannot_retain_shares_when_team_external_sharing_off = None + set_profile_disallowed = None # Attribute is overwritten below the class definition - cannot_keep_account = None + param_cannot_be_empty = None # Attribute is overwritten below the class definition - cannot_keep_account_under_legal_hold = None + persistent_id_disabled = None # Attribute is overwritten below the class definition - cannot_keep_account_required_to_sign_tos = None + persistent_id_used_by_other_user = None # Attribute is overwritten below the class definition - cannot_permanently_delete_and_transfer = None + directory_restricted_off = None # Attribute is overwritten below the class definition - member_is_transfer_destination = None + other = None - def is_remove_last_admin(self): + def is_external_id_and_new_external_id_unsafe(self): """ - Check if the union tag is ``remove_last_admin``. + Check if the union tag is ``external_id_and_new_external_id_unsafe``. :rtype: bool """ - return self._tag == "remove_last_admin" + return self._tag == "external_id_and_new_external_id_unsafe" - def is_cannot_keep_account_and_transfer(self): + def is_no_new_data_specified(self): """ - Check if the union tag is ``cannot_keep_account_and_transfer``. + Check if the union tag is ``no_new_data_specified``. :rtype: bool """ - return self._tag == "cannot_keep_account_and_transfer" + return self._tag == "no_new_data_specified" - def is_cannot_keep_account_and_delete_data(self): + def is_email_reserved_for_other_user(self): """ - Check if the union tag is ``cannot_keep_account_and_delete_data``. + Check if the union tag is ``email_reserved_for_other_user``. :rtype: bool """ - return self._tag == "cannot_keep_account_and_delete_data" + return self._tag == "email_reserved_for_other_user" - def is_cannot_keep_account_and_permanently_delete(self): + def is_external_id_used_by_other_user(self): """ - Check if the union tag is ``cannot_keep_account_and_permanently_delete``. + Check if the union tag is ``external_id_used_by_other_user``. :rtype: bool """ - return self._tag == "cannot_keep_account_and_permanently_delete" + return self._tag == "external_id_used_by_other_user" - def is_email_address_too_long_to_be_disabled(self): + def is_set_profile_disallowed(self): """ - Check if the union tag is ``email_address_too_long_to_be_disabled``. + Check if the union tag is ``set_profile_disallowed``. :rtype: bool """ - return self._tag == "email_address_too_long_to_be_disabled" + return self._tag == "set_profile_disallowed" - def is_cannot_keep_invited_user_account(self): + def is_param_cannot_be_empty(self): """ - Check if the union tag is ``cannot_keep_invited_user_account``. + Check if the union tag is ``param_cannot_be_empty``. :rtype: bool """ - return self._tag == "cannot_keep_invited_user_account" + return self._tag == "param_cannot_be_empty" - def is_cannot_retain_shares_when_data_wiped(self): + def is_persistent_id_disabled(self): """ - Check if the union tag is ``cannot_retain_shares_when_data_wiped``. + Check if the union tag is ``persistent_id_disabled``. :rtype: bool """ - return self._tag == "cannot_retain_shares_when_data_wiped" + return self._tag == "persistent_id_disabled" - def is_cannot_retain_shares_when_no_account_kept(self): + def is_persistent_id_used_by_other_user(self): """ - Check if the union tag is ``cannot_retain_shares_when_no_account_kept``. + Check if the union tag is ``persistent_id_used_by_other_user``. :rtype: bool """ - return self._tag == "cannot_retain_shares_when_no_account_kept" + return self._tag == "persistent_id_used_by_other_user" - def is_cannot_retain_shares_when_team_external_sharing_off(self): + def is_directory_restricted_off(self): """ - Check if the union tag is ``cannot_retain_shares_when_team_external_sharing_off``. + Check if the union tag is ``directory_restricted_off``. :rtype: bool """ - return self._tag == "cannot_retain_shares_when_team_external_sharing_off" + return self._tag == "directory_restricted_off" - def is_cannot_keep_account(self): + def is_other(self): """ - Check if the union tag is ``cannot_keep_account``. + Check if the union tag is ``other``. :rtype: bool """ - return self._tag == "cannot_keep_account" + return self._tag == "other" - def is_cannot_keep_account_under_legal_hold(self): - """ - Check if the union tag is ``cannot_keep_account_under_legal_hold``. + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSetProfileError, self)._process_custom_annotations( + annotation_type, field_path, processor + ) - :rtype: bool - """ - return self._tag == "cannot_keep_account_under_legal_hold" - def is_cannot_keep_account_required_to_sign_tos(self): - """ - Check if the union tag is ``cannot_keep_account_required_to_sign_tos``. +MembersSetProfileError_validator = bv.Union(MembersSetProfileError) - :rtype: bool - """ - return self._tag == "cannot_keep_account_required_to_sign_tos" - def is_cannot_permanently_delete_and_transfer(self): - """ - Check if the union tag is ``cannot_permanently_delete_and_transfer``. +class MembersSetProfilePhotoArg(bb.Struct): + """ + :ivar MembersSetProfilePhotoArg.user: + Identity of the user whose profile photo will be set. + :ivar MembersSetProfilePhotoArg.photo: + Image to set as the member's new profile photo. + """ - :rtype: bool - """ - return self._tag == "cannot_permanently_delete_and_transfer" + __slots__ = [ + "_user_value", + "_photo_value", + ] - def is_member_is_transfer_destination(self): - """ - Check if the union tag is ``member_is_transfer_destination``. + _has_required_fields = True - :rtype: bool - """ - return self._tag == "member_is_transfer_destination" + def __init__(self, user=None, photo=None): + self._user_value = bb.NOT_SET + self._photo_value = bb.NOT_SET + if user is not None: + self.user = user + if photo is not None: + self.photo = photo + + # Instance attribute type: UserSelectorArg (validator is set below) + user = bb.Attribute("user", user_defined=True) + + # Instance attribute type: account.PhotoSourceArg (validator is set below) + photo = bb.Attribute("photo", user_defined=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersRemoveError, self)._process_custom_annotations( + super(MembersSetProfilePhotoArg, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersRemoveError_validator = bv.Union(MembersRemoveError) +MembersSetProfilePhotoArg_validator = bv.Struct(MembersSetProfilePhotoArg) -class MembersSendWelcomeError(MemberSelectorError): +class MembersSetProfilePhotoError(MemberSelectorError): """ This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. + + :ivar MembersSetProfilePhotoError.set_profile_disallowed: + Modifying deleted users is not allowed. """ _catch_all = "other" # Attribute is overwritten below the class definition + set_profile_disallowed = None + # Attribute is overwritten below the class definition other = None + @classmethod + def photo_error(cls, val): + """ + Create an instance of this class set to the ``photo_error`` tag with + value ``val``. + + :param account.SetProfilePhotoError val: + :rtype: MembersSetProfilePhotoError + """ + return cls("photo_error", val) + + def is_set_profile_disallowed(self): + """ + Check if the union tag is ``set_profile_disallowed``. + + :rtype: bool + """ + return self._tag == "set_profile_disallowed" + + def is_photo_error(self): + """ + Check if the union tag is ``photo_error``. + + :rtype: bool + """ + return self._tag == "photo_error" + def is_other(self): """ Check if the union tag is ``other``. @@ -10337,118 +10395,186 @@ def is_other(self): """ return self._tag == "other" + def get_photo_error(self): + """ + Only call this if :meth:`is_photo_error` is true. + + :rtype: account.SetProfilePhotoError + """ + if not self.is_photo_error(): + raise AttributeError("tag 'photo_error' not set") + return self._value + def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSendWelcomeError, self)._process_custom_annotations( + super(MembersSetProfilePhotoError, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSendWelcomeError_validator = bv.Union(MembersSendWelcomeError) +MembersSetProfilePhotoError_validator = bv.Union(MembersSetProfilePhotoError) -class MembersSetPermissions2Arg(bb.Struct): +class MembersSuspendBatchArg(bb.Struct): """ - Exactly one of team_member_id, email, or external_id must be provided to - identify the user account. + Launches one action-specific member suspension batch job. - :ivar MembersSetPermissions2Arg.user: - Identity of user whose role will be set. - :ivar MembersSetPermissions2Arg.new_roles: - The new roles for the member. Send empty list to make user member only. - For now, only up to one role is allowed. + :ivar MembersSuspendBatchArg.members: + Must contain between 1 and 500 targets. The launch handler also rejects + duplicate client item IDs and duplicate member selectors. """ - __slots__ = [ - "_user_value", - "_new_roles_value", - ] + __slots__ = [ + "_members_value", + ] + + _has_required_fields = True + + def __init__(self, members=None): + self._members_value = bb.NOT_SET + if members is not None: + self.members = members + + # Instance attribute type: list of [MembersSuspendBatchTarget] (validator is set below) + members = bb.Attribute("members") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSuspendBatchArg, self)._process_custom_annotations( + annotation_type, field_path, processor + ) + + +MembersSuspendBatchArg_validator = bv.Struct(MembersSuspendBatchArg) + + +class MembersSuspendBatchComplete(bb.Struct): + __slots__ = [ + "_requested_value", + "_suspended_value", + "_failed_value", + "_unknown_value", + "_report_delivery_value", + ] + + _has_required_fields = True + + def __init__( + self, requested=None, suspended=None, failed=None, unknown=None, report_delivery=None + ): + self._requested_value = bb.NOT_SET + self._suspended_value = bb.NOT_SET + self._failed_value = bb.NOT_SET + self._unknown_value = bb.NOT_SET + self._report_delivery_value = bb.NOT_SET + if requested is not None: + self.requested = requested + if suspended is not None: + self.suspended = suspended + if failed is not None: + self.failed = failed + if unknown is not None: + self.unknown = unknown + if report_delivery is not None: + self.report_delivery = report_delivery + + # Instance attribute type: int (validator is set below) + requested = bb.Attribute("requested") - _has_required_fields = True + # Instance attribute type: int (validator is set below) + suspended = bb.Attribute("suspended") - def __init__(self, user=None, new_roles=None): - self._user_value = bb.NOT_SET - self._new_roles_value = bb.NOT_SET - if user is not None: - self.user = user - if new_roles is not None: - self.new_roles = new_roles + # Instance attribute type: int (validator is set below) + failed = bb.Attribute("failed") - # Instance attribute type: UserSelectorArg (validator is set below) - user = bb.Attribute("user", user_defined=True) + # Instance attribute type: int (validator is set below) + unknown = bb.Attribute("unknown") - # Instance attribute type: list of [str] (validator is set below) - new_roles = bb.Attribute("new_roles", nullable=True) + # Instance attribute type: MembersSuspendBatchReportDeliveryStatus (validator is set below) + report_delivery = bb.Attribute("report_delivery", user_defined=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissions2Arg, self)._process_custom_annotations( + super(MembersSuspendBatchComplete, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetPermissions2Arg_validator = bv.Struct(MembersSetPermissions2Arg) +MembersSuspendBatchComplete_validator = bv.Struct(MembersSuspendBatchComplete) -class MembersSetPermissions2Error(UserSelectorError): +class MembersSuspendBatchError(bb.Union): """ + A typed launch rejection. Authorization failures continue to use the API v2 + authentication/permission error surface. + This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar MembersSetPermissions2Error.last_admin: - Cannot remove the admin setting of the last admin. - :ivar MembersSetPermissions2Error.user_not_in_team: - The user is not a member of the team. - :ivar MembersSetPermissions2Error.cannot_set_permissions: - Cannot remove/grant permissions. This can happen if the team member is - suspended. - :ivar MembersSetPermissions2Error.role_not_found: - No matching role found. At least one of the provided new_roles does not - exist on this team. + :ivar MembersSuspendBatchError.too_many_members: + The request contains more than 500 members. + :ivar MembersSuspendBatchError.duplicate_client_item_id: + More than one target uses the same client item ID. + :ivar MembersSuspendBatchError.duplicate_team_member_id: + More than one target selects the same team member. + :ivar MembersSuspendBatchError.acting_admin: + The acting administrator cannot suspend their own account. + :ivar MembersSuspendBatchError.last_admin: + Suspending the selected members would leave the team without an active + admin. """ _catch_all = "other" # Attribute is overwritten below the class definition - last_admin = None + too_many_members = None # Attribute is overwritten below the class definition - user_not_in_team = None + duplicate_client_item_id = None # Attribute is overwritten below the class definition - cannot_set_permissions = None + duplicate_team_member_id = None # Attribute is overwritten below the class definition - role_not_found = None + acting_admin = None + # Attribute is overwritten below the class definition + last_admin = None # Attribute is overwritten below the class definition other = None - def is_last_admin(self): + def is_too_many_members(self): """ - Check if the union tag is ``last_admin``. + Check if the union tag is ``too_many_members``. :rtype: bool """ - return self._tag == "last_admin" + return self._tag == "too_many_members" - def is_user_not_in_team(self): + def is_duplicate_client_item_id(self): """ - Check if the union tag is ``user_not_in_team``. + Check if the union tag is ``duplicate_client_item_id``. :rtype: bool """ - return self._tag == "user_not_in_team" + return self._tag == "duplicate_client_item_id" - def is_cannot_set_permissions(self): + def is_duplicate_team_member_id(self): """ - Check if the union tag is ``cannot_set_permissions``. + Check if the union tag is ``duplicate_team_member_id``. :rtype: bool """ - return self._tag == "cannot_set_permissions" + return self._tag == "duplicate_team_member_id" - def is_role_not_found(self): + def is_acting_admin(self): """ - Check if the union tag is ``role_not_found``. + Check if the union tag is ``acting_admin``. :rtype: bool """ - return self._tag == "role_not_found" + return self._tag == "acting_admin" + + def is_last_admin(self): + """ + Check if the union tag is ``last_admin``. + + :rtype: bool + """ + return self._tag == "last_admin" def is_other(self): """ @@ -10459,426 +10585,329 @@ def is_other(self): return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissions2Error, self)._process_custom_annotations( + super(MembersSuspendBatchError, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetPermissions2Error_validator = bv.Union(MembersSetPermissions2Error) +MembersSuspendBatchError_validator = bv.Union(MembersSuspendBatchError) -class MembersSetPermissions2Result(bb.Struct): - """ - :ivar MembersSetPermissions2Result.team_member_id: - The member ID of the user to which the change was applied. - :ivar MembersSetPermissions2Result.roles: - The roles after the change. Empty in case the user become a non-admin. +class MembersSuspendBatchJobStatus(async_.PollResultBase): """ + Coarse job state. Live row progress and report contents are intentionally + omitted; the authorized team admin who initiated the batch receives row + details in the terminal email report. - __slots__ = [ - "_team_member_id_value", - "_roles_value", - ] + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ - _has_required_fields = True + _catch_all = "other" + # Attribute is overwritten below the class definition + other = None - def __init__(self, team_member_id=None, roles=None): - self._team_member_id_value = bb.NOT_SET - self._roles_value = bb.NOT_SET - if team_member_id is not None: - self.team_member_id = team_member_id - if roles is not None: - self.roles = roles + @classmethod + def complete(cls, val): + """ + Create an instance of this class set to the ``complete`` tag with value + ``val``. - # Instance attribute type: str (validator is set below) - team_member_id = bb.Attribute("team_member_id") + :param MembersSuspendBatchComplete val: + :rtype: MembersSuspendBatchJobStatus + """ + return cls("complete", val) - # Instance attribute type: list of [TeamMemberRole] (validator is set below) - roles = bb.Attribute("roles", nullable=True) + @classmethod + def failed(cls, val): + """ + Create an instance of this class set to the ``failed`` tag with value + ``val``. - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissions2Result, self)._process_custom_annotations( - annotation_type, field_path, processor - ) + :param MembersSuspendBatchTaskFailure val: + :rtype: MembersSuspendBatchJobStatus + """ + return cls("failed", val) + def is_complete(self): + """ + Check if the union tag is ``complete``. -MembersSetPermissions2Result_validator = bv.Struct(MembersSetPermissions2Result) + :rtype: bool + """ + return self._tag == "complete" + def is_failed(self): + """ + Check if the union tag is ``failed``. -class MembersSetPermissionsArg(bb.Struct): - """ - Exactly one of team_member_id, email, or external_id must be provided to - identify the user account. + :rtype: bool + """ + return self._tag == "failed" - :ivar MembersSetPermissionsArg.user: - Identity of user whose role will be set. - :ivar MembersSetPermissionsArg.new_role: - The new role of the member. - """ + def is_other(self): + """ + Check if the union tag is ``other``. - __slots__ = [ - "_user_value", - "_new_role_value", - ] + :rtype: bool + """ + return self._tag == "other" - _has_required_fields = True + def get_complete(self): + """ + Only call this if :meth:`is_complete` is true. - def __init__(self, user=None, new_role=None): - self._user_value = bb.NOT_SET - self._new_role_value = bb.NOT_SET - if user is not None: - self.user = user - if new_role is not None: - self.new_role = new_role + :rtype: MembersSuspendBatchComplete + """ + if not self.is_complete(): + raise AttributeError("tag 'complete' not set") + return self._value - # Instance attribute type: UserSelectorArg (validator is set below) - user = bb.Attribute("user", user_defined=True) + def get_failed(self): + """ + Only call this if :meth:`is_failed` is true. - # Instance attribute type: AdminTier (validator is set below) - new_role = bb.Attribute("new_role", user_defined=True) + :rtype: MembersSuspendBatchTaskFailure + """ + if not self.is_failed(): + raise AttributeError("tag 'failed' not set") + return self._value def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissionsArg, self)._process_custom_annotations( + super(MembersSuspendBatchJobStatus, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetPermissionsArg_validator = bv.Struct(MembersSetPermissionsArg) +MembersSuspendBatchJobStatus_validator = bv.Union(MembersSuspendBatchJobStatus) -class MembersSetPermissionsError(UserSelectorError): +class MembersSuspendBatchReportDeliveryStatus(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - - :ivar MembersSetPermissionsError.last_admin: - Cannot remove the admin setting of the last admin. - :ivar MembersSetPermissionsError.user_not_in_team: - The user is not a member of the team. - :ivar MembersSetPermissionsError.cannot_set_permissions: - Cannot remove/grant permissions. - :ivar MembersSetPermissionsError.team_license_limit: - Team is full. The organization has no available licenses. """ _catch_all = "other" # Attribute is overwritten below the class definition - last_admin = None + members_suspend_batch_report_delivery_status_unspecified = None # Attribute is overwritten below the class definition - user_not_in_team = None + members_suspend_batch_report_delivery_status_pending = None # Attribute is overwritten below the class definition - cannot_set_permissions = None + members_suspend_batch_report_delivery_status_delivered = None # Attribute is overwritten below the class definition - team_license_limit = None + members_suspend_batch_report_delivery_status_failed = None # Attribute is overwritten below the class definition other = None - def is_last_admin(self): - """ - Check if the union tag is ``last_admin``. - - :rtype: bool - """ - return self._tag == "last_admin" - - def is_user_not_in_team(self): + def is_members_suspend_batch_report_delivery_status_unspecified(self): """ - Check if the union tag is ``user_not_in_team``. + Check if the union tag is ``members_suspend_batch_report_delivery_status_unspecified``. :rtype: bool """ - return self._tag == "user_not_in_team" + return self._tag == "members_suspend_batch_report_delivery_status_unspecified" - def is_cannot_set_permissions(self): + def is_members_suspend_batch_report_delivery_status_pending(self): """ - Check if the union tag is ``cannot_set_permissions``. + Check if the union tag is ``members_suspend_batch_report_delivery_status_pending``. :rtype: bool """ - return self._tag == "cannot_set_permissions" + return self._tag == "members_suspend_batch_report_delivery_status_pending" - def is_team_license_limit(self): + def is_members_suspend_batch_report_delivery_status_delivered(self): """ - Check if the union tag is ``team_license_limit``. + Check if the union tag is ``members_suspend_batch_report_delivery_status_delivered``. :rtype: bool """ - return self._tag == "team_license_limit" - - def is_other(self): - """ - Check if the union tag is ``other``. + return self._tag == "members_suspend_batch_report_delivery_status_delivered" - :rtype: bool + def is_members_suspend_batch_report_delivery_status_failed(self): """ - return self._tag == "other" - - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissionsError, self)._process_custom_annotations( - annotation_type, field_path, processor - ) - - -MembersSetPermissionsError_validator = bv.Union(MembersSetPermissionsError) - - -class MembersSetPermissionsResult(bb.Struct): - """ - :ivar MembersSetPermissionsResult.team_member_id: - The member ID of the user to which the change was applied. - :ivar MembersSetPermissionsResult.role: - The role after the change. - """ - - __slots__ = [ - "_team_member_id_value", - "_role_value", - ] - - _has_required_fields = True + Check if the union tag is ``members_suspend_batch_report_delivery_status_failed``. - def __init__(self, team_member_id=None, role=None): - self._team_member_id_value = bb.NOT_SET - self._role_value = bb.NOT_SET - if team_member_id is not None: - self.team_member_id = team_member_id - if role is not None: - self.role = role + :rtype: bool + """ + return self._tag == "members_suspend_batch_report_delivery_status_failed" - # Instance attribute type: str (validator is set below) - team_member_id = bb.Attribute("team_member_id") + def is_other(self): + """ + Check if the union tag is ``other``. - # Instance attribute type: AdminTier (validator is set below) - role = bb.Attribute("role", user_defined=True) + :rtype: bool + """ + return self._tag == "other" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetPermissionsResult, self)._process_custom_annotations( + super(MembersSuspendBatchReportDeliveryStatus, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetPermissionsResult_validator = bv.Struct(MembersSetPermissionsResult) +MembersSuspendBatchReportDeliveryStatus_validator = bv.Union( + MembersSuspendBatchReportDeliveryStatus +) -class MembersSetProfileArg(bb.Struct): +class MembersSuspendError(MembersDeactivateError): """ - Exactly one of team_member_id, email, or external_id must be provided to - identify the user account. At least one of new_email, new_external_id, - new_given_name, and/or new_surname must be provided. + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. - :ivar MembersSetProfileArg.user: - Identity of user whose profile will be set. - :ivar MembersSetProfileArg.new_email: - New email for member. - :ivar MembersSetProfileArg.new_external_id: - New external ID for member. - :ivar MembersSetProfileArg.new_given_name: - New given name for member. - :ivar MembersSetProfileArg.new_surname: - New surname for member. - :ivar MembersSetProfileArg.new_persistent_id: - New persistent ID. This field only available to teams using persistent - ID SAML configuration. - :ivar MembersSetProfileArg.new_is_directory_restricted: - New value for whether the user is a directory restricted user. + :ivar MembersSuspendError.suspend_inactive_user: + The user is not active, so it cannot be suspended. + :ivar MembersSuspendError.suspend_last_admin: + The user is the last admin of the team, so it cannot be suspended. + :ivar MembersSuspendError.team_license_limit: + Team is full. The organization has no available licenses. """ - __slots__ = [ - "_user_value", - "_new_email_value", - "_new_external_id_value", - "_new_given_name_value", - "_new_surname_value", - "_new_persistent_id_value", - "_new_is_directory_restricted_value", - ] - - _has_required_fields = True - - def __init__( - self, - user=None, - new_email=None, - new_external_id=None, - new_given_name=None, - new_surname=None, - new_persistent_id=None, - new_is_directory_restricted=None, - ): - self._user_value = bb.NOT_SET - self._new_email_value = bb.NOT_SET - self._new_external_id_value = bb.NOT_SET - self._new_given_name_value = bb.NOT_SET - self._new_surname_value = bb.NOT_SET - self._new_persistent_id_value = bb.NOT_SET - self._new_is_directory_restricted_value = bb.NOT_SET - if user is not None: - self.user = user - if new_email is not None: - self.new_email = new_email - if new_external_id is not None: - self.new_external_id = new_external_id - if new_given_name is not None: - self.new_given_name = new_given_name - if new_surname is not None: - self.new_surname = new_surname - if new_persistent_id is not None: - self.new_persistent_id = new_persistent_id - if new_is_directory_restricted is not None: - self.new_is_directory_restricted = new_is_directory_restricted - - # Instance attribute type: UserSelectorArg (validator is set below) - user = bb.Attribute("user", user_defined=True) + # Attribute is overwritten below the class definition + suspend_inactive_user = None + # Attribute is overwritten below the class definition + suspend_last_admin = None + # Attribute is overwritten below the class definition + team_license_limit = None - # Instance attribute type: str (validator is set below) - new_email = bb.Attribute("new_email", nullable=True) + def is_suspend_inactive_user(self): + """ + Check if the union tag is ``suspend_inactive_user``. - # Instance attribute type: str (validator is set below) - new_external_id = bb.Attribute("new_external_id", nullable=True) + :rtype: bool + """ + return self._tag == "suspend_inactive_user" - # Instance attribute type: str (validator is set below) - new_given_name = bb.Attribute("new_given_name", nullable=True) + def is_suspend_last_admin(self): + """ + Check if the union tag is ``suspend_last_admin``. - # Instance attribute type: str (validator is set below) - new_surname = bb.Attribute("new_surname", nullable=True) + :rtype: bool + """ + return self._tag == "suspend_last_admin" - # Instance attribute type: str (validator is set below) - new_persistent_id = bb.Attribute("new_persistent_id", nullable=True) + def is_team_license_limit(self): + """ + Check if the union tag is ``team_license_limit``. - # Instance attribute type: bool (validator is set below) - new_is_directory_restricted = bb.Attribute("new_is_directory_restricted", nullable=True) + :rtype: bool + """ + return self._tag == "team_license_limit" def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetProfileArg, self)._process_custom_annotations( + super(MembersSuspendError, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetProfileArg_validator = bv.Struct(MembersSetProfileArg) +MembersSuspendError_validator = bv.Union(MembersSuspendError) -class MembersSetProfileError(MemberSelectorError): +class MembersSuspendBatchRowFailure(MembersSuspendError): """ + Stable machine-readable reasons used by the terminal row report. + This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - - :ivar MembersSetProfileError.external_id_and_new_external_id_unsafe: - It is unsafe to use both external_id and new_external_id. - :ivar MembersSetProfileError.no_new_data_specified: - None of new_email, new_given_name, new_surname, or new_external_id are - specified. - :ivar MembersSetProfileError.email_reserved_for_other_user: - Email is already reserved for another user. - :ivar MembersSetProfileError.external_id_used_by_other_user: - The external ID is already in use by another team member. - :ivar MembersSetProfileError.set_profile_disallowed: - Modifying deleted users is not allowed. - :ivar MembersSetProfileError.param_cannot_be_empty: - Parameter new_email cannot be empty. - :ivar MembersSetProfileError.persistent_id_disabled: - Persistent ID is only available to teams with persistent ID SAML - configuration. Please contact Dropbox for more information. - :ivar MembersSetProfileError.persistent_id_used_by_other_user: - The persistent ID is already in use by another team member. - :ivar MembersSetProfileError.directory_restricted_off: - Directory Restrictions option is not available. """ - _catch_all = "other" - # Attribute is overwritten below the class definition - external_id_and_new_external_id_unsafe = None - # Attribute is overwritten below the class definition - no_new_data_specified = None - # Attribute is overwritten below the class definition - email_reserved_for_other_user = None - # Attribute is overwritten below the class definition - external_id_used_by_other_user = None - # Attribute is overwritten below the class definition - set_profile_disallowed = None - # Attribute is overwritten below the class definition - param_cannot_be_empty = None - # Attribute is overwritten below the class definition - persistent_id_disabled = None # Attribute is overwritten below the class definition - persistent_id_used_by_other_user = None + protected_acting_admin = None # Attribute is overwritten below the class definition - directory_restricted_off = None + permission_changed = None # Attribute is overwritten below the class definition - other = None + suspend_failed = None - def is_external_id_and_new_external_id_unsafe(self): + def is_protected_acting_admin(self): """ - Check if the union tag is ``external_id_and_new_external_id_unsafe``. + Check if the union tag is ``protected_acting_admin``. :rtype: bool """ - return self._tag == "external_id_and_new_external_id_unsafe" + return self._tag == "protected_acting_admin" - def is_no_new_data_specified(self): + def is_permission_changed(self): """ - Check if the union tag is ``no_new_data_specified``. + Check if the union tag is ``permission_changed``. :rtype: bool """ - return self._tag == "no_new_data_specified" + return self._tag == "permission_changed" - def is_email_reserved_for_other_user(self): + def is_suspend_failed(self): """ - Check if the union tag is ``email_reserved_for_other_user``. + Check if the union tag is ``suspend_failed``. :rtype: bool """ - return self._tag == "email_reserved_for_other_user" + return self._tag == "suspend_failed" - def is_external_id_used_by_other_user(self): - """ - Check if the union tag is ``external_id_used_by_other_user``. + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(MembersSuspendBatchRowFailure, self)._process_custom_annotations( + annotation_type, field_path, processor + ) - :rtype: bool - """ - return self._tag == "external_id_used_by_other_user" - def is_set_profile_disallowed(self): - """ - Check if the union tag is ``set_profile_disallowed``. +MembersSuspendBatchRowFailure_validator = bv.Union(MembersSuspendBatchRowFailure) - :rtype: bool - """ - return self._tag == "set_profile_disallowed" - def is_param_cannot_be_empty(self): +class MembersSuspendBatchRowOutcome(bb.Union): + """ + The terminal outcome for one requested member. Row outcomes are delivered in + the report rather than embedded in the status response. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = "other" + # Attribute is overwritten below the class definition + suspended = None + # Attribute is overwritten below the class definition + unknown = None + # Attribute is overwritten below the class definition + other = None + + @classmethod + def failed(cls, val): """ - Check if the union tag is ``param_cannot_be_empty``. + Create an instance of this class set to the ``failed`` tag with value + ``val``. - :rtype: bool + :param MembersSuspendBatchRowFailure val: + :rtype: MembersSuspendBatchRowOutcome """ - return self._tag == "param_cannot_be_empty" + return cls("failed", val) - def is_persistent_id_disabled(self): + def is_suspended(self): """ - Check if the union tag is ``persistent_id_disabled``. + Check if the union tag is ``suspended``. :rtype: bool """ - return self._tag == "persistent_id_disabled" + return self._tag == "suspended" - def is_persistent_id_used_by_other_user(self): + def is_failed(self): """ - Check if the union tag is ``persistent_id_used_by_other_user``. + Check if the union tag is ``failed``. :rtype: bool """ - return self._tag == "persistent_id_used_by_other_user" + return self._tag == "failed" - def is_directory_restricted_off(self): + def is_unknown(self): """ - Check if the union tag is ``directory_restricted_off``. + Check if the union tag is ``unknown``. :rtype: bool """ - return self._tag == "directory_restricted_off" + return self._tag == "unknown" def is_other(self): """ @@ -10888,95 +10917,81 @@ def is_other(self): """ return self._tag == "other" + def get_failed(self): + """ + Only call this if :meth:`is_failed` is true. + + :rtype: MembersSuspendBatchRowFailure + """ + if not self.is_failed(): + raise AttributeError("tag 'failed' not set") + return self._value + def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetProfileError, self)._process_custom_annotations( + super(MembersSuspendBatchRowOutcome, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetProfileError_validator = bv.Union(MembersSetProfileError) +MembersSuspendBatchRowOutcome_validator = bv.Union(MembersSuspendBatchRowOutcome) -class MembersSetProfilePhotoArg(bb.Struct): +class MembersSuspendBatchTarget(bb.Struct): """ - :ivar MembersSetProfilePhotoArg.user: - Identity of the user whose profile photo will be set. - :ivar MembersSetProfilePhotoArg.photo: - Image to set as the member's new profile photo. + One member selected for suspension. The opaque client item ID correlates the + eventual report row with the caller's input without sending CSV data. """ __slots__ = [ - "_user_value", - "_photo_value", + "_client_item_id_value", + "_suspend_arg_value", ] _has_required_fields = True - def __init__(self, user=None, photo=None): - self._user_value = bb.NOT_SET - self._photo_value = bb.NOT_SET - if user is not None: - self.user = user - if photo is not None: - self.photo = photo + def __init__(self, client_item_id=None, suspend_arg=None): + self._client_item_id_value = bb.NOT_SET + self._suspend_arg_value = bb.NOT_SET + if client_item_id is not None: + self.client_item_id = client_item_id + if suspend_arg is not None: + self.suspend_arg = suspend_arg - # Instance attribute type: UserSelectorArg (validator is set below) - user = bb.Attribute("user", user_defined=True) + # Instance attribute type: str (validator is set below) + client_item_id = bb.Attribute("client_item_id") - # Instance attribute type: account.PhotoSourceArg (validator is set below) - photo = bb.Attribute("photo", user_defined=True) + # Instance attribute type: MembersDeactivateArg (validator is set below) + suspend_arg = bb.Attribute("suspend_arg", user_defined=True) def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetProfilePhotoArg, self)._process_custom_annotations( + super(MembersSuspendBatchTarget, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetProfilePhotoArg_validator = bv.Struct(MembersSetProfilePhotoArg) +MembersSuspendBatchTarget_validator = bv.Struct(MembersSuspendBatchTarget) -class MembersSetProfilePhotoError(MemberSelectorError): +class MembersSuspendBatchTaskFailure(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - - :ivar MembersSetProfilePhotoError.set_profile_disallowed: - Modifying deleted users is not allowed. """ _catch_all = "other" # Attribute is overwritten below the class definition - set_profile_disallowed = None + unusable_result = None # Attribute is overwritten below the class definition other = None - @classmethod - def photo_error(cls, val): - """ - Create an instance of this class set to the ``photo_error`` tag with - value ``val``. - - :param account.SetProfilePhotoError val: - :rtype: MembersSetProfilePhotoError - """ - return cls("photo_error", val) - - def is_set_profile_disallowed(self): - """ - Check if the union tag is ``set_profile_disallowed``. - - :rtype: bool - """ - return self._tag == "set_profile_disallowed" - - def is_photo_error(self): + def is_unusable_result(self): """ - Check if the union tag is ``photo_error``. + Check if the union tag is ``unusable_result``. :rtype: bool """ - return self._tag == "photo_error" + return self._tag == "unusable_result" def is_other(self): """ @@ -10986,23 +11001,13 @@ def is_other(self): """ return self._tag == "other" - def get_photo_error(self): - """ - Only call this if :meth:`is_photo_error` is true. - - :rtype: account.SetProfilePhotoError - """ - if not self.is_photo_error(): - raise AttributeError("tag 'photo_error' not set") - return self._value - def _process_custom_annotations(self, annotation_type, field_path, processor): - super(MembersSetProfilePhotoError, self)._process_custom_annotations( + super(MembersSuspendBatchTaskFailure, self)._process_custom_annotations( annotation_type, field_path, processor ) -MembersSetProfilePhotoError_validator = bv.Union(MembersSetProfilePhotoError) +MembersSuspendBatchTaskFailure_validator = bv.Union(MembersSuspendBatchTaskFailure) class MembersTransferFormerMembersFilesError(MembersTransferFilesError): @@ -16168,182 +16173,6 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): BaseTeamFolderError.other = BaseTeamFolderError("other") -BulkSuspendArg.members.validator = bv.List(BulkSuspendMemberTarget_validator) -BulkSuspendArg._all_field_names_ = set(["members"]) -BulkSuspendArg._all_fields_ = [("members", BulkSuspendArg.members.validator)] - -BulkSuspendComplete.requested.validator = bv.Int64() -BulkSuspendComplete.suspended.validator = bv.Int64() -BulkSuspendComplete.failed.validator = bv.Int64() -BulkSuspendComplete.unknown.validator = bv.Int64() -BulkSuspendComplete.report_delivery.validator = BulkSuspendReportDeliveryStatus_validator -BulkSuspendComplete._all_field_names_ = set( - [ - "requested", - "suspended", - "failed", - "unknown", - "report_delivery", - ] -) -BulkSuspendComplete._all_fields_ = [ - ("requested", BulkSuspendComplete.requested.validator), - ("suspended", BulkSuspendComplete.suspended.validator), - ("failed", BulkSuspendComplete.failed.validator), - ("unknown", BulkSuspendComplete.unknown.validator), - ("report_delivery", BulkSuspendComplete.report_delivery.validator), -] - -BulkSuspendError._invalid_request_validator = bv.Void() -BulkSuspendError._too_many_members_validator = bv.Void() -BulkSuspendError._duplicate_client_item_id_validator = bv.Void() -BulkSuspendError._duplicate_team_member_id_validator = bv.Void() -BulkSuspendError._acting_admin_validator = bv.Void() -BulkSuspendError._last_admin_validator = bv.Void() -BulkSuspendError._other_validator = bv.Void() -BulkSuspendError._tagmap = { - "invalid_request": BulkSuspendError._invalid_request_validator, - "too_many_members": BulkSuspendError._too_many_members_validator, - "duplicate_client_item_id": BulkSuspendError._duplicate_client_item_id_validator, - "duplicate_team_member_id": BulkSuspendError._duplicate_team_member_id_validator, - "acting_admin": BulkSuspendError._acting_admin_validator, - "last_admin": BulkSuspendError._last_admin_validator, - "other": BulkSuspendError._other_validator, -} - -BulkSuspendError.invalid_request = BulkSuspendError("invalid_request") -BulkSuspendError.too_many_members = BulkSuspendError("too_many_members") -BulkSuspendError.duplicate_client_item_id = BulkSuspendError("duplicate_client_item_id") -BulkSuspendError.duplicate_team_member_id = BulkSuspendError("duplicate_team_member_id") -BulkSuspendError.acting_admin = BulkSuspendError("acting_admin") -BulkSuspendError.last_admin = BulkSuspendError("last_admin") -BulkSuspendError.other = BulkSuspendError("other") - -BulkSuspendJobStatus._complete_validator = BulkSuspendComplete_validator -BulkSuspendJobStatus._failed_validator = BulkSuspendTaskFailure_validator -BulkSuspendJobStatus._other_validator = bv.Void() -BulkSuspendJobStatus._tagmap = { - "complete": BulkSuspendJobStatus._complete_validator, - "failed": BulkSuspendJobStatus._failed_validator, - "other": BulkSuspendJobStatus._other_validator, -} -BulkSuspendJobStatus._tagmap.update(async_.PollResultBase._tagmap) - -BulkSuspendJobStatus.other = BulkSuspendJobStatus("other") - -BulkSuspendMemberTarget.client_item_id.validator = bv.String() -BulkSuspendMemberTarget.suspend_arg.validator = MembersDeactivateArg_validator -BulkSuspendMemberTarget._all_field_names_ = set( - [ - "client_item_id", - "suspend_arg", - ] -) -BulkSuspendMemberTarget._all_fields_ = [ - ("client_item_id", BulkSuspendMemberTarget.client_item_id.validator), - ("suspend_arg", BulkSuspendMemberTarget.suspend_arg.validator), -] - -BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_unspecified_validator = ( - bv.Void() -) -BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_pending_validator = bv.Void() -BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_delivered_validator = bv.Void() -BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_failed_validator = bv.Void() -BulkSuspendReportDeliveryStatus._other_validator = bv.Void() -BulkSuspendReportDeliveryStatus._tagmap = { - "bulk_suspend_report_delivery_status_unspecified": BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_unspecified_validator, - "bulk_suspend_report_delivery_status_pending": BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_pending_validator, - "bulk_suspend_report_delivery_status_delivered": BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_delivered_validator, - "bulk_suspend_report_delivery_status_failed": BulkSuspendReportDeliveryStatus._bulk_suspend_report_delivery_status_failed_validator, - "other": BulkSuspendReportDeliveryStatus._other_validator, -} - -BulkSuspendReportDeliveryStatus.bulk_suspend_report_delivery_status_unspecified = ( - BulkSuspendReportDeliveryStatus("bulk_suspend_report_delivery_status_unspecified") -) -BulkSuspendReportDeliveryStatus.bulk_suspend_report_delivery_status_pending = ( - BulkSuspendReportDeliveryStatus("bulk_suspend_report_delivery_status_pending") -) -BulkSuspendReportDeliveryStatus.bulk_suspend_report_delivery_status_delivered = ( - BulkSuspendReportDeliveryStatus("bulk_suspend_report_delivery_status_delivered") -) -BulkSuspendReportDeliveryStatus.bulk_suspend_report_delivery_status_failed = ( - BulkSuspendReportDeliveryStatus("bulk_suspend_report_delivery_status_failed") -) -BulkSuspendReportDeliveryStatus.other = BulkSuspendReportDeliveryStatus("other") - -UserSelectorError._user_not_found_validator = bv.Void() -UserSelectorError._tagmap = { - "user_not_found": UserSelectorError._user_not_found_validator, -} - -UserSelectorError.user_not_found = UserSelectorError("user_not_found") - -MembersDeactivateError._user_not_in_team_validator = bv.Void() -MembersDeactivateError._other_validator = bv.Void() -MembersDeactivateError._tagmap = { - "user_not_in_team": MembersDeactivateError._user_not_in_team_validator, - "other": MembersDeactivateError._other_validator, -} -MembersDeactivateError._tagmap.update(UserSelectorError._tagmap) - -MembersDeactivateError.user_not_in_team = MembersDeactivateError("user_not_in_team") -MembersDeactivateError.other = MembersDeactivateError("other") - -MembersSuspendError._suspend_inactive_user_validator = bv.Void() -MembersSuspendError._suspend_last_admin_validator = bv.Void() -MembersSuspendError._team_license_limit_validator = bv.Void() -MembersSuspendError._tagmap = { - "suspend_inactive_user": MembersSuspendError._suspend_inactive_user_validator, - "suspend_last_admin": MembersSuspendError._suspend_last_admin_validator, - "team_license_limit": MembersSuspendError._team_license_limit_validator, -} -MembersSuspendError._tagmap.update(MembersDeactivateError._tagmap) - -MembersSuspendError.suspend_inactive_user = MembersSuspendError("suspend_inactive_user") -MembersSuspendError.suspend_last_admin = MembersSuspendError("suspend_last_admin") -MembersSuspendError.team_license_limit = MembersSuspendError("team_license_limit") - -BulkSuspendRowFailure._protected_acting_admin_validator = bv.Void() -BulkSuspendRowFailure._permission_changed_validator = bv.Void() -BulkSuspendRowFailure._suspend_failed_validator = bv.Void() -BulkSuspendRowFailure._tagmap = { - "protected_acting_admin": BulkSuspendRowFailure._protected_acting_admin_validator, - "permission_changed": BulkSuspendRowFailure._permission_changed_validator, - "suspend_failed": BulkSuspendRowFailure._suspend_failed_validator, -} -BulkSuspendRowFailure._tagmap.update(MembersSuspendError._tagmap) - -BulkSuspendRowFailure.protected_acting_admin = BulkSuspendRowFailure("protected_acting_admin") -BulkSuspendRowFailure.permission_changed = BulkSuspendRowFailure("permission_changed") -BulkSuspendRowFailure.suspend_failed = BulkSuspendRowFailure("suspend_failed") - -BulkSuspendRowOutcome._suspended_validator = bv.Void() -BulkSuspendRowOutcome._failed_validator = BulkSuspendRowFailure_validator -BulkSuspendRowOutcome._unknown_validator = bv.Void() -BulkSuspendRowOutcome._other_validator = bv.Void() -BulkSuspendRowOutcome._tagmap = { - "suspended": BulkSuspendRowOutcome._suspended_validator, - "failed": BulkSuspendRowOutcome._failed_validator, - "unknown": BulkSuspendRowOutcome._unknown_validator, - "other": BulkSuspendRowOutcome._other_validator, -} - -BulkSuspendRowOutcome.suspended = BulkSuspendRowOutcome("suspended") -BulkSuspendRowOutcome.unknown = BulkSuspendRowOutcome("unknown") -BulkSuspendRowOutcome.other = BulkSuspendRowOutcome("other") - -BulkSuspendTaskFailure._unusable_result_validator = bv.Void() -BulkSuspendTaskFailure._other_validator = bv.Void() -BulkSuspendTaskFailure._tagmap = { - "unusable_result": BulkSuspendTaskFailure._unusable_result_validator, - "other": BulkSuspendTaskFailure._other_validator, -} - -BulkSuspendTaskFailure.unusable_result = BulkSuspendTaskFailure("unusable_result") -BulkSuspendTaskFailure.other = BulkSuspendTaskFailure("other") - CustomQuotaError._too_many_users_validator = bv.Void() CustomQuotaError._other_validator = bv.Void() CustomQuotaError._tagmap = { @@ -17960,6 +17789,13 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ("profile_photo_url", MemberProfile.profile_photo_url.validator), ] +UserSelectorError._user_not_found_validator = bv.Void() +UserSelectorError._tagmap = { + "user_not_found": UserSelectorError._user_not_found_validator, +} + +UserSelectorError.user_not_found = UserSelectorError("user_not_found") + MemberSelectorError._user_not_in_team_validator = bv.Void() MemberSelectorError._tagmap = { "user_not_in_team": MemberSelectorError._user_not_in_team_validator, @@ -18047,6 +17883,17 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ("wipe_data", MembersDeactivateArg.wipe_data.validator) ] +MembersDeactivateError._user_not_in_team_validator = bv.Void() +MembersDeactivateError._other_validator = bv.Void() +MembersDeactivateError._tagmap = { + "user_not_in_team": MembersDeactivateError._user_not_in_team_validator, + "other": MembersDeactivateError._other_validator, +} +MembersDeactivateError._tagmap.update(UserSelectorError._tagmap) + +MembersDeactivateError.user_not_in_team = MembersDeactivateError("user_not_in_team") +MembersDeactivateError.other = MembersDeactivateError("other") + MembersPermanentlyDeleteFilesError._transfer_in_progress_validator = bv.Void() MembersPermanentlyDeleteFilesError._already_transferred_validator = bv.Void() MembersPermanentlyDeleteFilesError._already_transferred_or_deleted_validator = bv.Void() @@ -18596,6 +18443,175 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): ) MembersSetProfilePhotoError.other = MembersSetProfilePhotoError("other") +MembersSuspendBatchArg.members.validator = bv.List( + MembersSuspendBatchTarget_validator, min_items=1, max_items=500 +) +MembersSuspendBatchArg._all_field_names_ = set(["members"]) +MembersSuspendBatchArg._all_fields_ = [("members", MembersSuspendBatchArg.members.validator)] + +MembersSuspendBatchComplete.requested.validator = bv.Int64() +MembersSuspendBatchComplete.suspended.validator = bv.Int64() +MembersSuspendBatchComplete.failed.validator = bv.Int64() +MembersSuspendBatchComplete.unknown.validator = bv.Int64() +MembersSuspendBatchComplete.report_delivery.validator = ( + MembersSuspendBatchReportDeliveryStatus_validator +) +MembersSuspendBatchComplete._all_field_names_ = set( + [ + "requested", + "suspended", + "failed", + "unknown", + "report_delivery", + ] +) +MembersSuspendBatchComplete._all_fields_ = [ + ("requested", MembersSuspendBatchComplete.requested.validator), + ("suspended", MembersSuspendBatchComplete.suspended.validator), + ("failed", MembersSuspendBatchComplete.failed.validator), + ("unknown", MembersSuspendBatchComplete.unknown.validator), + ("report_delivery", MembersSuspendBatchComplete.report_delivery.validator), +] + +MembersSuspendBatchError._too_many_members_validator = bv.Void() +MembersSuspendBatchError._duplicate_client_item_id_validator = bv.Void() +MembersSuspendBatchError._duplicate_team_member_id_validator = bv.Void() +MembersSuspendBatchError._acting_admin_validator = bv.Void() +MembersSuspendBatchError._last_admin_validator = bv.Void() +MembersSuspendBatchError._other_validator = bv.Void() +MembersSuspendBatchError._tagmap = { + "too_many_members": MembersSuspendBatchError._too_many_members_validator, + "duplicate_client_item_id": MembersSuspendBatchError._duplicate_client_item_id_validator, + "duplicate_team_member_id": MembersSuspendBatchError._duplicate_team_member_id_validator, + "acting_admin": MembersSuspendBatchError._acting_admin_validator, + "last_admin": MembersSuspendBatchError._last_admin_validator, + "other": MembersSuspendBatchError._other_validator, +} + +MembersSuspendBatchError.too_many_members = MembersSuspendBatchError("too_many_members") +MembersSuspendBatchError.duplicate_client_item_id = MembersSuspendBatchError( + "duplicate_client_item_id" +) +MembersSuspendBatchError.duplicate_team_member_id = MembersSuspendBatchError( + "duplicate_team_member_id" +) +MembersSuspendBatchError.acting_admin = MembersSuspendBatchError("acting_admin") +MembersSuspendBatchError.last_admin = MembersSuspendBatchError("last_admin") +MembersSuspendBatchError.other = MembersSuspendBatchError("other") + +MembersSuspendBatchJobStatus._complete_validator = MembersSuspendBatchComplete_validator +MembersSuspendBatchJobStatus._failed_validator = MembersSuspendBatchTaskFailure_validator +MembersSuspendBatchJobStatus._other_validator = bv.Void() +MembersSuspendBatchJobStatus._tagmap = { + "complete": MembersSuspendBatchJobStatus._complete_validator, + "failed": MembersSuspendBatchJobStatus._failed_validator, + "other": MembersSuspendBatchJobStatus._other_validator, +} +MembersSuspendBatchJobStatus._tagmap.update(async_.PollResultBase._tagmap) + +MembersSuspendBatchJobStatus.other = MembersSuspendBatchJobStatus("other") + +MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_unspecified_validator = bv.Void() +MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_pending_validator = bv.Void() +MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_delivered_validator = bv.Void() +MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_failed_validator = bv.Void() +MembersSuspendBatchReportDeliveryStatus._other_validator = bv.Void() +MembersSuspendBatchReportDeliveryStatus._tagmap = { + "members_suspend_batch_report_delivery_status_unspecified": MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_unspecified_validator, + "members_suspend_batch_report_delivery_status_pending": MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_pending_validator, + "members_suspend_batch_report_delivery_status_delivered": MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_delivered_validator, + "members_suspend_batch_report_delivery_status_failed": MembersSuspendBatchReportDeliveryStatus._members_suspend_batch_report_delivery_status_failed_validator, + "other": MembersSuspendBatchReportDeliveryStatus._other_validator, +} + +MembersSuspendBatchReportDeliveryStatus.members_suspend_batch_report_delivery_status_unspecified = ( + MembersSuspendBatchReportDeliveryStatus( + "members_suspend_batch_report_delivery_status_unspecified" + ) +) +MembersSuspendBatchReportDeliveryStatus.members_suspend_batch_report_delivery_status_pending = ( + MembersSuspendBatchReportDeliveryStatus("members_suspend_batch_report_delivery_status_pending") +) +MembersSuspendBatchReportDeliveryStatus.members_suspend_batch_report_delivery_status_delivered = ( + MembersSuspendBatchReportDeliveryStatus( + "members_suspend_batch_report_delivery_status_delivered" + ) +) +MembersSuspendBatchReportDeliveryStatus.members_suspend_batch_report_delivery_status_failed = ( + MembersSuspendBatchReportDeliveryStatus("members_suspend_batch_report_delivery_status_failed") +) +MembersSuspendBatchReportDeliveryStatus.other = MembersSuspendBatchReportDeliveryStatus("other") + +MembersSuspendError._suspend_inactive_user_validator = bv.Void() +MembersSuspendError._suspend_last_admin_validator = bv.Void() +MembersSuspendError._team_license_limit_validator = bv.Void() +MembersSuspendError._tagmap = { + "suspend_inactive_user": MembersSuspendError._suspend_inactive_user_validator, + "suspend_last_admin": MembersSuspendError._suspend_last_admin_validator, + "team_license_limit": MembersSuspendError._team_license_limit_validator, +} +MembersSuspendError._tagmap.update(MembersDeactivateError._tagmap) + +MembersSuspendError.suspend_inactive_user = MembersSuspendError("suspend_inactive_user") +MembersSuspendError.suspend_last_admin = MembersSuspendError("suspend_last_admin") +MembersSuspendError.team_license_limit = MembersSuspendError("team_license_limit") + +MembersSuspendBatchRowFailure._protected_acting_admin_validator = bv.Void() +MembersSuspendBatchRowFailure._permission_changed_validator = bv.Void() +MembersSuspendBatchRowFailure._suspend_failed_validator = bv.Void() +MembersSuspendBatchRowFailure._tagmap = { + "protected_acting_admin": MembersSuspendBatchRowFailure._protected_acting_admin_validator, + "permission_changed": MembersSuspendBatchRowFailure._permission_changed_validator, + "suspend_failed": MembersSuspendBatchRowFailure._suspend_failed_validator, +} +MembersSuspendBatchRowFailure._tagmap.update(MembersSuspendError._tagmap) + +MembersSuspendBatchRowFailure.protected_acting_admin = MembersSuspendBatchRowFailure( + "protected_acting_admin" +) +MembersSuspendBatchRowFailure.permission_changed = MembersSuspendBatchRowFailure( + "permission_changed" +) +MembersSuspendBatchRowFailure.suspend_failed = MembersSuspendBatchRowFailure("suspend_failed") + +MembersSuspendBatchRowOutcome._suspended_validator = bv.Void() +MembersSuspendBatchRowOutcome._failed_validator = MembersSuspendBatchRowFailure_validator +MembersSuspendBatchRowOutcome._unknown_validator = bv.Void() +MembersSuspendBatchRowOutcome._other_validator = bv.Void() +MembersSuspendBatchRowOutcome._tagmap = { + "suspended": MembersSuspendBatchRowOutcome._suspended_validator, + "failed": MembersSuspendBatchRowOutcome._failed_validator, + "unknown": MembersSuspendBatchRowOutcome._unknown_validator, + "other": MembersSuspendBatchRowOutcome._other_validator, +} + +MembersSuspendBatchRowOutcome.suspended = MembersSuspendBatchRowOutcome("suspended") +MembersSuspendBatchRowOutcome.unknown = MembersSuspendBatchRowOutcome("unknown") +MembersSuspendBatchRowOutcome.other = MembersSuspendBatchRowOutcome("other") + +MembersSuspendBatchTarget.client_item_id.validator = bv.String(min_length=1, max_length=128) +MembersSuspendBatchTarget.suspend_arg.validator = MembersDeactivateArg_validator +MembersSuspendBatchTarget._all_field_names_ = set( + [ + "client_item_id", + "suspend_arg", + ] +) +MembersSuspendBatchTarget._all_fields_ = [ + ("client_item_id", MembersSuspendBatchTarget.client_item_id.validator), + ("suspend_arg", MembersSuspendBatchTarget.suspend_arg.validator), +] + +MembersSuspendBatchTaskFailure._unusable_result_validator = bv.Void() +MembersSuspendBatchTaskFailure._other_validator = bv.Void() +MembersSuspendBatchTaskFailure._tagmap = { + "unusable_result": MembersSuspendBatchTaskFailure._unusable_result_validator, + "other": MembersSuspendBatchTaskFailure._other_validator, +} + +MembersSuspendBatchTaskFailure.unusable_result = MembersSuspendBatchTaskFailure("unusable_result") +MembersSuspendBatchTaskFailure.other = MembersSuspendBatchTaskFailure("other") + MembersTransferFormerMembersFilesError._user_data_is_being_transferred_validator = bv.Void() MembersTransferFormerMembersFilesError._user_not_removed_validator = bv.Void() MembersTransferFormerMembersFilesError._user_data_cannot_be_transferred_validator = bv.Void() @@ -20094,18 +20110,18 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): members_bulk_suspend = bb.Route( "members/bulk_suspend", 1, - False, - BulkSuspendArg_validator, + True, + MembersSuspendBatchArg_validator, async_.LaunchResultBase_validator, - BulkSuspendError_validator, + MembersSuspendBatchError_validator, {"auth": "team", "host": "api", "style": "rpc"}, ) members_bulk_suspend_job_status_check = bb.Route( "members/bulk_suspend/job_status/check", 1, - False, + True, async_.PollArg_validator, - BulkSuspendJobStatus_validator, + MembersSuspendBatchJobStatus_validator, async_.PollError_validator, {"auth": "team", "host": "api", "style": "rpc"}, ) @@ -20343,6 +20359,24 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): MembersSuspendError_validator, {"auth": "team", "host": "api", "style": "rpc"}, ) +members_suspend_batch = bb.Route( + "members/suspend_batch", + 1, + False, + MembersSuspendBatchArg_validator, + async_.LaunchResultBase_validator, + MembersSuspendBatchError_validator, + {"auth": "team", "host": "api", "style": "rpc"}, +) +members_suspend_batch_job_status_check = bb.Route( + "members/suspend_batch/job_status/check", + 1, + False, + async_.PollArg_validator, + MembersSuspendBatchJobStatus_validator, + async_.PollError_validator, + {"auth": "team", "host": "api", "style": "rpc"}, +) members_unsuspend = bb.Route( "members/unsuspend", 1, @@ -20640,6 +20674,8 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): "members/set_profile_photo": members_set_profile_photo, "members/set_profile_photo:2": members_set_profile_photo_v2, "members/suspend": members_suspend, + "members/suspend_batch": members_suspend_batch, + "members/suspend_batch/job_status/check": members_suspend_batch_job_status_check, "members/unsuspend": members_unsuspend, "namespaces/list": namespaces_list, "namespaces/list/continue": namespaces_list_continue, diff --git a/spec b/spec index 3f06f3f..248109f 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit 3f06f3f85201cd17cfe67701525ca1bd2dade8b2 +Subproject commit 248109f2fb632e0f545e13ed1852d2b39f5c45ad