/** * * * <pre> * The channel type for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. * </pre> * * <code>string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.monitoring.v3.GetNotificationChannelDescriptorRequest buildPartial() { com.google.monitoring.v3.GetNotificationChannelDescriptorRequest result = new com.google.monitoring.v3.GetNotificationChannelDescriptorRequest(this); result.name_ = name_; onBuilt(); return result; }
@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(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.monitoring.v3.GetNotificationChannelDescriptorRequest getDefaultInstanceForType() { return com.google.monitoring.v3.GetNotificationChannelDescriptorRequest.getDefaultInstance(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.GetNotificationChannelDescriptorRequest)) { return super.equals(obj); } com.google.monitoring.v3.GetNotificationChannelDescriptorRequest other = (com.google.monitoring.v3.GetNotificationChannelDescriptorRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && unknownFields.equals(other.unknownFields); return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } unknownFields.writeTo(output); }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public com.google.monitoring.v3.GetNotificationChannelDescriptorRequest build() { com.google.monitoring.v3.GetNotificationChannelDescriptorRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.monitoring.v3.GetNotificationChannelDescriptorRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Test @SuppressWarnings("all") public void getNotificationChannelDescriptorTest() { String name2 = "name2-1052831874"; String type = "type3575610"; String displayName = "displayName1615086568"; String description = "description-1724546052"; NotificationChannelDescriptor expectedResponse = NotificationChannelDescriptor.newBuilder() .setName(name2) .setType(type) .setDisplayName(displayName) .setDescription(description) .build(); mockNotificationChannelService.addResponse(expectedResponse); NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]"); NotificationChannelDescriptor actualResponse = client.getNotificationChannelDescriptor(name); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockNotificationChannelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetNotificationChannelDescriptorRequest actualRequest = (GetNotificationChannelDescriptorRequest) actualRequests.get(0); Assert.assertEquals(name, NotificationChannelDescriptorName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public static Builder newBuilder( com.google.monitoring.v3.GetNotificationChannelDescriptorRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
public Builder mergeFrom( com.google.monitoring.v3.GetNotificationChannelDescriptorRequest other) { if (other == com.google.monitoring.v3.GetNotificationChannelDescriptorRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]"); * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString()); * } * </code></pre> * * @param name The channel type for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) { GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build(); return getNotificationChannelDescriptor(request); }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.monitoring.v3.GetNotificationChannelDescriptorRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]"); * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name); * } * </code></pre> * * @param name The channel type for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final NotificationChannelDescriptor getNotificationChannelDescriptor( NotificationChannelDescriptorName name) { GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getNotificationChannelDescriptor(request); }
/** * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]"); * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString()); * } * </code></pre> * * @param name The channel type for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) { GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build(); return getNotificationChannelDescriptor(request); }
/** * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]"); * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name); * } * </code></pre> * * @param name The channel type for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final NotificationChannelDescriptor getNotificationChannelDescriptor( NotificationChannelDescriptorName name) { GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getNotificationChannelDescriptor(request); }