Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/monitoring.proto
package com.google.api;
/**
*
* Monitoring configuration of the service.
* The example below shows how to configure monitored resources and metrics
* for monitoring. In the example, a monitored resource and two metrics are
* defined. The `library.googleapis.com/book/returned_count` metric is sent
* to both producer and consumer projects, whereas the
* `library.googleapis.com/book/overdue_count` metric is only sent to the
* consumer project.
* monitored_resources:
* - type: library.googleapis.com/branch
* labels:
* - key: /city
* description: The city where the library branch is located in.
* - key: /name
* description: The name of the branch.
* metrics:
* - name: library.googleapis.com/book/returned_count
* metric_kind: DELTA
* value_type: INT64
* labels:
* - key: /customer_id
* - name: library.googleapis.com/book/overdue_count
* metric_kind: GAUGE
* value_type: INT64
* labels:
* - key: /customer_id
* monitoring:
* producer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* consumer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* - library.googleapis.com/book/overdue_count
*
*
* Protobuf type {@code google.api.Monitoring}
*/
public final class Monitoring extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.Monitoring)
MonitoringOrBuilder {
private static final long serialVersionUID = 0L;
// Use Monitoring.newBuilder() to construct.
private Monitoring(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Monitoring() {
producerDestinations_ = java.util.Collections.emptyList();
consumerDestinations_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Monitoring(
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;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
producerDestinations_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
producerDestinations_.add(
input.readMessage(com.google.api.Monitoring.MonitoringDestination.parser(), extensionRegistry));
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
consumerDestinations_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
consumerDestinations_.add(
input.readMessage(com.google.api.Monitoring.MonitoringDestination.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_ & 0x00000001) == 0x00000001)) {
producerDestinations_ = java.util.Collections.unmodifiableList(producerDestinations_);
}
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
consumerDestinations_ = java.util.Collections.unmodifiableList(consumerDestinations_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.Monitoring.class, com.google.api.Monitoring.Builder.class);
}
public interface MonitoringDestinationOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.api.Monitoring.MonitoringDestination)
com.google.protobuf.MessageOrBuilder {
/**
*
* The monitored resource type. The type must be defined in
* [Service.monitored_resources][google.api.Service.monitored_resources] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* The monitored resource type. The type must be defined in
* [Service.monitored_resources][google.api.Service.monitored_resources] section.
*
*
* string monitored_resource = 1;
*/
public com.google.protobuf.ByteString
getMonitoredResourceBytes() {
java.lang.Object ref = monitoredResource_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
monitoredResource_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int METRICS_FIELD_NUMBER = 2;
private com.google.protobuf.LazyStringList metrics_;
/**
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
*
* repeated string metrics = 2;
*/
public int getMetricsCount() {
return metrics_.size();
}
/**
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
*
* repeated string metrics = 2;
*/
public com.google.protobuf.ByteString
getMetricsBytes(int index) {
return metrics_.getByteString(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 {
if (!getMonitoredResourceBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, monitoredResource_);
}
for (int i = 0; i < metrics_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, metrics_.getRaw(i));
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getMonitoredResourceBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, monitoredResource_);
}
{
int dataSize = 0;
for (int i = 0; i < metrics_.size(); i++) {
dataSize += computeStringSizeNoTag(metrics_.getRaw(i));
}
size += dataSize;
size += 1 * getMetricsList().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.google.api.Monitoring.MonitoringDestination)) {
return super.equals(obj);
}
com.google.api.Monitoring.MonitoringDestination other = (com.google.api.Monitoring.MonitoringDestination) obj;
boolean result = true;
result = result && getMonitoredResource()
.equals(other.getMonitoredResource());
result = result && getMetricsList()
.equals(other.getMetricsList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + MONITORED_RESOURCE_FIELD_NUMBER;
hash = (53 * hash) + getMonitoredResource().hashCode();
if (getMetricsCount() > 0) {
hash = (37 * hash) + METRICS_FIELD_NUMBER;
hash = (53 * hash) + getMetricsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.Monitoring.MonitoringDestination parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring.MonitoringDestination parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Monitoring.MonitoringDestination parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring.MonitoringDestination 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.Monitoring.MonitoringDestination parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring.MonitoringDestination parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Monitoring.MonitoringDestination parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.Monitoring.MonitoringDestination 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.Monitoring.MonitoringDestination parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.Monitoring.MonitoringDestination 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.Monitoring.MonitoringDestination parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.Monitoring.MonitoringDestination 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.Monitoring.MonitoringDestination 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 of a specific monitoring destination (the producer project
* or the consumer project).
*
*
* Protobuf type {@code google.api.Monitoring.MonitoringDestination}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.Monitoring.MonitoringDestination)
com.google.api.Monitoring.MonitoringDestinationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_MonitoringDestination_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_MonitoringDestination_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.Monitoring.MonitoringDestination.class, com.google.api.Monitoring.MonitoringDestination.Builder.class);
}
// Construct using com.google.api.Monitoring.MonitoringDestination.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
monitoredResource_ = "";
metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_MonitoringDestination_descriptor;
}
public com.google.api.Monitoring.MonitoringDestination getDefaultInstanceForType() {
return com.google.api.Monitoring.MonitoringDestination.getDefaultInstance();
}
public com.google.api.Monitoring.MonitoringDestination build() {
com.google.api.Monitoring.MonitoringDestination result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.api.Monitoring.MonitoringDestination buildPartial() {
com.google.api.Monitoring.MonitoringDestination result = new com.google.api.Monitoring.MonitoringDestination(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.monitoredResource_ = monitoredResource_;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
metrics_ = metrics_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.metrics_ = metrics_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.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, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.Monitoring.MonitoringDestination) {
return mergeFrom((com.google.api.Monitoring.MonitoringDestination)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.Monitoring.MonitoringDestination other) {
if (other == com.google.api.Monitoring.MonitoringDestination.getDefaultInstance()) return this;
if (!other.getMonitoredResource().isEmpty()) {
monitoredResource_ = other.monitoredResource_;
onChanged();
}
if (!other.metrics_.isEmpty()) {
if (metrics_.isEmpty()) {
metrics_ = other.metrics_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureMetricsIsMutable();
metrics_.addAll(other.metrics_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
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.Monitoring.MonitoringDestination parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.Monitoring.MonitoringDestination) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object monitoredResource_ = "";
/**
*
* The monitored resource type. The type must be defined in
* [Service.monitored_resources][google.api.Service.monitored_resources] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
*
* repeated string metrics = 2;
*/
public int getMetricsCount() {
return metrics_.size();
}
/**
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
*
* repeated string metrics = 2;
*/
public Builder setMetrics(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureMetricsIsMutable();
metrics_.set(index, value);
onChanged();
return this;
}
/**
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
*
*
* repeated string metrics = 2;
*/
public Builder addMetricsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureMetricsIsMutable();
metrics_.add(value);
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.Monitoring.MonitoringDestination)
}
// @@protoc_insertion_point(class_scope:google.api.Monitoring.MonitoringDestination)
private static final com.google.api.Monitoring.MonitoringDestination DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.Monitoring.MonitoringDestination();
}
public static com.google.api.Monitoring.MonitoringDestination getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public MonitoringDestination parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MonitoringDestination(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.Monitoring.MonitoringDestination getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int PRODUCER_DESTINATIONS_FIELD_NUMBER = 1;
private java.util.List producerDestinations_;
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public int getProducerDestinationsCount() {
return producerDestinations_.size();
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinationsOrBuilder(
int index) {
return producerDestinations_.get(index);
}
public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER = 2;
private java.util.List consumerDestinations_;
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public int getConsumerDestinationsCount() {
return consumerDestinations_.size();
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public com.google.api.Monitoring.MonitoringDestinationOrBuilder getConsumerDestinationsOrBuilder(
int index) {
return consumerDestinations_.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 < producerDestinations_.size(); i++) {
output.writeMessage(1, producerDestinations_.get(i));
}
for (int i = 0; i < consumerDestinations_.size(); i++) {
output.writeMessage(2, consumerDestinations_.get(i));
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < producerDestinations_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, producerDestinations_.get(i));
}
for (int i = 0; i < consumerDestinations_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, consumerDestinations_.get(i));
}
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.google.api.Monitoring)) {
return super.equals(obj);
}
com.google.api.Monitoring other = (com.google.api.Monitoring) obj;
boolean result = true;
result = result && getProducerDestinationsList()
.equals(other.getProducerDestinationsList());
result = result && getConsumerDestinationsList()
.equals(other.getConsumerDestinationsList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getProducerDestinationsCount() > 0) {
hash = (37 * hash) + PRODUCER_DESTINATIONS_FIELD_NUMBER;
hash = (53 * hash) + getProducerDestinationsList().hashCode();
}
if (getConsumerDestinationsCount() > 0) {
hash = (37 * hash) + CONSUMER_DESTINATIONS_FIELD_NUMBER;
hash = (53 * hash) + getConsumerDestinationsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.Monitoring parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Monitoring parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring 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.Monitoring parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Monitoring parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Monitoring parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.Monitoring 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.Monitoring parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.Monitoring 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.Monitoring parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.Monitoring 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.Monitoring 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;
}
/**
*
* Monitoring configuration of the service.
* The example below shows how to configure monitored resources and metrics
* for monitoring. In the example, a monitored resource and two metrics are
* defined. The `library.googleapis.com/book/returned_count` metric is sent
* to both producer and consumer projects, whereas the
* `library.googleapis.com/book/overdue_count` metric is only sent to the
* consumer project.
* monitored_resources:
* - type: library.googleapis.com/branch
* labels:
* - key: /city
* description: The city where the library branch is located in.
* - key: /name
* description: The name of the branch.
* metrics:
* - name: library.googleapis.com/book/returned_count
* metric_kind: DELTA
* value_type: INT64
* labels:
* - key: /customer_id
* - name: library.googleapis.com/book/overdue_count
* metric_kind: GAUGE
* value_type: INT64
* labels:
* - key: /customer_id
* monitoring:
* producer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* consumer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* - library.googleapis.com/book/overdue_count
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public int getProducerDestinationsCount() {
if (producerDestinationsBuilder_ == null) {
return producerDestinations_.size();
} else {
return producerDestinationsBuilder_.getCount();
}
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public Builder setProducerDestinations(
int index, com.google.api.Monitoring.MonitoringDestination value) {
if (producerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureProducerDestinationsIsMutable();
producerDestinations_.set(index, value);
onChanged();
} else {
producerDestinationsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public Builder addProducerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
if (producerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureProducerDestinationsIsMutable();
producerDestinations_.add(value);
onChanged();
} else {
producerDestinationsBuilder_.addMessage(value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public Builder addProducerDestinations(
int index, com.google.api.Monitoring.MonitoringDestination value) {
if (producerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureProducerDestinationsIsMutable();
producerDestinations_.add(index, value);
onChanged();
} else {
producerDestinationsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestinationsBuilder(
int index) {
return getProducerDestinationsFieldBuilder().getBuilder(index);
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
*/
public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinationsOrBuilder(
int index) {
if (producerDestinationsBuilder_ == null) {
return producerDestinations_.get(index); } else {
return producerDestinationsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public int getConsumerDestinationsCount() {
if (consumerDestinationsBuilder_ == null) {
return consumerDestinations_.size();
} else {
return consumerDestinationsBuilder_.getCount();
}
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public Builder setConsumerDestinations(
int index, com.google.api.Monitoring.MonitoringDestination value) {
if (consumerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConsumerDestinationsIsMutable();
consumerDestinations_.set(index, value);
onChanged();
} else {
consumerDestinationsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public Builder addConsumerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
if (consumerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConsumerDestinationsIsMutable();
consumerDestinations_.add(value);
onChanged();
} else {
consumerDestinationsBuilder_.addMessage(value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public Builder addConsumerDestinations(
int index, com.google.api.Monitoring.MonitoringDestination value) {
if (consumerDestinationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConsumerDestinationsIsMutable();
consumerDestinations_.add(index, value);
onChanged();
} else {
consumerDestinationsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestinationsBuilder(
int index) {
return getConsumerDestinationsFieldBuilder().getBuilder(index);
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public com.google.api.Monitoring.MonitoringDestinationOrBuilder getConsumerDestinationsOrBuilder(
int index) {
if (consumerDestinationsBuilder_ == null) {
return consumerDestinations_.get(index); } else {
return consumerDestinationsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
*
*
* repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
*/
public java.util.List
getConsumerDestinationsBuilderList() {
return getConsumerDestinationsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder>
getConsumerDestinationsFieldBuilder() {
if (consumerDestinationsBuilder_ == null) {
consumerDestinationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder>(
consumerDestinations_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
consumerDestinations_ = null;
}
return consumerDestinationsBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.Monitoring)
}
// @@protoc_insertion_point(class_scope:google.api.Monitoring)
private static final com.google.api.Monitoring DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.Monitoring();
}
public static com.google.api.Monitoring getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public Monitoring parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Monitoring(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.Monitoring getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}