com.clarifai.grpc.api.Key Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/clarifai/api/resources.proto
package com.clarifai.grpc.api;
/**
*
* Key
*
*
* Protobuf type {@code clarifai.api.Key}
*/
public final class Key extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.Key)
KeyOrBuilder {
private static final long serialVersionUID = 0L;
// Use Key.newBuilder() to construct.
private Key(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Key() {
id_ = "";
type_ = "";
description_ = "";
scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY;
apps_ = java.util.Collections.emptyList();
authorizedIdpIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Key();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Key(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
description_ = s;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
scopes_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
scopes_.add(s);
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
apps_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
apps_.add(
input.readMessage(com.clarifai.grpc.api.App.parser(), extensionRegistry));
break;
}
case 42: {
com.google.protobuf.Timestamp.Builder subBuilder = null;
if (createdAt_ != null) {
subBuilder = createdAt_.toBuilder();
}
createdAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(createdAt_);
createdAt_ = subBuilder.buildPartial();
}
break;
}
case 50: {
com.google.protobuf.Timestamp.Builder subBuilder = null;
if (expiresAt_ != null) {
subBuilder = expiresAt_.toBuilder();
}
expiresAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(expiresAt_);
expiresAt_ = subBuilder.buildPartial();
}
break;
}
case 58: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
endpoints_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000002;
}
endpoints_.add(s);
break;
}
case 66: {
java.lang.String s = input.readStringRequireUtf8();
type_ = s;
break;
}
case 74: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000008) != 0)) {
authorizedIdpIds_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000008;
}
authorizedIdpIds_.add(s);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
scopes_ = scopes_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000004) != 0)) {
apps_ = java.util.Collections.unmodifiableList(apps_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
endpoints_ = endpoints_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000008) != 0)) {
authorizedIdpIds_ = authorizedIdpIds_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Key_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Key_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.Key.class, com.clarifai.grpc.api.Key.Builder.class);
}
public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @return The id.
*/
@java.lang.Override
public java.lang.String getId() {
java.lang.Object ref = id_;
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();
id_ = s;
return s;
}
}
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @return The bytes for id.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 8;
private volatile java.lang.Object type_;
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @return The type.
*/
@java.lang.Override
public java.lang.String getType() {
java.lang.Object ref = type_;
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();
type_ = s;
return s;
}
}
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @return The bytes for type.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DESCRIPTION_FIELD_NUMBER = 2;
private volatile java.lang.Object description_;
/**
*
* The description
*
*
* string description = 2;
* @return The description.
*/
@java.lang.Override
public java.lang.String getDescription() {
java.lang.Object ref = description_;
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();
description_ = s;
return s;
}
}
/**
*
* The description
*
*
* string description = 2;
* @return The bytes for description.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SCOPES_FIELD_NUMBER = 3;
private com.google.protobuf.LazyStringList scopes_;
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @return A list containing the scopes.
*/
public com.google.protobuf.ProtocolStringList
getScopesList() {
return scopes_;
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @return The count of scopes.
*/
public int getScopesCount() {
return scopes_.size();
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param index The index of the element to return.
* @return The scopes at the given index.
*/
public java.lang.String getScopes(int index) {
return scopes_.get(index);
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param index The index of the value to return.
* @return The bytes of the scopes at the given index.
*/
public com.google.protobuf.ByteString
getScopesBytes(int index) {
return scopes_.getByteString(index);
}
public static final int ENDPOINTS_FIELD_NUMBER = 7;
private com.google.protobuf.LazyStringList endpoints_;
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @return A list containing the endpoints.
*/
public com.google.protobuf.ProtocolStringList
getEndpointsList() {
return endpoints_;
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @return The count of endpoints.
*/
public int getEndpointsCount() {
return endpoints_.size();
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param index The index of the element to return.
* @return The endpoints at the given index.
*/
public java.lang.String getEndpoints(int index) {
return endpoints_.get(index);
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param index The index of the value to return.
* @return The bytes of the endpoints at the given index.
*/
public com.google.protobuf.ByteString
getEndpointsBytes(int index) {
return endpoints_.getByteString(index);
}
public static final int APPS_FIELD_NUMBER = 4;
private java.util.List apps_;
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
@java.lang.Override
public java.util.List getAppsList() {
return apps_;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
@java.lang.Override
public java.util.List extends com.clarifai.grpc.api.AppOrBuilder>
getAppsOrBuilderList() {
return apps_;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
@java.lang.Override
public int getAppsCount() {
return apps_.size();
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
@java.lang.Override
public com.clarifai.grpc.api.App getApps(int index) {
return apps_.get(index);
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
@java.lang.Override
public com.clarifai.grpc.api.AppOrBuilder getAppsOrBuilder(
int index) {
return apps_.get(index);
}
public static final int CREATED_AT_FIELD_NUMBER = 5;
private com.google.protobuf.Timestamp createdAt_;
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
* @return Whether the createdAt field is set.
*/
@java.lang.Override
public boolean hasCreatedAt() {
return createdAt_ != null;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
* @return The createdAt.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getCreatedAt() {
return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
return getCreatedAt();
}
public static final int EXPIRES_AT_FIELD_NUMBER = 6;
private com.google.protobuf.Timestamp expiresAt_;
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
* @return Whether the expiresAt field is set.
*/
@java.lang.Override
public boolean hasExpiresAt() {
return expiresAt_ != null;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
* @return The expiresAt.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getExpiresAt() {
return expiresAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiresAt_;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getExpiresAtOrBuilder() {
return getExpiresAt();
}
public static final int AUTHORIZED_IDP_IDS_FIELD_NUMBER = 9;
private com.google.protobuf.LazyStringList authorizedIdpIds_;
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @return A list containing the authorizedIdpIds.
*/
public com.google.protobuf.ProtocolStringList
getAuthorizedIdpIdsList() {
return authorizedIdpIds_;
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @return The count of authorizedIdpIds.
*/
public int getAuthorizedIdpIdsCount() {
return authorizedIdpIds_.size();
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param index The index of the element to return.
* @return The authorizedIdpIds at the given index.
*/
public java.lang.String getAuthorizedIdpIds(int index) {
return authorizedIdpIds_.get(index);
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param index The index of the value to return.
* @return The bytes of the authorizedIdpIds at the given index.
*/
public com.google.protobuf.ByteString
getAuthorizedIdpIdsBytes(int index) {
return authorizedIdpIds_.getByteString(index);
}
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(id_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_);
}
for (int i = 0; i < scopes_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, scopes_.getRaw(i));
}
for (int i = 0; i < apps_.size(); i++) {
output.writeMessage(4, apps_.get(i));
}
if (createdAt_ != null) {
output.writeMessage(5, getCreatedAt());
}
if (expiresAt_ != null) {
output.writeMessage(6, getExpiresAt());
}
for (int i = 0; i < endpoints_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, endpoints_.getRaw(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, type_);
}
for (int i = 0; i < authorizedIdpIds_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, authorizedIdpIds_.getRaw(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_);
}
{
int dataSize = 0;
for (int i = 0; i < scopes_.size(); i++) {
dataSize += computeStringSizeNoTag(scopes_.getRaw(i));
}
size += dataSize;
size += 1 * getScopesList().size();
}
for (int i = 0; i < apps_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, apps_.get(i));
}
if (createdAt_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getCreatedAt());
}
if (expiresAt_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getExpiresAt());
}
{
int dataSize = 0;
for (int i = 0; i < endpoints_.size(); i++) {
dataSize += computeStringSizeNoTag(endpoints_.getRaw(i));
}
size += dataSize;
size += 1 * getEndpointsList().size();
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, type_);
}
{
int dataSize = 0;
for (int i = 0; i < authorizedIdpIds_.size(); i++) {
dataSize += computeStringSizeNoTag(authorizedIdpIds_.getRaw(i));
}
size += dataSize;
size += 1 * getAuthorizedIdpIdsList().size();
}
size += unknownFields.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.clarifai.grpc.api.Key)) {
return super.equals(obj);
}
com.clarifai.grpc.api.Key other = (com.clarifai.grpc.api.Key) obj;
if (!getId()
.equals(other.getId())) return false;
if (!getType()
.equals(other.getType())) return false;
if (!getDescription()
.equals(other.getDescription())) return false;
if (!getScopesList()
.equals(other.getScopesList())) return false;
if (!getEndpointsList()
.equals(other.getEndpointsList())) return false;
if (!getAppsList()
.equals(other.getAppsList())) return false;
if (hasCreatedAt() != other.hasCreatedAt()) return false;
if (hasCreatedAt()) {
if (!getCreatedAt()
.equals(other.getCreatedAt())) return false;
}
if (hasExpiresAt() != other.hasExpiresAt()) return false;
if (hasExpiresAt()) {
if (!getExpiresAt()
.equals(other.getExpiresAt())) return false;
}
if (!getAuthorizedIdpIdsList()
.equals(other.getAuthorizedIdpIdsList())) return false;
if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getDescription().hashCode();
if (getScopesCount() > 0) {
hash = (37 * hash) + SCOPES_FIELD_NUMBER;
hash = (53 * hash) + getScopesList().hashCode();
}
if (getEndpointsCount() > 0) {
hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER;
hash = (53 * hash) + getEndpointsList().hashCode();
}
if (getAppsCount() > 0) {
hash = (37 * hash) + APPS_FIELD_NUMBER;
hash = (53 * hash) + getAppsList().hashCode();
}
if (hasCreatedAt()) {
hash = (37 * hash) + CREATED_AT_FIELD_NUMBER;
hash = (53 * hash) + getCreatedAt().hashCode();
}
if (hasExpiresAt()) {
hash = (37 * hash) + EXPIRES_AT_FIELD_NUMBER;
hash = (53 * hash) + getExpiresAt().hashCode();
}
if (getAuthorizedIdpIdsCount() > 0) {
hash = (37 * hash) + AUTHORIZED_IDP_IDS_FIELD_NUMBER;
hash = (53 * hash) + getAuthorizedIdpIdsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.clarifai.grpc.api.Key parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Key parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.Key parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Key parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.Key parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Key parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.Key parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Key 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.clarifai.grpc.api.Key parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Key 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.clarifai.grpc.api.Key parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Key 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.clarifai.grpc.api.Key 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;
}
/**
*
* Key
*
*
* Protobuf type {@code clarifai.api.Key}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.Key)
com.clarifai.grpc.api.KeyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Key_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Key_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.Key.class, com.clarifai.grpc.api.Key.Builder.class);
}
// Construct using com.clarifai.grpc.api.Key.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getAppsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
id_ = "";
type_ = "";
description_ = "";
scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
if (appsBuilder_ == null) {
apps_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
appsBuilder_.clear();
}
if (createdAtBuilder_ == null) {
createdAt_ = null;
} else {
createdAt_ = null;
createdAtBuilder_ = null;
}
if (expiresAtBuilder_ == null) {
expiresAt_ = null;
} else {
expiresAt_ = null;
expiresAtBuilder_ = null;
}
authorizedIdpIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Key_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.Key getDefaultInstanceForType() {
return com.clarifai.grpc.api.Key.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.Key build() {
com.clarifai.grpc.api.Key result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.Key buildPartial() {
com.clarifai.grpc.api.Key result = new com.clarifai.grpc.api.Key(this);
int from_bitField0_ = bitField0_;
result.id_ = id_;
result.type_ = type_;
result.description_ = description_;
if (((bitField0_ & 0x00000001) != 0)) {
scopes_ = scopes_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.scopes_ = scopes_;
if (((bitField0_ & 0x00000002) != 0)) {
endpoints_ = endpoints_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.endpoints_ = endpoints_;
if (appsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
apps_ = java.util.Collections.unmodifiableList(apps_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.apps_ = apps_;
} else {
result.apps_ = appsBuilder_.build();
}
if (createdAtBuilder_ == null) {
result.createdAt_ = createdAt_;
} else {
result.createdAt_ = createdAtBuilder_.build();
}
if (expiresAtBuilder_ == null) {
result.expiresAt_ = expiresAt_;
} else {
result.expiresAt_ = expiresAtBuilder_.build();
}
if (((bitField0_ & 0x00000008) != 0)) {
authorizedIdpIds_ = authorizedIdpIds_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000008);
}
result.authorizedIdpIds_ = authorizedIdpIds_;
onBuilt();
return result;
}
@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.clarifai.grpc.api.Key) {
return mergeFrom((com.clarifai.grpc.api.Key)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.Key other) {
if (other == com.clarifai.grpc.api.Key.getDefaultInstance()) return this;
if (!other.getId().isEmpty()) {
id_ = other.id_;
onChanged();
}
if (!other.getType().isEmpty()) {
type_ = other.type_;
onChanged();
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
onChanged();
}
if (!other.scopes_.isEmpty()) {
if (scopes_.isEmpty()) {
scopes_ = other.scopes_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureScopesIsMutable();
scopes_.addAll(other.scopes_);
}
onChanged();
}
if (!other.endpoints_.isEmpty()) {
if (endpoints_.isEmpty()) {
endpoints_ = other.endpoints_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureEndpointsIsMutable();
endpoints_.addAll(other.endpoints_);
}
onChanged();
}
if (appsBuilder_ == null) {
if (!other.apps_.isEmpty()) {
if (apps_.isEmpty()) {
apps_ = other.apps_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureAppsIsMutable();
apps_.addAll(other.apps_);
}
onChanged();
}
} else {
if (!other.apps_.isEmpty()) {
if (appsBuilder_.isEmpty()) {
appsBuilder_.dispose();
appsBuilder_ = null;
apps_ = other.apps_;
bitField0_ = (bitField0_ & ~0x00000004);
appsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getAppsFieldBuilder() : null;
} else {
appsBuilder_.addAllMessages(other.apps_);
}
}
}
if (other.hasCreatedAt()) {
mergeCreatedAt(other.getCreatedAt());
}
if (other.hasExpiresAt()) {
mergeExpiresAt(other.getExpiresAt());
}
if (!other.authorizedIdpIds_.isEmpty()) {
if (authorizedIdpIds_.isEmpty()) {
authorizedIdpIds_ = other.authorizedIdpIds_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureAuthorizedIdpIdsIsMutable();
authorizedIdpIds_.addAll(other.authorizedIdpIds_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.clarifai.grpc.api.Key parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.Key) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object id_ = "";
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @return The id.
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @return The bytes for id.
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
return this;
}
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
*
* The id of this key, it is used for authorization.
*
*
* string id = 1;
* @param value The bytes for id to set.
* @return This builder for chaining.
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
onChanged();
return this;
}
private java.lang.Object type_ = "";
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @return The type.
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @return The bytes for type.
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
return this;
}
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @return This builder for chaining.
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
onChanged();
return this;
}
/**
*
* The type of key, it can be api_key or personal_access_token, the default value is api_key
*
*
* string type = 8;
* @param value The bytes for type to set.
* @return This builder for chaining.
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
type_ = value;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
*
* The description
*
*
* string description = 2;
* @return The description.
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The description
*
*
* string description = 2;
* @return The bytes for description.
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The description
*
*
* string description = 2;
* @param value The description to set.
* @return This builder for chaining.
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
*
* The description
*
*
* string description = 2;
* @return This builder for chaining.
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
*
* The description
*
*
* string description = 2;
* @param value The bytes for description to set.
* @return This builder for chaining.
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureScopesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
scopes_ = new com.google.protobuf.LazyStringArrayList(scopes_);
bitField0_ |= 0x00000001;
}
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @return A list containing the scopes.
*/
public com.google.protobuf.ProtocolStringList
getScopesList() {
return scopes_.getUnmodifiableView();
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @return The count of scopes.
*/
public int getScopesCount() {
return scopes_.size();
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param index The index of the element to return.
* @return The scopes at the given index.
*/
public java.lang.String getScopes(int index) {
return scopes_.get(index);
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param index The index of the value to return.
* @return The bytes of the scopes at the given index.
*/
public com.google.protobuf.ByteString
getScopesBytes(int index) {
return scopes_.getByteString(index);
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param index The index to set the value at.
* @param value The scopes to set.
* @return This builder for chaining.
*/
public Builder setScopes(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureScopesIsMutable();
scopes_.set(index, value);
onChanged();
return this;
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param value The scopes to add.
* @return This builder for chaining.
*/
public Builder addScopes(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureScopesIsMutable();
scopes_.add(value);
onChanged();
return this;
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param values The scopes to add.
* @return This builder for chaining.
*/
public Builder addAllScopes(
java.lang.Iterable values) {
ensureScopesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, scopes_);
onChanged();
return this;
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @return This builder for chaining.
*/
public Builder clearScopes() {
scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* The low-level scopes this key has
*
*
* repeated string scopes = 3;
* @param value The bytes of the scopes to add.
* @return This builder for chaining.
*/
public Builder addScopesBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureScopesIsMutable();
scopes_.add(value);
onChanged();
return this;
}
private com.google.protobuf.LazyStringList endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureEndpointsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
endpoints_ = new com.google.protobuf.LazyStringArrayList(endpoints_);
bitField0_ |= 0x00000002;
}
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @return A list containing the endpoints.
*/
public com.google.protobuf.ProtocolStringList
getEndpointsList() {
return endpoints_.getUnmodifiableView();
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @return The count of endpoints.
*/
public int getEndpointsCount() {
return endpoints_.size();
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param index The index of the element to return.
* @return The endpoints at the given index.
*/
public java.lang.String getEndpoints(int index) {
return endpoints_.get(index);
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param index The index of the value to return.
* @return The bytes of the endpoints at the given index.
*/
public com.google.protobuf.ByteString
getEndpointsBytes(int index) {
return endpoints_.getByteString(index);
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param index The index to set the value at.
* @param value The endpoints to set.
* @return This builder for chaining.
*/
public Builder setEndpoints(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureEndpointsIsMutable();
endpoints_.set(index, value);
onChanged();
return this;
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param value The endpoints to add.
* @return This builder for chaining.
*/
public Builder addEndpoints(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureEndpointsIsMutable();
endpoints_.add(value);
onChanged();
return this;
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param values The endpoints to add.
* @return This builder for chaining.
*/
public Builder addAllEndpoints(
java.lang.Iterable values) {
ensureEndpointsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, endpoints_);
onChanged();
return this;
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @return This builder for chaining.
*/
public Builder clearEndpoints() {
endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* The endpoint-level scopes this key has
*
*
* repeated string endpoints = 7;
* @param value The bytes of the endpoints to add.
* @return This builder for chaining.
*/
public Builder addEndpointsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureEndpointsIsMutable();
endpoints_.add(value);
onChanged();
return this;
}
private java.util.List apps_ =
java.util.Collections.emptyList();
private void ensureAppsIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
apps_ = new java.util.ArrayList(apps_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.clarifai.grpc.api.App, com.clarifai.grpc.api.App.Builder, com.clarifai.grpc.api.AppOrBuilder> appsBuilder_;
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public java.util.List getAppsList() {
if (appsBuilder_ == null) {
return java.util.Collections.unmodifiableList(apps_);
} else {
return appsBuilder_.getMessageList();
}
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public int getAppsCount() {
if (appsBuilder_ == null) {
return apps_.size();
} else {
return appsBuilder_.getCount();
}
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public com.clarifai.grpc.api.App getApps(int index) {
if (appsBuilder_ == null) {
return apps_.get(index);
} else {
return appsBuilder_.getMessage(index);
}
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder setApps(
int index, com.clarifai.grpc.api.App value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.set(index, value);
onChanged();
} else {
appsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder setApps(
int index, com.clarifai.grpc.api.App.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.set(index, builderForValue.build());
onChanged();
} else {
appsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder addApps(com.clarifai.grpc.api.App value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.add(value);
onChanged();
} else {
appsBuilder_.addMessage(value);
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder addApps(
int index, com.clarifai.grpc.api.App value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.add(index, value);
onChanged();
} else {
appsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder addApps(
com.clarifai.grpc.api.App.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.add(builderForValue.build());
onChanged();
} else {
appsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder addApps(
int index, com.clarifai.grpc.api.App.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.add(index, builderForValue.build());
onChanged();
} else {
appsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder addAllApps(
java.lang.Iterable extends com.clarifai.grpc.api.App> values) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, apps_);
onChanged();
} else {
appsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder clearApps() {
if (appsBuilder_ == null) {
apps_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
appsBuilder_.clear();
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public Builder removeApps(int index) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.remove(index);
onChanged();
} else {
appsBuilder_.remove(index);
}
return this;
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public com.clarifai.grpc.api.App.Builder getAppsBuilder(
int index) {
return getAppsFieldBuilder().getBuilder(index);
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public com.clarifai.grpc.api.AppOrBuilder getAppsOrBuilder(
int index) {
if (appsBuilder_ == null) {
return apps_.get(index); } else {
return appsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public java.util.List extends com.clarifai.grpc.api.AppOrBuilder>
getAppsOrBuilderList() {
if (appsBuilder_ != null) {
return appsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(apps_);
}
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public com.clarifai.grpc.api.App.Builder addAppsBuilder() {
return getAppsFieldBuilder().addBuilder(
com.clarifai.grpc.api.App.getDefaultInstance());
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public com.clarifai.grpc.api.App.Builder addAppsBuilder(
int index) {
return getAppsFieldBuilder().addBuilder(
index, com.clarifai.grpc.api.App.getDefaultInstance());
}
/**
*
* The apps that this key give you access to, it is empty if this key is personal_access_token
* API key can only give you access to a single app.
*
*
* repeated .clarifai.api.App apps = 4;
*/
public java.util.List
getAppsBuilderList() {
return getAppsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.clarifai.grpc.api.App, com.clarifai.grpc.api.App.Builder, com.clarifai.grpc.api.AppOrBuilder>
getAppsFieldBuilder() {
if (appsBuilder_ == null) {
appsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.clarifai.grpc.api.App, com.clarifai.grpc.api.App.Builder, com.clarifai.grpc.api.AppOrBuilder>(
apps_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
apps_ = null;
}
return appsBuilder_;
}
private com.google.protobuf.Timestamp createdAt_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdAtBuilder_;
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
* @return Whether the createdAt field is set.
*/
public boolean hasCreatedAt() {
return createdAtBuilder_ != null || createdAt_ != null;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
* @return The createdAt.
*/
public com.google.protobuf.Timestamp getCreatedAt() {
if (createdAtBuilder_ == null) {
return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
} else {
return createdAtBuilder_.getMessage();
}
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public Builder setCreatedAt(com.google.protobuf.Timestamp value) {
if (createdAtBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
createdAt_ = value;
onChanged();
} else {
createdAtBuilder_.setMessage(value);
}
return this;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public Builder setCreatedAt(
com.google.protobuf.Timestamp.Builder builderForValue) {
if (createdAtBuilder_ == null) {
createdAt_ = builderForValue.build();
onChanged();
} else {
createdAtBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public Builder mergeCreatedAt(com.google.protobuf.Timestamp value) {
if (createdAtBuilder_ == null) {
if (createdAt_ != null) {
createdAt_ =
com.google.protobuf.Timestamp.newBuilder(createdAt_).mergeFrom(value).buildPartial();
} else {
createdAt_ = value;
}
onChanged();
} else {
createdAtBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public Builder clearCreatedAt() {
if (createdAtBuilder_ == null) {
createdAt_ = null;
onChanged();
} else {
createdAt_ = null;
createdAtBuilder_ = null;
}
return this;
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public com.google.protobuf.Timestamp.Builder getCreatedAtBuilder() {
onChanged();
return getCreatedAtFieldBuilder().getBuilder();
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
if (createdAtBuilder_ != null) {
return createdAtBuilder_.getMessageOrBuilder();
} else {
return createdAt_ == null ?
com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
}
}
/**
*
* When the key was created. We follow the XXXX timestamp
* format. We use https://www.ietf.org/rfc/rfc3339.txt format:
* "2006-01-02T15:04:05.999999Z" so you can expect results like
* the following from the API:
* "2017-04-11T21:50:50.223962Z"
*
*
* .google.protobuf.Timestamp created_at = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
getCreatedAtFieldBuilder() {
if (createdAtBuilder_ == null) {
createdAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
getCreatedAt(),
getParentForChildren(),
isClean());
createdAt_ = null;
}
return createdAtBuilder_;
}
private com.google.protobuf.Timestamp expiresAt_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> expiresAtBuilder_;
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
* @return Whether the expiresAt field is set.
*/
public boolean hasExpiresAt() {
return expiresAtBuilder_ != null || expiresAt_ != null;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
* @return The expiresAt.
*/
public com.google.protobuf.Timestamp getExpiresAt() {
if (expiresAtBuilder_ == null) {
return expiresAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiresAt_;
} else {
return expiresAtBuilder_.getMessage();
}
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public Builder setExpiresAt(com.google.protobuf.Timestamp value) {
if (expiresAtBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
expiresAt_ = value;
onChanged();
} else {
expiresAtBuilder_.setMessage(value);
}
return this;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public Builder setExpiresAt(
com.google.protobuf.Timestamp.Builder builderForValue) {
if (expiresAtBuilder_ == null) {
expiresAt_ = builderForValue.build();
onChanged();
} else {
expiresAtBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public Builder mergeExpiresAt(com.google.protobuf.Timestamp value) {
if (expiresAtBuilder_ == null) {
if (expiresAt_ != null) {
expiresAt_ =
com.google.protobuf.Timestamp.newBuilder(expiresAt_).mergeFrom(value).buildPartial();
} else {
expiresAt_ = value;
}
onChanged();
} else {
expiresAtBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public Builder clearExpiresAt() {
if (expiresAtBuilder_ == null) {
expiresAt_ = null;
onChanged();
} else {
expiresAt_ = null;
expiresAtBuilder_ = null;
}
return this;
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public com.google.protobuf.Timestamp.Builder getExpiresAtBuilder() {
onChanged();
return getExpiresAtFieldBuilder().getBuilder();
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
public com.google.protobuf.TimestampOrBuilder getExpiresAtOrBuilder() {
if (expiresAtBuilder_ != null) {
return expiresAtBuilder_.getMessageOrBuilder();
} else {
return expiresAt_ == null ?
com.google.protobuf.Timestamp.getDefaultInstance() : expiresAt_;
}
}
/**
*
* When does the key expires, the key won't expire if this is empty
*
*
* .google.protobuf.Timestamp expires_at = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
getExpiresAtFieldBuilder() {
if (expiresAtBuilder_ == null) {
expiresAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
getExpiresAt(),
getParentForChildren(),
isClean());
expiresAt_ = null;
}
return expiresAtBuilder_;
}
private com.google.protobuf.LazyStringList authorizedIdpIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureAuthorizedIdpIdsIsMutable() {
if (!((bitField0_ & 0x00000008) != 0)) {
authorizedIdpIds_ = new com.google.protobuf.LazyStringArrayList(authorizedIdpIds_);
bitField0_ |= 0x00000008;
}
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @return A list containing the authorizedIdpIds.
*/
public com.google.protobuf.ProtocolStringList
getAuthorizedIdpIdsList() {
return authorizedIdpIds_.getUnmodifiableView();
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @return The count of authorizedIdpIds.
*/
public int getAuthorizedIdpIdsCount() {
return authorizedIdpIds_.size();
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param index The index of the element to return.
* @return The authorizedIdpIds at the given index.
*/
public java.lang.String getAuthorizedIdpIds(int index) {
return authorizedIdpIds_.get(index);
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param index The index of the value to return.
* @return The bytes of the authorizedIdpIds at the given index.
*/
public com.google.protobuf.ByteString
getAuthorizedIdpIdsBytes(int index) {
return authorizedIdpIds_.getByteString(index);
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param index The index to set the value at.
* @param value The authorizedIdpIds to set.
* @return This builder for chaining.
*/
public Builder setAuthorizedIdpIds(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAuthorizedIdpIdsIsMutable();
authorizedIdpIds_.set(index, value);
onChanged();
return this;
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param value The authorizedIdpIds to add.
* @return This builder for chaining.
*/
public Builder addAuthorizedIdpIds(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAuthorizedIdpIdsIsMutable();
authorizedIdpIds_.add(value);
onChanged();
return this;
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param values The authorizedIdpIds to add.
* @return This builder for chaining.
*/
public Builder addAllAuthorizedIdpIds(
java.lang.Iterable values) {
ensureAuthorizedIdpIdsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, authorizedIdpIds_);
onChanged();
return this;
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @return This builder for chaining.
*/
public Builder clearAuthorizedIdpIds() {
authorizedIdpIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
* list of idp ids at which key is currently authorized
*
*
* repeated string authorized_idp_ids = 9;
* @param value The bytes of the authorizedIdpIds to add.
* @return This builder for chaining.
*/
public Builder addAuthorizedIdpIdsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAuthorizedIdpIdsIsMutable();
authorizedIdpIds_.add(value);
onChanged();
return this;
}
@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:clarifai.api.Key)
}
// @@protoc_insertion_point(class_scope:clarifai.api.Key)
private static final com.clarifai.grpc.api.Key DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.Key();
}
public static com.clarifai.grpc.api.Key getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Key parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Key(input, extensionRegistry);
}
};
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.clarifai.grpc.api.Key getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}