com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-photos-library-client Show documentation
Show all versions of google-photos-library-client Show documentation
Google Photos Library API Client Library for Java
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/photos/library/v1/photos_library.proto
package com.google.photos.library.v1.proto;
/**
*
*
*
* Request to create one or more media items in a user's Google Photos library.
* If an `albumid` is specified, the media items are also added to that album.
* `albumPosition` is optional and can only be specified if an `albumId` is set.
*
*
* Protobuf type {@code google.photos.library.v1.BatchCreateMediaItemsRequest}
*/
public final class BatchCreateMediaItemsRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.photos.library.v1.BatchCreateMediaItemsRequest)
BatchCreateMediaItemsRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use BatchCreateMediaItemsRequest.newBuilder() to construct.
private BatchCreateMediaItemsRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private BatchCreateMediaItemsRequest() {
albumId_ = "";
newMediaItems_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new BatchCreateMediaItemsRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.photos.library.v1.proto.LibraryServiceProto
.internal_static_google_photos_library_v1_BatchCreateMediaItemsRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.photos.library.v1.proto.LibraryServiceProto
.internal_static_google_photos_library_v1_BatchCreateMediaItemsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.class,
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.Builder.class);
}
public static final int ALBUM_ID_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object albumId_ = "";
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @return The albumId.
*/
@java.lang.Override
public java.lang.String getAlbumId() {
java.lang.Object ref = albumId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
albumId_ = s;
return s;
}
}
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @return The bytes for albumId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getAlbumIdBytes() {
java.lang.Object ref = albumId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
albumId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NEW_MEDIA_ITEMS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List newMediaItems_;
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public java.util.List getNewMediaItemsList() {
return newMediaItems_;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public java.util.List extends com.google.photos.library.v1.proto.NewMediaItemOrBuilder>
getNewMediaItemsOrBuilderList() {
return newMediaItems_;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public int getNewMediaItemsCount() {
return newMediaItems_.size();
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.photos.library.v1.proto.NewMediaItem getNewMediaItems(int index) {
return newMediaItems_.get(index);
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.photos.library.v1.proto.NewMediaItemOrBuilder getNewMediaItemsOrBuilder(
int index) {
return newMediaItems_.get(index);
}
public static final int ALBUM_POSITION_FIELD_NUMBER = 4;
private com.google.photos.library.v1.proto.AlbumPosition albumPosition_;
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*
* @return Whether the albumPosition field is set.
*/
@java.lang.Override
public boolean hasAlbumPosition() {
return albumPosition_ != null;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*
* @return The albumPosition.
*/
@java.lang.Override
public com.google.photos.library.v1.proto.AlbumPosition getAlbumPosition() {
return albumPosition_ == null
? com.google.photos.library.v1.proto.AlbumPosition.getDefaultInstance()
: albumPosition_;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
@java.lang.Override
public com.google.photos.library.v1.proto.AlbumPositionOrBuilder getAlbumPositionOrBuilder() {
return albumPosition_ == null
? com.google.photos.library.v1.proto.AlbumPosition.getDefaultInstance()
: albumPosition_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(albumId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, albumId_);
}
for (int i = 0; i < newMediaItems_.size(); i++) {
output.writeMessage(2, newMediaItems_.get(i));
}
if (albumPosition_ != null) {
output.writeMessage(4, getAlbumPosition());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(albumId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, albumId_);
}
for (int i = 0; i < newMediaItems_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, newMediaItems_.get(i));
}
if (albumPosition_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAlbumPosition());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest)) {
return super.equals(obj);
}
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest other =
(com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest) obj;
if (!getAlbumId().equals(other.getAlbumId())) return false;
if (!getNewMediaItemsList().equals(other.getNewMediaItemsList())) return false;
if (hasAlbumPosition() != other.hasAlbumPosition()) return false;
if (hasAlbumPosition()) {
if (!getAlbumPosition().equals(other.getAlbumPosition())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ALBUM_ID_FIELD_NUMBER;
hash = (53 * hash) + getAlbumId().hashCode();
if (getNewMediaItemsCount() > 0) {
hash = (37 * hash) + NEW_MEDIA_ITEMS_FIELD_NUMBER;
hash = (53 * hash) + getNewMediaItemsList().hashCode();
}
if (hasAlbumPosition()) {
hash = (37 * hash) + ALBUM_POSITION_FIELD_NUMBER;
hash = (53 * hash) + getAlbumPosition().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Request to create one or more media items in a user's Google Photos library.
* If an `albumid` is specified, the media items are also added to that album.
* `albumPosition` is optional and can only be specified if an `albumId` is set.
*
*
* Protobuf type {@code google.photos.library.v1.BatchCreateMediaItemsRequest}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.photos.library.v1.BatchCreateMediaItemsRequest)
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.photos.library.v1.proto.LibraryServiceProto
.internal_static_google_photos_library_v1_BatchCreateMediaItemsRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.photos.library.v1.proto.LibraryServiceProto
.internal_static_google_photos_library_v1_BatchCreateMediaItemsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.class,
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.Builder.class);
}
// Construct using com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
albumId_ = "";
if (newMediaItemsBuilder_ == null) {
newMediaItems_ = java.util.Collections.emptyList();
} else {
newMediaItems_ = null;
newMediaItemsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
albumPosition_ = null;
if (albumPositionBuilder_ != null) {
albumPositionBuilder_.dispose();
albumPositionBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.photos.library.v1.proto.LibraryServiceProto
.internal_static_google_photos_library_v1_BatchCreateMediaItemsRequest_descriptor;
}
@java.lang.Override
public com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest
getDefaultInstanceForType() {
return com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest build() {
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest buildPartial() {
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest result =
new com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest result) {
if (newMediaItemsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
newMediaItems_ = java.util.Collections.unmodifiableList(newMediaItems_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.newMediaItems_ = newMediaItems_;
} else {
result.newMediaItems_ = newMediaItemsBuilder_.build();
}
}
private void buildPartial0(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.albumId_ = albumId_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.albumPosition_ =
albumPositionBuilder_ == null ? albumPosition_ : albumPositionBuilder_.build();
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest) {
return mergeFrom((com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest other) {
if (other
== com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest.getDefaultInstance())
return this;
if (!other.getAlbumId().isEmpty()) {
albumId_ = other.albumId_;
bitField0_ |= 0x00000001;
onChanged();
}
if (newMediaItemsBuilder_ == null) {
if (!other.newMediaItems_.isEmpty()) {
if (newMediaItems_.isEmpty()) {
newMediaItems_ = other.newMediaItems_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureNewMediaItemsIsMutable();
newMediaItems_.addAll(other.newMediaItems_);
}
onChanged();
}
} else {
if (!other.newMediaItems_.isEmpty()) {
if (newMediaItemsBuilder_.isEmpty()) {
newMediaItemsBuilder_.dispose();
newMediaItemsBuilder_ = null;
newMediaItems_ = other.newMediaItems_;
bitField0_ = (bitField0_ & ~0x00000002);
newMediaItemsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getNewMediaItemsFieldBuilder()
: null;
} else {
newMediaItemsBuilder_.addAllMessages(other.newMediaItems_);
}
}
}
if (other.hasAlbumPosition()) {
mergeAlbumPosition(other.getAlbumPosition());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
albumId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
com.google.photos.library.v1.proto.NewMediaItem m =
input.readMessage(
com.google.photos.library.v1.proto.NewMediaItem.parser(),
extensionRegistry);
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
newMediaItems_.add(m);
} else {
newMediaItemsBuilder_.addMessage(m);
}
break;
} // case 18
case 34:
{
input.readMessage(getAlbumPositionFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 34
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object albumId_ = "";
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @return The albumId.
*/
public java.lang.String getAlbumId() {
java.lang.Object ref = albumId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
albumId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @return The bytes for albumId.
*/
public com.google.protobuf.ByteString getAlbumIdBytes() {
java.lang.Object ref = albumId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
albumId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @param value The albumId to set.
* @return This builder for chaining.
*/
public Builder setAlbumId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
albumId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @return This builder for chaining.
*/
public Builder clearAlbumId() {
albumId_ = getDefaultInstance().getAlbumId();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Identifier of the album where the media items are added. The media items
* are also added to the user's library. This is an optional field.
*
*
* string album_id = 1;
*
* @param value The bytes for albumId to set.
* @return This builder for chaining.
*/
public Builder setAlbumIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
albumId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.util.List newMediaItems_ =
java.util.Collections.emptyList();
private void ensureNewMediaItemsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
newMediaItems_ =
new java.util.ArrayList(
newMediaItems_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.photos.library.v1.proto.NewMediaItem,
com.google.photos.library.v1.proto.NewMediaItem.Builder,
com.google.photos.library.v1.proto.NewMediaItemOrBuilder>
newMediaItemsBuilder_;
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List getNewMediaItemsList() {
if (newMediaItemsBuilder_ == null) {
return java.util.Collections.unmodifiableList(newMediaItems_);
} else {
return newMediaItemsBuilder_.getMessageList();
}
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public int getNewMediaItemsCount() {
if (newMediaItemsBuilder_ == null) {
return newMediaItems_.size();
} else {
return newMediaItemsBuilder_.getCount();
}
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.photos.library.v1.proto.NewMediaItem getNewMediaItems(int index) {
if (newMediaItemsBuilder_ == null) {
return newMediaItems_.get(index);
} else {
return newMediaItemsBuilder_.getMessage(index);
}
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setNewMediaItems(
int index, com.google.photos.library.v1.proto.NewMediaItem value) {
if (newMediaItemsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureNewMediaItemsIsMutable();
newMediaItems_.set(index, value);
onChanged();
} else {
newMediaItemsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setNewMediaItems(
int index, com.google.photos.library.v1.proto.NewMediaItem.Builder builderForValue) {
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
newMediaItems_.set(index, builderForValue.build());
onChanged();
} else {
newMediaItemsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addNewMediaItems(com.google.photos.library.v1.proto.NewMediaItem value) {
if (newMediaItemsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureNewMediaItemsIsMutable();
newMediaItems_.add(value);
onChanged();
} else {
newMediaItemsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addNewMediaItems(
int index, com.google.photos.library.v1.proto.NewMediaItem value) {
if (newMediaItemsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureNewMediaItemsIsMutable();
newMediaItems_.add(index, value);
onChanged();
} else {
newMediaItemsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addNewMediaItems(
com.google.photos.library.v1.proto.NewMediaItem.Builder builderForValue) {
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
newMediaItems_.add(builderForValue.build());
onChanged();
} else {
newMediaItemsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addNewMediaItems(
int index, com.google.photos.library.v1.proto.NewMediaItem.Builder builderForValue) {
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
newMediaItems_.add(index, builderForValue.build());
onChanged();
} else {
newMediaItemsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addAllNewMediaItems(
java.lang.Iterable extends com.google.photos.library.v1.proto.NewMediaItem> values) {
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, newMediaItems_);
onChanged();
} else {
newMediaItemsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder clearNewMediaItems() {
if (newMediaItemsBuilder_ == null) {
newMediaItems_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
newMediaItemsBuilder_.clear();
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder removeNewMediaItems(int index) {
if (newMediaItemsBuilder_ == null) {
ensureNewMediaItemsIsMutable();
newMediaItems_.remove(index);
onChanged();
} else {
newMediaItemsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.photos.library.v1.proto.NewMediaItem.Builder getNewMediaItemsBuilder(
int index) {
return getNewMediaItemsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.photos.library.v1.proto.NewMediaItemOrBuilder getNewMediaItemsOrBuilder(
int index) {
if (newMediaItemsBuilder_ == null) {
return newMediaItems_.get(index);
} else {
return newMediaItemsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List extends com.google.photos.library.v1.proto.NewMediaItemOrBuilder>
getNewMediaItemsOrBuilderList() {
if (newMediaItemsBuilder_ != null) {
return newMediaItemsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(newMediaItems_);
}
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.photos.library.v1.proto.NewMediaItem.Builder addNewMediaItemsBuilder() {
return getNewMediaItemsFieldBuilder()
.addBuilder(com.google.photos.library.v1.proto.NewMediaItem.getDefaultInstance());
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.photos.library.v1.proto.NewMediaItem.Builder addNewMediaItemsBuilder(
int index) {
return getNewMediaItemsFieldBuilder()
.addBuilder(index, com.google.photos.library.v1.proto.NewMediaItem.getDefaultInstance());
}
/**
*
*
*
* Required. List of media items to be created. Maximum 50 media items per
* call.
*
*
*
* repeated .google.photos.library.v1.NewMediaItem new_media_items = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List
getNewMediaItemsBuilderList() {
return getNewMediaItemsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.photos.library.v1.proto.NewMediaItem,
com.google.photos.library.v1.proto.NewMediaItem.Builder,
com.google.photos.library.v1.proto.NewMediaItemOrBuilder>
getNewMediaItemsFieldBuilder() {
if (newMediaItemsBuilder_ == null) {
newMediaItemsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.photos.library.v1.proto.NewMediaItem,
com.google.photos.library.v1.proto.NewMediaItem.Builder,
com.google.photos.library.v1.proto.NewMediaItemOrBuilder>(
newMediaItems_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
newMediaItems_ = null;
}
return newMediaItemsBuilder_;
}
private com.google.photos.library.v1.proto.AlbumPosition albumPosition_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.photos.library.v1.proto.AlbumPosition,
com.google.photos.library.v1.proto.AlbumPosition.Builder,
com.google.photos.library.v1.proto.AlbumPositionOrBuilder>
albumPositionBuilder_;
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*
* @return Whether the albumPosition field is set.
*/
public boolean hasAlbumPosition() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*
* @return The albumPosition.
*/
public com.google.photos.library.v1.proto.AlbumPosition getAlbumPosition() {
if (albumPositionBuilder_ == null) {
return albumPosition_ == null
? com.google.photos.library.v1.proto.AlbumPosition.getDefaultInstance()
: albumPosition_;
} else {
return albumPositionBuilder_.getMessage();
}
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public Builder setAlbumPosition(com.google.photos.library.v1.proto.AlbumPosition value) {
if (albumPositionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
albumPosition_ = value;
} else {
albumPositionBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public Builder setAlbumPosition(
com.google.photos.library.v1.proto.AlbumPosition.Builder builderForValue) {
if (albumPositionBuilder_ == null) {
albumPosition_ = builderForValue.build();
} else {
albumPositionBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public Builder mergeAlbumPosition(com.google.photos.library.v1.proto.AlbumPosition value) {
if (albumPositionBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)
&& albumPosition_ != null
&& albumPosition_
!= com.google.photos.library.v1.proto.AlbumPosition.getDefaultInstance()) {
getAlbumPositionBuilder().mergeFrom(value);
} else {
albumPosition_ = value;
}
} else {
albumPositionBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public Builder clearAlbumPosition() {
bitField0_ = (bitField0_ & ~0x00000004);
albumPosition_ = null;
if (albumPositionBuilder_ != null) {
albumPositionBuilder_.dispose();
albumPositionBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public com.google.photos.library.v1.proto.AlbumPosition.Builder getAlbumPositionBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getAlbumPositionFieldBuilder().getBuilder();
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
public com.google.photos.library.v1.proto.AlbumPositionOrBuilder getAlbumPositionOrBuilder() {
if (albumPositionBuilder_ != null) {
return albumPositionBuilder_.getMessageOrBuilder();
} else {
return albumPosition_ == null
? com.google.photos.library.v1.proto.AlbumPosition.getDefaultInstance()
: albumPosition_;
}
}
/**
*
*
*
* Position in the album where the media items are added. If not
* specified, the media items are added to the end of the album (as per
* the default value, that is, `LAST_IN_ALBUM`). The request fails if this
* field is set and the `albumId` is not specified. The request will also fail
* if you set the field and are not the owner of the shared album.
*
*
* .google.photos.library.v1.AlbumPosition album_position = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.photos.library.v1.proto.AlbumPosition,
com.google.photos.library.v1.proto.AlbumPosition.Builder,
com.google.photos.library.v1.proto.AlbumPositionOrBuilder>
getAlbumPositionFieldBuilder() {
if (albumPositionBuilder_ == null) {
albumPositionBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.photos.library.v1.proto.AlbumPosition,
com.google.photos.library.v1.proto.AlbumPosition.Builder,
com.google.photos.library.v1.proto.AlbumPositionOrBuilder>(
getAlbumPosition(), getParentForChildren(), isClean());
albumPosition_ = null;
}
return albumPositionBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.photos.library.v1.BatchCreateMediaItemsRequest)
}
// @@protoc_insertion_point(class_scope:google.photos.library.v1.BatchCreateMediaItemsRequest)
private static final com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest();
}
public static com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public BatchCreateMediaItemsRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}