public static List<String> toStringList(List<NotificationChannelDescriptorName> values) { List<String> list = new ArrayList<String>(values.size()); for (NotificationChannelDescriptorName value : values) { if (value == null) { list.add(""); } else { list.add(value.toString()); } } return list; }
public static String format(String project, String channelDescriptor) { return newBuilder() .setProject(project) .setChannelDescriptor(channelDescriptor) .build() .toString(); }
/** * 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); * } * </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); }