Class SearchMediaItemsRequest.Builder

  • All Implemented Interfaces:
    SearchMediaItemsRequestOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    SearchMediaItemsRequest

    public static final class SearchMediaItemsRequest.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
    implements SearchMediaItemsRequestOrBuilder
     Request to search for media items in a user's library.
     If the album id is specified, this call will return the list of media items
     in the album. If neither filters nor album id are
     specified, this call will return all media items in a user's Google Photos
     library.
     If filters are specified, this call will return all media items in
     the user's library that fulfill the filter criteria.
     Filters and album id must not both be set, as this will result in an
     invalid request.
     
    Protobuf type google.photos.library.v1.SearchMediaItemsRequest
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • clear

        public SearchMediaItemsRequest.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • getDefaultInstanceForType

        public SearchMediaItemsRequest getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public SearchMediaItemsRequest build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public SearchMediaItemsRequest buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public SearchMediaItemsRequest.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • setField

        public SearchMediaItemsRequest.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • clearField

        public SearchMediaItemsRequest.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • clearOneof

        public SearchMediaItemsRequest.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • setRepeatedField

        public SearchMediaItemsRequest.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                int index,
                                                                java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • addRepeatedField

        public SearchMediaItemsRequest.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • mergeFrom

        public SearchMediaItemsRequest.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                  throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SearchMediaItemsRequest.Builder>
        Throws:
        java.io.IOException
      • getAlbumId

        public java.lang.String getAlbumId()
         Identifier of an album. If populated, lists all media items in
         specified album. Can't set in conjunction with any filters.
         
        string album_id = 1;
        Specified by:
        getAlbumId in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The albumId.
      • getAlbumIdBytes

        public com.google.protobuf.ByteString getAlbumIdBytes()
         Identifier of an album. If populated, lists all media items in
         specified album. Can't set in conjunction with any filters.
         
        string album_id = 1;
        Specified by:
        getAlbumIdBytes in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The bytes for albumId.
      • setAlbumId

        public SearchMediaItemsRequest.Builder setAlbumId​(java.lang.String value)
         Identifier of an album. If populated, lists all media items in
         specified album. Can't set in conjunction with any filters.
         
        string album_id = 1;
        Parameters:
        value - The albumId to set.
        Returns:
        This builder for chaining.
      • clearAlbumId

        public SearchMediaItemsRequest.Builder clearAlbumId()
         Identifier of an album. If populated, lists all media items in
         specified album. Can't set in conjunction with any filters.
         
        string album_id = 1;
        Returns:
        This builder for chaining.
      • setAlbumIdBytes

        public SearchMediaItemsRequest.Builder setAlbumIdBytes​(com.google.protobuf.ByteString value)
         Identifier of an album. If populated, lists all media items in
         specified album. Can't set in conjunction with any filters.
         
        string album_id = 1;
        Parameters:
        value - The bytes for albumId to set.
        Returns:
        This builder for chaining.
      • getPageSize

        public int getPageSize()
         Maximum number of media items to return in the response. Fewer media items
         might be returned than the specified number. The default `pageSize` is 25,
         the maximum is 100.
         
        int32 page_size = 2;
        Specified by:
        getPageSize in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The pageSize.
      • setPageSize

        public SearchMediaItemsRequest.Builder setPageSize​(int value)
         Maximum number of media items to return in the response. Fewer media items
         might be returned than the specified number. The default `pageSize` is 25,
         the maximum is 100.
         
        int32 page_size = 2;
        Parameters:
        value - The pageSize to set.
        Returns:
        This builder for chaining.
      • clearPageSize

        public SearchMediaItemsRequest.Builder clearPageSize()
         Maximum number of media items to return in the response. Fewer media items
         might be returned than the specified number. The default `pageSize` is 25,
         the maximum is 100.
         
        int32 page_size = 2;
        Returns:
        This builder for chaining.
      • getPageToken

        public java.lang.String getPageToken()
         A continuation token to get the next page of the results. Adding this to
         the request returns the rows after the `pageToken`. The `pageToken` should
         be the value returned in the `nextPageToken` parameter in the response to
         the `searchMediaItems` request.
         
        string page_token = 3;
        Specified by:
        getPageToken in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The pageToken.
      • getPageTokenBytes

        public com.google.protobuf.ByteString getPageTokenBytes()
         A continuation token to get the next page of the results. Adding this to
         the request returns the rows after the `pageToken`. The `pageToken` should
         be the value returned in the `nextPageToken` parameter in the response to
         the `searchMediaItems` request.
         
        string page_token = 3;
        Specified by:
        getPageTokenBytes in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The bytes for pageToken.
      • setPageToken

        public SearchMediaItemsRequest.Builder setPageToken​(java.lang.String value)
         A continuation token to get the next page of the results. Adding this to
         the request returns the rows after the `pageToken`. The `pageToken` should
         be the value returned in the `nextPageToken` parameter in the response to
         the `searchMediaItems` request.
         
        string page_token = 3;
        Parameters:
        value - The pageToken to set.
        Returns:
        This builder for chaining.
      • clearPageToken

        public SearchMediaItemsRequest.Builder clearPageToken()
         A continuation token to get the next page of the results. Adding this to
         the request returns the rows after the `pageToken`. The `pageToken` should
         be the value returned in the `nextPageToken` parameter in the response to
         the `searchMediaItems` request.
         
        string page_token = 3;
        Returns:
        This builder for chaining.
      • setPageTokenBytes

        public SearchMediaItemsRequest.Builder setPageTokenBytes​(com.google.protobuf.ByteString value)
         A continuation token to get the next page of the results. Adding this to
         the request returns the rows after the `pageToken`. The `pageToken` should
         be the value returned in the `nextPageToken` parameter in the response to
         the `searchMediaItems` request.
         
        string page_token = 3;
        Parameters:
        value - The bytes for pageToken to set.
        Returns:
        This builder for chaining.
      • hasFilters

        public boolean hasFilters()
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
        Specified by:
        hasFilters in interface SearchMediaItemsRequestOrBuilder
        Returns:
        Whether the filters field is set.
      • getFilters

        public Filters getFilters()
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
        Specified by:
        getFilters in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The filters.
      • setFilters

        public SearchMediaItemsRequest.Builder setFilters​(Filters value)
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
      • mergeFilters

        public SearchMediaItemsRequest.Builder mergeFilters​(Filters value)
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
      • clearFilters

        public SearchMediaItemsRequest.Builder clearFilters()
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
      • getFiltersBuilder

        public Filters.Builder getFiltersBuilder()
         Filters to apply to the request. Can't be set in conjunction with an
         `albumId`.
         
        .google.photos.library.v1.Filters filters = 4;
      • getOrderBy

        public java.lang.String getOrderBy()
         An optional field to specify the sort order of the search results. The
         `orderBy` field only works when a
         [dateFilter][google.photos.library.v1.DateFilter] is used. When this
         field is not specified, results are displayed newest first, oldest last by
         their [creationTime][google.photos.types.MediaMetadata.creation_time].
         Providing `MediaMetadata.creation_time` displays search results in
         the opposite order, oldest first then newest last.
         To display results newest first then oldest last, include the `desc`
         argument as follows: `MediaMetadata.creation_time desc`.
         The only additional filters that can be used with this parameter are
         [includeArchivedMedia][google.photos.library.v1.Filters.include_archived_media]
         and
         [excludeNonAppCreatedData][google.photos.library.v1.Filters.exclude_non_app_created_data].
         No other filters are supported.
         
        string order_by = 5;
        Specified by:
        getOrderBy in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The orderBy.
      • getOrderByBytes

        public com.google.protobuf.ByteString getOrderByBytes()
         An optional field to specify the sort order of the search results. The
         `orderBy` field only works when a
         [dateFilter][google.photos.library.v1.DateFilter] is used. When this
         field is not specified, results are displayed newest first, oldest last by
         their [creationTime][google.photos.types.MediaMetadata.creation_time].
         Providing `MediaMetadata.creation_time` displays search results in
         the opposite order, oldest first then newest last.
         To display results newest first then oldest last, include the `desc`
         argument as follows: `MediaMetadata.creation_time desc`.
         The only additional filters that can be used with this parameter are
         [includeArchivedMedia][google.photos.library.v1.Filters.include_archived_media]
         and
         [excludeNonAppCreatedData][google.photos.library.v1.Filters.exclude_non_app_created_data].
         No other filters are supported.
         
        string order_by = 5;
        Specified by:
        getOrderByBytes in interface SearchMediaItemsRequestOrBuilder
        Returns:
        The bytes for orderBy.
      • setOrderBy

        public SearchMediaItemsRequest.Builder setOrderBy​(java.lang.String value)
         An optional field to specify the sort order of the search results. The
         `orderBy` field only works when a
         [dateFilter][google.photos.library.v1.DateFilter] is used. When this
         field is not specified, results are displayed newest first, oldest last by
         their [creationTime][google.photos.types.MediaMetadata.creation_time].
         Providing `MediaMetadata.creation_time` displays search results in
         the opposite order, oldest first then newest last.
         To display results newest first then oldest last, include the `desc`
         argument as follows: `MediaMetadata.creation_time desc`.
         The only additional filters that can be used with this parameter are
         [includeArchivedMedia][google.photos.library.v1.Filters.include_archived_media]
         and
         [excludeNonAppCreatedData][google.photos.library.v1.Filters.exclude_non_app_created_data].
         No other filters are supported.
         
        string order_by = 5;
        Parameters:
        value - The orderBy to set.
        Returns:
        This builder for chaining.
      • clearOrderBy

        public SearchMediaItemsRequest.Builder clearOrderBy()
         An optional field to specify the sort order of the search results. The
         `orderBy` field only works when a
         [dateFilter][google.photos.library.v1.DateFilter] is used. When this
         field is not specified, results are displayed newest first, oldest last by
         their [creationTime][google.photos.types.MediaMetadata.creation_time].
         Providing `MediaMetadata.creation_time` displays search results in
         the opposite order, oldest first then newest last.
         To display results newest first then oldest last, include the `desc`
         argument as follows: `MediaMetadata.creation_time desc`.
         The only additional filters that can be used with this parameter are
         [includeArchivedMedia][google.photos.library.v1.Filters.include_archived_media]
         and
         [excludeNonAppCreatedData][google.photos.library.v1.Filters.exclude_non_app_created_data].
         No other filters are supported.
         
        string order_by = 5;
        Returns:
        This builder for chaining.
      • setOrderByBytes

        public SearchMediaItemsRequest.Builder setOrderByBytes​(com.google.protobuf.ByteString value)
         An optional field to specify the sort order of the search results. The
         `orderBy` field only works when a
         [dateFilter][google.photos.library.v1.DateFilter] is used. When this
         field is not specified, results are displayed newest first, oldest last by
         their [creationTime][google.photos.types.MediaMetadata.creation_time].
         Providing `MediaMetadata.creation_time` displays search results in
         the opposite order, oldest first then newest last.
         To display results newest first then oldest last, include the `desc`
         argument as follows: `MediaMetadata.creation_time desc`.
         The only additional filters that can be used with this parameter are
         [includeArchivedMedia][google.photos.library.v1.Filters.include_archived_media]
         and
         [excludeNonAppCreatedData][google.photos.library.v1.Filters.exclude_non_app_created_data].
         No other filters are supported.
         
        string order_by = 5;
        Parameters:
        value - The bytes for orderBy to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final SearchMediaItemsRequest.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>
      • mergeUnknownFields

        public final SearchMediaItemsRequest.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SearchMediaItemsRequest.Builder>