@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.monitoring.v3.CreateMetricDescriptorRequest other) { if (other == com.google.monitoring.v3.CreateMetricDescriptorRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasMetricDescriptor()) { mergeMetricDescriptor(other.getMetricDescriptor()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public com.google.monitoring.v3.CreateMetricDescriptorRequest buildPartial() { com.google.monitoring.v3.CreateMetricDescriptorRequest result = new com.google.monitoring.v3.CreateMetricDescriptorRequest(this); result.name_ = name_; if (metricDescriptorBuilder_ == null) { result.metricDescriptor_ = metricDescriptor_; } else { result.metricDescriptor_ = metricDescriptorBuilder_.build(); } onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.CreateMetricDescriptorRequest)) { return super.equals(obj); } com.google.monitoring.v3.CreateMetricDescriptorRequest other = (com.google.monitoring.v3.CreateMetricDescriptorRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasMetricDescriptor() == other.hasMetricDescriptor()); if (hasMetricDescriptor()) { result = result && getMetricDescriptor().equals(other.getMetricDescriptor()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (metricDescriptor_ != null) { output.writeMessage(2, getMetricDescriptor()); } if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } unknownFields.writeTo(output); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasMetricDescriptor()) { hash = (37 * hash) + METRIC_DESCRIPTOR_FIELD_NUMBER; hash = (53 * hash) + getMetricDescriptor().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasMetricDescriptor()) { hash = (37 * hash) + METRIC_DESCRIPTOR_FIELD_NUMBER; hash = (53 * hash) + getMetricDescriptor().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The project on which to execute the request. The format is * `"projects/{project_id_or_number}"`. * </pre> * * <code>string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
(CreateMetricDescriptorRequest) actualRequests.get(0); Assert.assertEquals(name, ProjectName.parse(actualRequest.getName())); Assert.assertEquals(metricDescriptor, actualRequest.getMetricDescriptor()); Assert.assertTrue( channelProvider.isHeaderSent(
@java.lang.Override public com.google.monitoring.v3.CreateMetricDescriptorRequest getDefaultInstanceForType() { return com.google.monitoring.v3.CreateMetricDescriptorRequest.getDefaultInstance(); }
/** * * * <pre> * The new [custom metric](/monitoring/custom-metrics) * descriptor. * </pre> * * <code>.google.api.MetricDescriptor metric_descriptor = 2;</code> */ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { return getMetricDescriptor(); }
@java.lang.Override public com.google.monitoring.v3.CreateMetricDescriptorRequest build() { com.google.monitoring.v3.CreateMetricDescriptorRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.CreateMetricDescriptorRequest)) { return super.equals(obj); } com.google.monitoring.v3.CreateMetricDescriptorRequest other = (com.google.monitoring.v3.CreateMetricDescriptorRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && (hasMetricDescriptor() == other.hasMetricDescriptor()); if (hasMetricDescriptor()) { result = result && getMetricDescriptor() .equals(other.getMetricDescriptor()); } return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (metricDescriptor_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetricDescriptor()); } if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * <pre> * The project on which to execute the request. The format is * `"projects/{project_id_or_number}"`. * </pre> * * <code>optional string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
io.grpc.protobuf.ProtoUtils.marshaller( com.google.monitoring.v3.CreateMetricDescriptorRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * <pre> * The new [custom metric](/monitoring/custom-metrics) * descriptor. * </pre> * * <code>optional .google.api.MetricDescriptor metric_descriptor = 2;</code> */ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { return getMetricDescriptor(); }
public com.google.monitoring.v3.CreateMetricDescriptorRequest build() { com.google.monitoring.v3.CreateMetricDescriptorRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](/monitoring/custom-metrics). * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * ProjectName name = ProjectName.of("[PROJECT]"); * MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build(); * MetricDescriptor response = metricServiceClient.createMetricDescriptor(name.toString(), metricDescriptor); * } * </code></pre> * * @param name The project on which to execute the request. The format is * `"projects/{project_id_or_number}"`. * @param metricDescriptor The new [custom metric](/monitoring/custom-metrics) descriptor. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor createMetricDescriptor( String name, MetricDescriptor metricDescriptor) { CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder() .setName(name) .setMetricDescriptor(metricDescriptor) .build(); return createMetricDescriptor(request); }
public Builder mergeFrom(com.google.monitoring.v3.CreateMetricDescriptorRequest other) { if (other == com.google.monitoring.v3.CreateMetricDescriptorRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasMetricDescriptor()) { mergeMetricDescriptor(other.getMetricDescriptor()); } onChanged(); return this; }