All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.Usage Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/usage.proto

package com.google.api;

/**
 * 
 * Configuration controlling usage of a service.
 * 
* * Protobuf type {@code google.api.Usage} */ public final class Usage extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.api.Usage) UsageOrBuilder { // Use Usage.newBuilder() to construct. private Usage(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Usage() { serviceAccess_ = 0; requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY; dependsOnServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; activationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; deactivationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; rules_ = java.util.Collections.emptyList(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private Usage( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!input.skipField(tag)) { done = true; } break; } case 10: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { requirements_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000002; } requirements_.add(s); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { dependsOnServices_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000004; } dependsOnServices_.add(s); break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { activationHooks_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000008; } activationHooks_.add(s); break; } case 32: { int rawValue = input.readEnum(); serviceAccess_ = rawValue; break; } case 42: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { deactivationHooks_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000010; } deactivationHooks_.add(s); break; } case 50: { if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { rules_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000020; } rules_.add( input.readMessage(com.google.api.UsageRule.parser(), extensionRegistry)); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { requirements_ = requirements_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { dependsOnServices_ = dependsOnServices_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { activationHooks_ = activationHooks_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { deactivationHooks_ = deactivationHooks_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { rules_ = java.util.Collections.unmodifiableList(rules_); } makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.UsageProto.internal_static_google_api_Usage_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.UsageProto.internal_static_google_api_Usage_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.Usage.class, com.google.api.Usage.Builder.class); } /** *
   * Service access types.
   * Access to restricted API features is always controlled by
   * [visibility][google.api.Visibility], independent of the ServiceAccess type.
   * 
* * Protobuf enum {@code google.api.Usage.ServiceAccess} */ public enum ServiceAccess implements com.google.protobuf.ProtocolMessageEnum { /** *
     * The service can only be seen/used by users identified in the service's
     * access control policy.
     * If the service has not been whitelisted by your domain administrator
     * for out-of-org publishing, then this mode will be treated like
     * ORG_RESTRICTED.
     * 
* * RESTRICTED = 0; */ RESTRICTED(0), /** *
     * The service can be seen/used by anyone.
     * If the service has not been whitelisted by your domain administrator
     * for out-of-org publishing, then this mode will be treated like
     * ORG_PUBLIC.
     * The discovery document for the service will also be public and allow
     * unregistered access.
     * 
* * PUBLIC = 1; */ PUBLIC(1), /** *
     * The service can be seen/used by users identified in the service's
     * access control policy and they are within the organization that owns the
     * service.
     * Access is further constrained to the group
     * controlled by the administrator of the project/org that owns the
     * service.
     * 
* * ORG_RESTRICTED = 2; */ ORG_RESTRICTED(2), /** *
     * The service can be seen/used by the group of users controlled by the
     * administrator of the project/org that owns the service.
     * 
* * ORG_PUBLIC = 3; */ ORG_PUBLIC(3), UNRECOGNIZED(-1), ; /** *
     * The service can only be seen/used by users identified in the service's
     * access control policy.
     * If the service has not been whitelisted by your domain administrator
     * for out-of-org publishing, then this mode will be treated like
     * ORG_RESTRICTED.
     * 
* * RESTRICTED = 0; */ public static final int RESTRICTED_VALUE = 0; /** *
     * The service can be seen/used by anyone.
     * If the service has not been whitelisted by your domain administrator
     * for out-of-org publishing, then this mode will be treated like
     * ORG_PUBLIC.
     * The discovery document for the service will also be public and allow
     * unregistered access.
     * 
* * PUBLIC = 1; */ public static final int PUBLIC_VALUE = 1; /** *
     * The service can be seen/used by users identified in the service's
     * access control policy and they are within the organization that owns the
     * service.
     * Access is further constrained to the group
     * controlled by the administrator of the project/org that owns the
     * service.
     * 
* * ORG_RESTRICTED = 2; */ public static final int ORG_RESTRICTED_VALUE = 2; /** *
     * The service can be seen/used by the group of users controlled by the
     * administrator of the project/org that owns the service.
     * 
* * ORG_PUBLIC = 3; */ public static final int ORG_PUBLIC_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ServiceAccess valueOf(int value) { return forNumber(value); } public static ServiceAccess forNumber(int value) { switch (value) { case 0: return RESTRICTED; case 1: return PUBLIC; case 2: return ORG_RESTRICTED; case 3: return ORG_PUBLIC; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< ServiceAccess> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public ServiceAccess findValueByNumber(int number) { return ServiceAccess.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.Usage.getDescriptor().getEnumTypes().get(0); } private static final ServiceAccess[] VALUES = values(); public static ServiceAccess valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private ServiceAccess(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.api.Usage.ServiceAccess) } private int bitField0_; public static final int SERVICE_ACCESS_FIELD_NUMBER = 4; private int serviceAccess_; /** *
   * Controls which users can see or activate the service.
   * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public int getServiceAccessValue() { return serviceAccess_; } /** *
   * Controls which users can see or activate the service.
   * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public com.google.api.Usage.ServiceAccess getServiceAccess() { com.google.api.Usage.ServiceAccess result = com.google.api.Usage.ServiceAccess.valueOf(serviceAccess_); return result == null ? com.google.api.Usage.ServiceAccess.UNRECOGNIZED : result; } public static final int REQUIREMENTS_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList requirements_; /** *
   * Requirements that must be satisfied before a consumer project can use the
   * service. Each requirement is of the form <service.name>/<requirement-id>;
   * for example 'serviceusage.googleapis.com/billing-enabled'.
   * 
* * repeated string requirements = 1; */ public com.google.protobuf.ProtocolStringList getRequirementsList() { return requirements_; } /** *
   * Requirements that must be satisfied before a consumer project can use the
   * service. Each requirement is of the form <service.name>/<requirement-id>;
   * for example 'serviceusage.googleapis.com/billing-enabled'.
   * 
* * repeated string requirements = 1; */ public int getRequirementsCount() { return requirements_.size(); } /** *
   * Requirements that must be satisfied before a consumer project can use the
   * service. Each requirement is of the form <service.name>/<requirement-id>;
   * for example 'serviceusage.googleapis.com/billing-enabled'.
   * 
* * repeated string requirements = 1; */ public java.lang.String getRequirements(int index) { return requirements_.get(index); } /** *
   * Requirements that must be satisfied before a consumer project can use the
   * service. Each requirement is of the form <service.name>/<requirement-id>;
   * for example 'serviceusage.googleapis.com/billing-enabled'.
   * 
* * repeated string requirements = 1; */ public com.google.protobuf.ByteString getRequirementsBytes(int index) { return requirements_.getByteString(index); } public static final int DEPENDS_ON_SERVICES_FIELD_NUMBER = 2; private com.google.protobuf.LazyStringList dependsOnServices_; /** *
   * Services that must be activated in order for this service to be used.
   * The set of services activated as a result of these relations are all
   * activated in parallel with no guaranteed order of activation.
   * Each string is a service name, e.g. `calendar.googleapis.com`.
   * 
* * repeated string depends_on_services = 2; */ public com.google.protobuf.ProtocolStringList getDependsOnServicesList() { return dependsOnServices_; } /** *
   * Services that must be activated in order for this service to be used.
   * The set of services activated as a result of these relations are all
   * activated in parallel with no guaranteed order of activation.
   * Each string is a service name, e.g. `calendar.googleapis.com`.
   * 
* * repeated string depends_on_services = 2; */ public int getDependsOnServicesCount() { return dependsOnServices_.size(); } /** *
   * Services that must be activated in order for this service to be used.
   * The set of services activated as a result of these relations are all
   * activated in parallel with no guaranteed order of activation.
   * Each string is a service name, e.g. `calendar.googleapis.com`.
   * 
* * repeated string depends_on_services = 2; */ public java.lang.String getDependsOnServices(int index) { return dependsOnServices_.get(index); } /** *
   * Services that must be activated in order for this service to be used.
   * The set of services activated as a result of these relations are all
   * activated in parallel with no guaranteed order of activation.
   * Each string is a service name, e.g. `calendar.googleapis.com`.
   * 
* * repeated string depends_on_services = 2; */ public com.google.protobuf.ByteString getDependsOnServicesBytes(int index) { return dependsOnServices_.getByteString(index); } public static final int ACTIVATION_HOOKS_FIELD_NUMBER = 3; private com.google.protobuf.LazyStringList activationHooks_; /** *
   * Services that must be contacted before a consumer can begin using the
   * service. Each service will be contacted in sequence, and, if any activation
   * call fails, the entire activation will fail. Each hook is of the form
   * <service.name>/<hook-id>, where <hook-id> is optional; for example:
   * 'robotservice.googleapis.com/default'.
   * 
* * repeated string activation_hooks = 3; */ public com.google.protobuf.ProtocolStringList getActivationHooksList() { return activationHooks_; } /** *
   * Services that must be contacted before a consumer can begin using the
   * service. Each service will be contacted in sequence, and, if any activation
   * call fails, the entire activation will fail. Each hook is of the form
   * <service.name>/<hook-id>, where <hook-id> is optional; for example:
   * 'robotservice.googleapis.com/default'.
   * 
* * repeated string activation_hooks = 3; */ public int getActivationHooksCount() { return activationHooks_.size(); } /** *
   * Services that must be contacted before a consumer can begin using the
   * service. Each service will be contacted in sequence, and, if any activation
   * call fails, the entire activation will fail. Each hook is of the form
   * <service.name>/<hook-id>, where <hook-id> is optional; for example:
   * 'robotservice.googleapis.com/default'.
   * 
* * repeated string activation_hooks = 3; */ public java.lang.String getActivationHooks(int index) { return activationHooks_.get(index); } /** *
   * Services that must be contacted before a consumer can begin using the
   * service. Each service will be contacted in sequence, and, if any activation
   * call fails, the entire activation will fail. Each hook is of the form
   * <service.name>/<hook-id>, where <hook-id> is optional; for example:
   * 'robotservice.googleapis.com/default'.
   * 
* * repeated string activation_hooks = 3; */ public com.google.protobuf.ByteString getActivationHooksBytes(int index) { return activationHooks_.getByteString(index); } public static final int DEACTIVATION_HOOKS_FIELD_NUMBER = 5; private com.google.protobuf.LazyStringList deactivationHooks_; /** *
   * Services that must be contacted before a consumer can deactivate a
   * service. Each service will be contacted in sequence, and, if any
   * deactivation call fails, the entire deactivation will fail. Each hook is
   * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
   * example:
   * 'compute.googleapis.com/'.
   * 
* * repeated string deactivation_hooks = 5; */ public com.google.protobuf.ProtocolStringList getDeactivationHooksList() { return deactivationHooks_; } /** *
   * Services that must be contacted before a consumer can deactivate a
   * service. Each service will be contacted in sequence, and, if any
   * deactivation call fails, the entire deactivation will fail. Each hook is
   * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
   * example:
   * 'compute.googleapis.com/'.
   * 
* * repeated string deactivation_hooks = 5; */ public int getDeactivationHooksCount() { return deactivationHooks_.size(); } /** *
   * Services that must be contacted before a consumer can deactivate a
   * service. Each service will be contacted in sequence, and, if any
   * deactivation call fails, the entire deactivation will fail. Each hook is
   * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
   * example:
   * 'compute.googleapis.com/'.
   * 
* * repeated string deactivation_hooks = 5; */ public java.lang.String getDeactivationHooks(int index) { return deactivationHooks_.get(index); } /** *
   * Services that must be contacted before a consumer can deactivate a
   * service. Each service will be contacted in sequence, and, if any
   * deactivation call fails, the entire deactivation will fail. Each hook is
   * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
   * example:
   * 'compute.googleapis.com/'.
   * 
* * repeated string deactivation_hooks = 5; */ public com.google.protobuf.ByteString getDeactivationHooksBytes(int index) { return deactivationHooks_.getByteString(index); } public static final int RULES_FIELD_NUMBER = 6; private java.util.List rules_; /** *
   * Individual rules for configuring usage on selected methods.
   * 
* * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesList() { return rules_; } /** *
   * Individual rules for configuring usage on selected methods.
   * 
* * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesOrBuilderList() { return rules_; } /** *
   * Individual rules for configuring usage on selected methods.
   * 
* * repeated .google.api.UsageRule rules = 6; */ public int getRulesCount() { return rules_.size(); } /** *
   * Individual rules for configuring usage on selected methods.
   * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule getRules(int index) { return rules_.get(index); } /** *
   * Individual rules for configuring usage on selected methods.
   * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRuleOrBuilder getRulesOrBuilder( int index) { return rules_.get(index); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < requirements_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requirements_.getRaw(i)); } for (int i = 0; i < dependsOnServices_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dependsOnServices_.getRaw(i)); } for (int i = 0; i < activationHooks_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, activationHooks_.getRaw(i)); } if (serviceAccess_ != com.google.api.Usage.ServiceAccess.RESTRICTED.getNumber()) { output.writeEnum(4, serviceAccess_); } for (int i = 0; i < deactivationHooks_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, deactivationHooks_.getRaw(i)); } for (int i = 0; i < rules_.size(); i++) { output.writeMessage(6, rules_.get(i)); } } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < requirements_.size(); i++) { dataSize += computeStringSizeNoTag(requirements_.getRaw(i)); } size += dataSize; size += 1 * getRequirementsList().size(); } { int dataSize = 0; for (int i = 0; i < dependsOnServices_.size(); i++) { dataSize += computeStringSizeNoTag(dependsOnServices_.getRaw(i)); } size += dataSize; size += 1 * getDependsOnServicesList().size(); } { int dataSize = 0; for (int i = 0; i < activationHooks_.size(); i++) { dataSize += computeStringSizeNoTag(activationHooks_.getRaw(i)); } size += dataSize; size += 1 * getActivationHooksList().size(); } if (serviceAccess_ != com.google.api.Usage.ServiceAccess.RESTRICTED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, serviceAccess_); } { int dataSize = 0; for (int i = 0; i < deactivationHooks_.size(); i++) { dataSize += computeStringSizeNoTag(deactivationHooks_.getRaw(i)); } size += dataSize; size += 1 * getDeactivationHooksList().size(); } for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, rules_.get(i)); } memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.api.Usage)) { return super.equals(obj); } com.google.api.Usage other = (com.google.api.Usage) obj; boolean result = true; result = result && serviceAccess_ == other.serviceAccess_; result = result && getRequirementsList() .equals(other.getRequirementsList()); result = result && getDependsOnServicesList() .equals(other.getDependsOnServicesList()); result = result && getActivationHooksList() .equals(other.getActivationHooksList()); result = result && getDeactivationHooksList() .equals(other.getDeactivationHooksList()); result = result && getRulesList() .equals(other.getRulesList()); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + SERVICE_ACCESS_FIELD_NUMBER; hash = (53 * hash) + serviceAccess_; if (getRequirementsCount() > 0) { hash = (37 * hash) + REQUIREMENTS_FIELD_NUMBER; hash = (53 * hash) + getRequirementsList().hashCode(); } if (getDependsOnServicesCount() > 0) { hash = (37 * hash) + DEPENDS_ON_SERVICES_FIELD_NUMBER; hash = (53 * hash) + getDependsOnServicesList().hashCode(); } if (getActivationHooksCount() > 0) { hash = (37 * hash) + ACTIVATION_HOOKS_FIELD_NUMBER; hash = (53 * hash) + getActivationHooksList().hashCode(); } if (getDeactivationHooksCount() > 0) { hash = (37 * hash) + DEACTIVATION_HOOKS_FIELD_NUMBER; hash = (53 * hash) + getDeactivationHooksList().hashCode(); } if (getRulesCount() > 0) { hash = (37 * hash) + RULES_FIELD_NUMBER; hash = (53 * hash) + getRulesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.api.Usage parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.Usage 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.api.Usage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.Usage parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.api.Usage parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.api.Usage 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.api.Usage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Usage 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.api.Usage parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.api.Usage parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.api.Usage prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } 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; } /** *
   * Configuration controlling usage of a service.
   * 
* * Protobuf type {@code google.api.Usage} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Usage) com.google.api.UsageOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.UsageProto.internal_static_google_api_Usage_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.UsageProto.internal_static_google_api_Usage_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.Usage.class, com.google.api.Usage.Builder.class); } // Construct using com.google.api.Usage.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getRulesFieldBuilder(); } } public Builder clear() { super.clear(); serviceAccess_ = 0; requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); dependsOnServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); activationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); deactivationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); } else { rulesBuilder_.clear(); } return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.api.UsageProto.internal_static_google_api_Usage_descriptor; } public com.google.api.Usage getDefaultInstanceForType() { return com.google.api.Usage.getDefaultInstance(); } public com.google.api.Usage build() { com.google.api.Usage result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.google.api.Usage buildPartial() { com.google.api.Usage result = new com.google.api.Usage(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.serviceAccess_ = serviceAccess_; if (((bitField0_ & 0x00000002) == 0x00000002)) { requirements_ = requirements_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.requirements_ = requirements_; if (((bitField0_ & 0x00000004) == 0x00000004)) { dependsOnServices_ = dependsOnServices_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000004); } result.dependsOnServices_ = dependsOnServices_; if (((bitField0_ & 0x00000008) == 0x00000008)) { activationHooks_ = activationHooks_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000008); } result.activationHooks_ = activationHooks_; if (((bitField0_ & 0x00000010) == 0x00000010)) { deactivationHooks_ = deactivationHooks_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000010); } result.deactivationHooks_ = deactivationHooks_; if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000020) == 0x00000020)) { rules_ = java.util.Collections.unmodifiableList(rules_); bitField0_ = (bitField0_ & ~0x00000020); } result.rules_ = rules_; } else { result.rules_ = rulesBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.api.Usage) { return mergeFrom((com.google.api.Usage)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.api.Usage other) { if (other == com.google.api.Usage.getDefaultInstance()) return this; if (other.serviceAccess_ != 0) { setServiceAccessValue(other.getServiceAccessValue()); } if (!other.requirements_.isEmpty()) { if (requirements_.isEmpty()) { requirements_ = other.requirements_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureRequirementsIsMutable(); requirements_.addAll(other.requirements_); } onChanged(); } if (!other.dependsOnServices_.isEmpty()) { if (dependsOnServices_.isEmpty()) { dependsOnServices_ = other.dependsOnServices_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureDependsOnServicesIsMutable(); dependsOnServices_.addAll(other.dependsOnServices_); } onChanged(); } if (!other.activationHooks_.isEmpty()) { if (activationHooks_.isEmpty()) { activationHooks_ = other.activationHooks_; bitField0_ = (bitField0_ & ~0x00000008); } else { ensureActivationHooksIsMutable(); activationHooks_.addAll(other.activationHooks_); } onChanged(); } if (!other.deactivationHooks_.isEmpty()) { if (deactivationHooks_.isEmpty()) { deactivationHooks_ = other.deactivationHooks_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureDeactivationHooksIsMutable(); deactivationHooks_.addAll(other.deactivationHooks_); } onChanged(); } if (rulesBuilder_ == null) { if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); } onChanged(); } } else { if (!other.rules_.isEmpty()) { if (rulesBuilder_.isEmpty()) { rulesBuilder_.dispose(); rulesBuilder_ = null; rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000020); rulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); } } } onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.api.Usage parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.api.Usage) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int serviceAccess_ = 0; /** *
     * Controls which users can see or activate the service.
     * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public int getServiceAccessValue() { return serviceAccess_; } /** *
     * Controls which users can see or activate the service.
     * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public Builder setServiceAccessValue(int value) { serviceAccess_ = value; onChanged(); return this; } /** *
     * Controls which users can see or activate the service.
     * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public com.google.api.Usage.ServiceAccess getServiceAccess() { com.google.api.Usage.ServiceAccess result = com.google.api.Usage.ServiceAccess.valueOf(serviceAccess_); return result == null ? com.google.api.Usage.ServiceAccess.UNRECOGNIZED : result; } /** *
     * Controls which users can see or activate the service.
     * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public Builder setServiceAccess(com.google.api.Usage.ServiceAccess value) { if (value == null) { throw new NullPointerException(); } serviceAccess_ = value.getNumber(); onChanged(); return this; } /** *
     * Controls which users can see or activate the service.
     * 
* * optional .google.api.Usage.ServiceAccess service_access = 4; */ public Builder clearServiceAccess() { serviceAccess_ = 0; onChanged(); return this; } private com.google.protobuf.LazyStringList requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureRequirementsIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { requirements_ = new com.google.protobuf.LazyStringArrayList(requirements_); bitField0_ |= 0x00000002; } } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public com.google.protobuf.ProtocolStringList getRequirementsList() { return requirements_.getUnmodifiableView(); } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public int getRequirementsCount() { return requirements_.size(); } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public java.lang.String getRequirements(int index) { return requirements_.get(index); } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public com.google.protobuf.ByteString getRequirementsBytes(int index) { return requirements_.getByteString(index); } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public Builder setRequirements( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureRequirementsIsMutable(); requirements_.set(index, value); onChanged(); return this; } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public Builder addRequirements( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureRequirementsIsMutable(); requirements_.add(value); onChanged(); return this; } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public Builder addAllRequirements( java.lang.Iterable values) { ensureRequirementsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, requirements_); onChanged(); return this; } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public Builder clearRequirements() { requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** *
     * Requirements that must be satisfied before a consumer project can use the
     * service. Each requirement is of the form <service.name>/<requirement-id>;
     * for example 'serviceusage.googleapis.com/billing-enabled'.
     * 
* * repeated string requirements = 1; */ public Builder addRequirementsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureRequirementsIsMutable(); requirements_.add(value); onChanged(); return this; } private com.google.protobuf.LazyStringList dependsOnServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureDependsOnServicesIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { dependsOnServices_ = new com.google.protobuf.LazyStringArrayList(dependsOnServices_); bitField0_ |= 0x00000004; } } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public com.google.protobuf.ProtocolStringList getDependsOnServicesList() { return dependsOnServices_.getUnmodifiableView(); } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public int getDependsOnServicesCount() { return dependsOnServices_.size(); } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public java.lang.String getDependsOnServices(int index) { return dependsOnServices_.get(index); } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public com.google.protobuf.ByteString getDependsOnServicesBytes(int index) { return dependsOnServices_.getByteString(index); } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public Builder setDependsOnServices( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDependsOnServicesIsMutable(); dependsOnServices_.set(index, value); onChanged(); return this; } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public Builder addDependsOnServices( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDependsOnServicesIsMutable(); dependsOnServices_.add(value); onChanged(); return this; } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public Builder addAllDependsOnServices( java.lang.Iterable values) { ensureDependsOnServicesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, dependsOnServices_); onChanged(); return this; } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public Builder clearDependsOnServices() { dependsOnServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** *
     * Services that must be activated in order for this service to be used.
     * The set of services activated as a result of these relations are all
     * activated in parallel with no guaranteed order of activation.
     * Each string is a service name, e.g. `calendar.googleapis.com`.
     * 
* * repeated string depends_on_services = 2; */ public Builder addDependsOnServicesBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureDependsOnServicesIsMutable(); dependsOnServices_.add(value); onChanged(); return this; } private com.google.protobuf.LazyStringList activationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureActivationHooksIsMutable() { if (!((bitField0_ & 0x00000008) == 0x00000008)) { activationHooks_ = new com.google.protobuf.LazyStringArrayList(activationHooks_); bitField0_ |= 0x00000008; } } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public com.google.protobuf.ProtocolStringList getActivationHooksList() { return activationHooks_.getUnmodifiableView(); } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public int getActivationHooksCount() { return activationHooks_.size(); } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public java.lang.String getActivationHooks(int index) { return activationHooks_.get(index); } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public com.google.protobuf.ByteString getActivationHooksBytes(int index) { return activationHooks_.getByteString(index); } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public Builder setActivationHooks( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureActivationHooksIsMutable(); activationHooks_.set(index, value); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public Builder addActivationHooks( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureActivationHooksIsMutable(); activationHooks_.add(value); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public Builder addAllActivationHooks( java.lang.Iterable values) { ensureActivationHooksIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, activationHooks_); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public Builder clearActivationHooks() { activationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can begin using the
     * service. Each service will be contacted in sequence, and, if any activation
     * call fails, the entire activation will fail. Each hook is of the form
     * <service.name>/<hook-id>, where <hook-id> is optional; for example:
     * 'robotservice.googleapis.com/default'.
     * 
* * repeated string activation_hooks = 3; */ public Builder addActivationHooksBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureActivationHooksIsMutable(); activationHooks_.add(value); onChanged(); return this; } private com.google.protobuf.LazyStringList deactivationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureDeactivationHooksIsMutable() { if (!((bitField0_ & 0x00000010) == 0x00000010)) { deactivationHooks_ = new com.google.protobuf.LazyStringArrayList(deactivationHooks_); bitField0_ |= 0x00000010; } } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public com.google.protobuf.ProtocolStringList getDeactivationHooksList() { return deactivationHooks_.getUnmodifiableView(); } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public int getDeactivationHooksCount() { return deactivationHooks_.size(); } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public java.lang.String getDeactivationHooks(int index) { return deactivationHooks_.get(index); } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public com.google.protobuf.ByteString getDeactivationHooksBytes(int index) { return deactivationHooks_.getByteString(index); } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public Builder setDeactivationHooks( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDeactivationHooksIsMutable(); deactivationHooks_.set(index, value); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public Builder addDeactivationHooks( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDeactivationHooksIsMutable(); deactivationHooks_.add(value); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public Builder addAllDeactivationHooks( java.lang.Iterable values) { ensureDeactivationHooksIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deactivationHooks_); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public Builder clearDeactivationHooks() { deactivationHooks_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** *
     * Services that must be contacted before a consumer can deactivate a
     * service. Each service will be contacted in sequence, and, if any
     * deactivation call fails, the entire deactivation will fail. Each hook is
     * of the form <service.name>/<hook-id>, where <hook-id> is optional; for
     * example:
     * 'compute.googleapis.com/'.
     * 
* * repeated string deactivation_hooks = 5; */ public Builder addDeactivationHooksBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureDeactivationHooksIsMutable(); deactivationHooks_.add(value); onChanged(); return this; } private java.util.List rules_ = java.util.Collections.emptyList(); private void ensureRulesIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { rules_ = new java.util.ArrayList(rules_); bitField0_ |= 0x00000020; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.api.UsageRule, com.google.api.UsageRule.Builder, com.google.api.UsageRuleOrBuilder> rulesBuilder_; /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesList() { if (rulesBuilder_ == null) { return java.util.Collections.unmodifiableList(rules_); } else { return rulesBuilder_.getMessageList(); } } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public int getRulesCount() { if (rulesBuilder_ == null) { return rules_.size(); } else { return rulesBuilder_.getCount(); } } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule getRules(int index) { if (rulesBuilder_ == null) { return rules_.get(index); } else { return rulesBuilder_.getMessage(index); } } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder setRules( int index, com.google.api.UsageRule value) { if (rulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRulesIsMutable(); rules_.set(index, value); onChanged(); } else { rulesBuilder_.setMessage(index, value); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder setRules( int index, com.google.api.UsageRule.Builder builderForValue) { if (rulesBuilder_ == null) { ensureRulesIsMutable(); rules_.set(index, builderForValue.build()); onChanged(); } else { rulesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder addRules(com.google.api.UsageRule value) { if (rulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRulesIsMutable(); rules_.add(value); onChanged(); } else { rulesBuilder_.addMessage(value); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder addRules( int index, com.google.api.UsageRule value) { if (rulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRulesIsMutable(); rules_.add(index, value); onChanged(); } else { rulesBuilder_.addMessage(index, value); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder addRules( com.google.api.UsageRule.Builder builderForValue) { if (rulesBuilder_ == null) { ensureRulesIsMutable(); rules_.add(builderForValue.build()); onChanged(); } else { rulesBuilder_.addMessage(builderForValue.build()); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder addRules( int index, com.google.api.UsageRule.Builder builderForValue) { if (rulesBuilder_ == null) { ensureRulesIsMutable(); rules_.add(index, builderForValue.build()); onChanged(); } else { rulesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder addAllRules( java.lang.Iterable values) { if (rulesBuilder_ == null) { ensureRulesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, rules_); onChanged(); } else { rulesBuilder_.addAllMessages(values); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { rulesBuilder_.clear(); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public Builder removeRules(int index) { if (rulesBuilder_ == null) { ensureRulesIsMutable(); rules_.remove(index); onChanged(); } else { rulesBuilder_.remove(index); } return this; } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder getRulesBuilder( int index) { return getRulesFieldBuilder().getBuilder(index); } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRuleOrBuilder getRulesOrBuilder( int index) { if (rulesBuilder_ == null) { return rules_.get(index); } else { return rulesBuilder_.getMessageOrBuilder(index); } } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesOrBuilderList() { if (rulesBuilder_ != null) { return rulesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(rules_); } } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder addRulesBuilder() { return getRulesFieldBuilder().addBuilder( com.google.api.UsageRule.getDefaultInstance()); } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder addRulesBuilder( int index) { return getRulesFieldBuilder().addBuilder( index, com.google.api.UsageRule.getDefaultInstance()); } /** *
     * Individual rules for configuring usage on selected methods.
     * 
* * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesBuilderList() { return getRulesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.api.UsageRule, com.google.api.UsageRule.Builder, com.google.api.UsageRuleOrBuilder> getRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.api.UsageRule, com.google.api.UsageRule.Builder, com.google.api.UsageRuleOrBuilder>( rules_, ((bitField0_ & 0x00000020) == 0x00000020), getParentForChildren(), isClean()); rules_ = null; } return rulesBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } // @@protoc_insertion_point(builder_scope:google.api.Usage) } // @@protoc_insertion_point(class_scope:google.api.Usage) private static final com.google.api.Usage DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.api.Usage(); } public static com.google.api.Usage getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { public Usage parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Usage(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } public com.google.api.Usage getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy