@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.monitoring.v3.GetMetricDescriptorRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.monitoring.v3.GetMetricDescriptorRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. * An example value of `{metric_id}` is * `"compute.googleapis.com/instance/disk/read_bytes_count"`. * </pre> * * <code>string name = 3;</code> */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; }
public Builder mergeFrom(com.google.monitoring.v3.GetMetricDescriptorRequest other) { if (other == com.google.monitoring.v3.GetMetricDescriptorRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getMetricDescriptor(request); }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString()); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(String name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder().setName(name).build(); return getMetricDescriptor(request); }
/** * <pre> * The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. * An example value of `{metric_id}` is * `"compute.googleapis.com/instance/disk/read_bytes_count"`. * </pre> * * <code>optional string name = 3;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } public final Builder setUnknownFields(
/** * <pre> * The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. * An example value of `{metric_id}` is * `"compute.googleapis.com/instance/disk/read_bytes_count"`. * </pre> * * <code>optional string name = 3;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.monitoring.v3.GetMetricDescriptorRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.monitoring.v3.GetMetricDescriptorRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * <pre> * The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. * An example value of `{metric_id}` is * `"compute.googleapis.com/instance/disk/read_bytes_count"`. * </pre> * * <code>optional string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(com.google.monitoring.v3.GetMetricDescriptorRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
public com.google.monitoring.v3.GetMetricDescriptorRequest buildPartial() { com.google.monitoring.v3.GetMetricDescriptorRequest result = new com.google.monitoring.v3.GetMetricDescriptorRequest(this); result.name_ = name_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.monitoring.v3.GetMetricDescriptorRequest) { return mergeFrom((com.google.monitoring.v3.GetMetricDescriptorRequest)other); } else { super.mergeFrom(other); return this; } }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
public com.google.monitoring.v3.GetMetricDescriptorRequest build() { com.google.monitoring.v3.GetMetricDescriptorRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getMetricDescriptor(request); }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString()); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(String name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder().setName(name).build(); return getMetricDescriptor(request); }